summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Alexsander <michaelalexsander@protonmail.com>2019-10-27 19:45:03 -0300
committerMichael Alexsander <michaelalexsander@protonmail.com>2019-10-27 19:45:03 -0300
commitd92123ed978ab3599baec0db76c42cfa8f8e2bcd (patch)
treeaf84aebbb70ef670f29d02cb25da08185e9f324f
parent816341af25749e3c2ee1fad370c0c5785293f5b6 (diff)
Add "panel" style to PopupDialog
-rw-r--r--doc/classes/PopupDialog.xml5
-rw-r--r--editor/editor_themes.cpp6
-rw-r--r--scene/gui/dialogs.cpp2
-rw-r--r--scene/resources/default_theme/default_theme.cpp7
4 files changed, 16 insertions, 4 deletions
diff --git a/doc/classes/PopupDialog.xml b/doc/classes/PopupDialog.xml
index d85f568abf..939453b977 100644
--- a/doc/classes/PopupDialog.xml
+++ b/doc/classes/PopupDialog.xml
@@ -12,4 +12,9 @@
</methods>
<constants>
</constants>
+ <theme_items>
+ <theme_item name="panel" type="StyleBox">
+ Sets a custom [StyleBox] for the panel of the [PopupDialog].
+ </theme_item>
+ </theme_items>
</class>
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 0c7c2c6cc3..a49c3eac73 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -648,9 +648,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_constant("hseparation", "CheckBox", 4 * EDSCALE);
theme->set_constant("check_vadjust", "CheckBox", 0 * EDSCALE);
+ // PopupDialog
+ theme->set_stylebox("panel", "PopupDialog", style_popup);
+
// PopupMenu
- Ref<StyleBoxFlat> style_popup_menu = style_popup;
- theme->set_stylebox("panel", "PopupMenu", style_popup_menu);
+ theme->set_stylebox("panel", "PopupMenu", style_popup);
theme->set_stylebox("separator", "PopupMenu", style_popup_separator);
theme->set_stylebox("labeled_separator_left", "PopupMenu", style_popup_labeled_separator_left);
theme->set_stylebox("labeled_separator_right", "PopupMenu", style_popup_labeled_separator_right);
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 31551d6257..062089d80b 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -356,7 +356,7 @@ void PopupDialog::_notification(int p_what) {
if (p_what == NOTIFICATION_DRAW) {
RID ci = get_canvas_item();
- get_stylebox("panel", "PopupMenu")->draw(ci, Rect2(Point2(), get_size()));
+ get_stylebox("panel")->draw(ci, Rect2(Point2(), get_size()));
}
}
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 1a053a18c9..e82819f270 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -558,9 +558,14 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("panel", "PopupPanel", style_pp);
+ // PopupDialog
+
+ Ref<StyleBoxTexture> style_pd = make_stylebox(popup_bg_png, 4, 4, 4, 4, 10, 10, 10, 10);
+ theme->set_stylebox("panel", "PopupDialog", style_pd);
+
// PopupMenu
- theme->set_stylebox("panel", "PopupMenu", make_stylebox(popup_bg_png, 4, 4, 4, 4, 10, 10, 10, 10));
+ theme->set_stylebox("panel", "PopupMenu", style_pd);
theme->set_stylebox("panel_disabled", "PopupMenu", make_stylebox(popup_bg_disabled_png, 4, 4, 4, 4));
theme->set_stylebox("hover", "PopupMenu", selected);
theme->set_stylebox("separator", "PopupMenu", make_stylebox(vseparator_png, 3, 3, 3, 3));