diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-08-03 14:30:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-03 14:30:42 +0200 |
commit | 9b742f8d82a0e022eee69df64f11e655b6f8639f (patch) | |
tree | 8f036e4ac333f3ff14d87d2a6f460cba6363a8a5 | |
parent | 2c0c76c415f1b8b7d46f63d12b12ef56c8c85f4d (diff) | |
parent | dc0ac50f4543eb4ca3c2d9a044d1f510cba0bdc3 (diff) | |
download | redot-engine-9b742f8d82a0e022eee69df64f11e655b6f8639f.tar.gz |
Merge pull request #48561 from Calinou/editor-theme-selected-tab-border-lineup
-rw-r--r-- | editor/editor_themes.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 02380c4e39..fb92a9e898 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -641,6 +641,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // Add a highlight line at the top of the selected tab. style_tab_selected->set_border_width_all(0); + style_tab_selected->set_default_margin(SIDE_LEFT, widget_default_margin.x - border_width); style_tab_selected->set_border_width(SIDE_TOP, Math::round(2 * EDSCALE)); // Make the highlight line prominent, but not too prominent as to not be distracting. Color tab_highlight = dark_color_2.lerp(accent_color, 0.75); @@ -653,6 +654,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // We can't prevent them with both rounded corners and non-zero border width, though style_tab_selected->set_expand_margin_size(SIDE_BOTTOM, corner_width > 0 ? corner_width : border_width); + // When using a border width greater than 0, visually line up the left of the selected tab with the underlying panel. + style_tab_selected->set_expand_margin_size(SIDE_LEFT, -border_width); + style_tab_selected->set_default_margin(SIDE_LEFT, widget_default_margin.x + 2 * EDSCALE); style_tab_selected->set_default_margin(SIDE_RIGHT, widget_default_margin.x + 2 * EDSCALE); style_tab_selected->set_default_margin(SIDE_BOTTOM, widget_default_margin.y); |