summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-02 23:19:51 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-02 23:19:51 +0200
commit9dfa14d5c2b906d953d3aec76a994af97e0084c2 (patch)
tree0ff070b9949c2bbaf4c88600e4b9ffbab798cb71
parent18ee0da032b7fe86c57bde6b8d1189cd9739dc3f (diff)
parentb42d692648b0eb36a33c1387002708d0a7a465f0 (diff)
Merge pull request #65181 from fire-forge/corner-details
-rw-r--r--editor/editor_themes.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 571e017cd6..76d5daadfb 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -182,7 +182,7 @@ static Ref<StyleBoxFlat> make_flat_stylebox(Color p_color, float p_margin_left =
Ref<StyleBoxFlat> style(memnew(StyleBoxFlat));
style->set_bg_color(p_color);
// Adjust level of detail based on the corners' effective sizes.
- style->set_corner_detail(Math::ceil(1.5 * p_corner_width * EDSCALE));
+ style->set_corner_detail(Math::ceil(0.8 * p_corner_width * EDSCALE));
style->set_corner_radius_all(p_corner_width * EDSCALE);
style->set_default_margin(SIDE_LEFT, p_margin_left * EDSCALE);
style->set_default_margin(SIDE_RIGHT, p_margin_right * EDSCALE);
@@ -593,7 +593,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
Ref<StyleBoxFlat> style_default = make_flat_stylebox(base_color, default_margin_size, default_margin_size, default_margin_size, default_margin_size, corner_width);
style_default->set_border_width_all(border_width);
style_default->set_border_color(base_color);
- style_default->set_draw_center(true);
// Button and widgets
const float extra_spacing = EDITOR_GET("interface/theme/additional_spacing");
@@ -664,10 +663,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
style_tab_base->set_border_width_all(0);
// Don't round the top corners to avoid creating a small blank space between the tabs and the main panel.
// This also makes the top highlight look better.
- style_tab_base->set_corner_detail(corner_width);
- style_tab_base->set_corner_radius_all(0);
- style_tab_base->set_corner_radius(CORNER_TOP_LEFT, corner_radius * EDSCALE);
- style_tab_base->set_corner_radius(CORNER_TOP_RIGHT, corner_radius * EDSCALE);
+ style_tab_base->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
+ style_tab_base->set_corner_radius(CORNER_BOTTOM_RIGHT, 0);
// Prevent visible artifacts and cover the top-left rounded corner of the panel below the tab if selected
// We can't prevent them with both rounded corners and non-zero border width, though
@@ -1653,6 +1650,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
graphsbcomment->set_border_width(SIDE_TOP, 24 * EDSCALE);
graphsbcommentselected->set_border_width(SIDE_TOP, 24 * EDSCALE);
+ graphsb->set_corner_detail(corner_radius * EDSCALE);
+ graphsbselected->set_corner_detail(corner_radius * EDSCALE);
+ graphsbcomment->set_corner_detail(corner_radius * EDSCALE);
+ graphsbcommentselected->set_corner_detail(corner_radius * EDSCALE);
+
theme->set_stylebox("frame", "GraphNode", graphsb);
theme->set_stylebox("selected_frame", "GraphNode", graphsbselected);
theme->set_stylebox("comment", "GraphNode", graphsbcomment);