diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-02 15:51:41 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-02 15:51:41 -0300 |
commit | b0b1da69505fe4d9fa3af3e232ffff726f6c055e (patch) | |
tree | 902e5d7c25b0bcc30b4b18088bb9701f2c55932f | |
parent | be73e2d2f272d08e68a3eb82346c1ac1dcd99dcd (diff) |
Make buttons properly obey stylebox content marins, closes #2156
-rw-r--r-- | scene/gui/button.cpp | 4 | ||||
-rw-r--r-- | tools/editor/code_editor.cpp | 1 | ||||
-rw-r--r-- | tools/editor/plugins/path_2d_editor_plugin.cpp | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 59f2f34b82..b9ce46d738 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -137,8 +137,10 @@ void Button::_notification(int p_what) { text_ofs.y+=font->get_ascent(); font->draw( ci, text_ofs.floor(), text, color,clip_text?text_clip:-1); if (!_icon.is_null()) { + + int valign = size.height-style->get_minimum_size().y; - _icon->draw(ci,Point2(style->get_offset().x, Math::floor( (size.height-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) ); + _icon->draw(ci,style->get_offset()+Point2(0, Math::floor( (valign-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) ); } diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index 59167abc22..fe863bfebc 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -612,6 +612,7 @@ CodeTextEditor::CodeTextEditor() { if (!font_overrode) text_editor->add_font_override("font",get_font("source","Fonts")); + text_editor->set_show_line_numbers(true); text_editor->set_brace_matching(true); text_editor->set_auto_indent(true); diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/tools/editor/plugins/path_2d_editor_plugin.cpp index 95c74b1676..509edbe5f8 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.cpp +++ b/tools/editor/plugins/path_2d_editor_plugin.cpp @@ -534,6 +534,7 @@ void Path2DEditor::edit(Node *p_path2d) { if (!node->is_connected("visibility_changed", this, "_node_visibility_changed")) node->connect("visibility_changed", this, "_node_visibility_changed"); + } else { if (canvas_item_editor->get_viewport_control()->is_connected("draw",this,"_canvas_draw")) |