You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
Add "panel" style to PopupDialog
This commit is contained in:
@@ -12,4 +12,9 @@
|
|||||||
</methods>
|
</methods>
|
||||||
<constants>
|
<constants>
|
||||||
</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>
|
</class>
|
||||||
|
|||||||
@@ -648,9 +648,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
|||||||
theme->set_constant("hseparation", "CheckBox", 4 * EDSCALE);
|
theme->set_constant("hseparation", "CheckBox", 4 * EDSCALE);
|
||||||
theme->set_constant("check_vadjust", "CheckBox", 0 * EDSCALE);
|
theme->set_constant("check_vadjust", "CheckBox", 0 * EDSCALE);
|
||||||
|
|
||||||
|
// PopupDialog
|
||||||
|
theme->set_stylebox("panel", "PopupDialog", style_popup);
|
||||||
|
|
||||||
// PopupMenu
|
// PopupMenu
|
||||||
Ref<StyleBoxFlat> style_popup_menu = style_popup;
|
theme->set_stylebox("panel", "PopupMenu", style_popup);
|
||||||
theme->set_stylebox("panel", "PopupMenu", style_popup_menu);
|
|
||||||
theme->set_stylebox("separator", "PopupMenu", style_popup_separator);
|
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_left", "PopupMenu", style_popup_labeled_separator_left);
|
||||||
theme->set_stylebox("labeled_separator_right", "PopupMenu", style_popup_labeled_separator_right);
|
theme->set_stylebox("labeled_separator_right", "PopupMenu", style_popup_labeled_separator_right);
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ void PopupDialog::_notification(int p_what) {
|
|||||||
|
|
||||||
if (p_what == NOTIFICATION_DRAW) {
|
if (p_what == NOTIFICATION_DRAW) {
|
||||||
RID ci = get_canvas_item();
|
RID ci = get_canvas_item();
|
||||||
get_stylebox("panel", "PopupMenu")->draw(ci, Rect2(Point2(), get_size()));
|
get_stylebox("panel")->draw(ci, Rect2(Point2(), get_size()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -558,9 +558,14 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
|
|||||||
|
|
||||||
theme->set_stylebox("panel", "PopupPanel", style_pp);
|
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
|
// 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("panel_disabled", "PopupMenu", make_stylebox(popup_bg_disabled_png, 4, 4, 4, 4));
|
||||||
theme->set_stylebox("hover", "PopupMenu", selected);
|
theme->set_stylebox("hover", "PopupMenu", selected);
|
||||||
theme->set_stylebox("separator", "PopupMenu", make_stylebox(vseparator_png, 3, 3, 3, 3));
|
theme->set_stylebox("separator", "PopupMenu", make_stylebox(vseparator_png, 3, 3, 3, 3));
|
||||||
|
|||||||
Reference in New Issue
Block a user