diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-05-09 01:56:22 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-07-30 14:20:54 +0200 |
commit | e92297cc3d9e0b8cccbc390b3ac7316d76a683c4 (patch) | |
tree | bbb6a8cb27734b80f66c797de447090b7dc72078 /editor | |
parent | 6d5c1086c3cc5442b4b8f7c752c941a0ce3150c5 (diff) |
Make the focus outline translucent for editor viewports
This makes the focus outline less distracting on the
2D and 3D editor viewports.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_themes.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index b3b43348d0..c230bdcb73 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -582,6 +582,10 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // Focus theme->set_stylebox("Focus", "EditorStyles", style_widget_focus); + // Use a less opaque color to be less distracting for the 2D and 3D editor viewports. + Ref<StyleBoxFlat> style_widget_focus_viewport = style_widget_focus->duplicate(); + style_widget_focus_viewport->set_border_color(accent_color * Color(1, 1, 1, 0.5)); + theme->set_stylebox("FocusViewport", "EditorStyles", style_widget_focus_viewport); // Menu Ref<StyleBoxFlat> style_menu = style_widget->duplicate(); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index accc96ab4e..c344cdf592 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2655,7 +2655,7 @@ void CanvasItemEditor::_draw_percentage_at_position(float p_value, Point2 p_posi void CanvasItemEditor::_draw_focus() { // Draw the focus around the base viewport if (viewport->has_focus()) { - get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles"))->draw(viewport->get_canvas_item(), Rect2(Point2(), viewport->get_size())); + get_theme_stylebox(SNAME("FocusViewport"), SNAME("EditorStyles"))->draw(viewport->get_canvas_item(), Rect2(Point2(), viewport->get_size())); } } diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index a278b5a37f..5eb549d58c 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -2871,7 +2871,7 @@ void Node3DEditorViewport::_draw() { if (surface->has_focus()) { Size2 size = surface->get_size(); Rect2 r = Rect2(Point2(), size); - get_theme_stylebox(SNAME("Focus"), SNAME("EditorStyles"))->draw(surface->get_canvas_item(), r); + get_theme_stylebox(SNAME("FocusViewport"), SNAME("EditorStyles"))->draw(surface->get_canvas_item(), r); } if (cursor.region_select) { |