summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorMichael Alexsander <michaelalexsander@protonmail.com>2022-01-13 18:13:45 -0300
committerMichael Alexsander <michaelalexsander@protonmail.com>2022-02-07 09:55:25 -0300
commit59e9a8c275ac56bdc23883d8902920e93bcb6c69 (patch)
tree1c29e65932faac7b441870c06bbd5eecbd1c7c0a /editor
parent1694626e03639cdf6879117e00772bdcc6bad594 (diff)
Fix theming for floating window docks
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp7
-rw-r--r--editor/editor_themes.cpp2
2 files changed, 5 insertions, 4 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index b98b7fd3dc..a4b6790d1c 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -4236,8 +4236,9 @@ void EditorNode::_dock_make_float() {
Control *dock = dock_slot[dock_popup_selected]->get_current_tab_control();
ERR_FAIL_COND(!dock);
- const Size2i borders = Size2i(4, 4) * EDSCALE;
- Size2 dock_size = dock->get_size() + borders * 2; // remember size
+ Size2 borders = Size2(4, 4) * EDSCALE;
+ // Remember size and position before removing it from the main window.
+ Size2 dock_size = dock->get_size() + borders * 2;
Point2 dock_screen_pos = dock->get_global_position() + get_tree()->get_root()->get_position() - borders;
int dock_index = dock->get_index();
@@ -4246,7 +4247,7 @@ void EditorNode::_dock_make_float() {
Window *window = memnew(Window);
window->set_title(dock->get_name());
Panel *p = memnew(Panel);
- p->set_mode(Panel::MODE_FOREGROUND);
+ p->add_theme_style_override("panel", gui_base->get_theme_stylebox(SNAME("PanelForeground"), SNAME("EditorStyles")));
p->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
window->add_child(p);
MarginContainer *margin = memnew(MarginContainer);
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index ad5012edbf..7aa5ba7023 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -1279,7 +1279,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
// Panel
theme->set_stylebox(SNAME("panel"), SNAME("Panel"), make_flat_stylebox(dark_color_1, 6, 4, 6, 4, corner_width));
- theme->set_stylebox(SNAME("panel_fg"), SNAME("Panel"), style_default);
+ theme->set_stylebox(SNAME("PanelForeground"), SNAME("EditorStyles"), style_default);
// Label
theme->set_stylebox(SNAME("normal"), SNAME("Label"), style_empty);