Make the focus outline translucent for editor viewports
This makes the focus outline less distracting on the 2D and 3D editor viewports.
This commit is contained in:
parent
6d5c1086c3
commit
e92297cc3d
@ -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();
|
||||
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user