aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Haas2017-04-14 17:51:22 +0200
committerGitHub2017-04-14 17:51:22 +0200
commit0ffa923bca33a22f59dc5d7203f2e3c3b7655cd7 (patch)
treef1771cdd22865bde25f7ecc4987021260fee9e59
parent2e68d4b407e04fd2f0761404df8f382e5e9a58d9 (diff)
parent4a0aac4fb30cbf9cb6c9d5725e0a8c6c7aa19730 (diff)
downloadgodot-0ffa923bca33a22f59dc5d7203f2e3c3b7655cd7.tar.gz
godot-0ffa923bca33a22f59dc5d7203f2e3c3b7655cd7.tar.zst
godot-0ffa923bca33a22f59dc5d7203f2e3c3b7655cd7.zip
Merge pull request #8369 from volzhs/fix-stylebox-2.1
Fix editor style box for ToolButton (2.1)
-rw-r--r--scene/resources/default_theme/default_theme.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index f564052ed..96be6140d 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -267,16 +267,10 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
// ToolButton
- Ref<StyleBox> tb_empty = memnew(StyleBoxEmpty);
- tb_empty->set_default_margin(MARGIN_LEFT, 6 * scale);
- tb_empty->set_default_margin(MARGIN_RIGHT, 6 * scale);
- tb_empty->set_default_margin(MARGIN_TOP, 4 * scale);
- tb_empty->set_default_margin(MARGIN_BOTTOM, 4 * scale);
-
- t->set_stylebox("normal", "ToolButton", tb_empty);
- t->set_stylebox("pressed", "ToolButton", make_stylebox(button_pressed_png, 4, 4, 4, 4));
- t->set_stylebox("hover", "ToolButton", make_stylebox(button_normal_png, 4, 4, 4, 4));
- t->set_stylebox("disabled", "ToolButton", make_empty_stylebox(4, 4, 4, 4));
+ t->set_stylebox("normal", "ToolButton", make_empty_stylebox(6, 4, 6, 4));
+ t->set_stylebox("pressed", "ToolButton", make_stylebox(button_pressed_png, 4, 4, 4, 4, 6, 4, 6, 4));
+ t->set_stylebox("hover", "ToolButton", make_stylebox(button_normal_png, 4, 4, 4, 4, 6, 4, 6, 4));
+ t->set_stylebox("disabled", "ToolButton", make_empty_stylebox(6, 4, 6, 4));
t->set_stylebox("focus", "ToolButton", focus);
t->set_font("font", "ToolButton", default_font);