diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 615e044ac58..b2bd1152b66 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -551,6 +551,9 @@ The outline color of the selection rectangle. + + Widen the line of the connection when the mouse is hovering over it by a percentage factor. A value of [code]0[/code] disables the highlight. A value of [code]100[/code] doubles the line width. + The horizontal range within which a port can be grabbed (inner side). diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp index 781281383ae..4f3954b65b8 100644 --- a/editor/themes/editor_theme_manager.cpp +++ b/editor/themes/editor_theme_manager.cpp @@ -1563,6 +1563,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref &p_the p_theme->set_color("activity", "GraphEdit", p_config.dark_theme ? Color(1, 1, 1) : Color(0, 0, 0)); p_theme->set_color("connection_hover_tint_color", "GraphEdit", p_config.dark_theme ? Color(0, 0, 0, 0.3) : Color(1, 1, 1, 0.3)); + p_theme->set_constant("connection_hover_thickness", "GraphEdit", 0); p_theme->set_color("connection_valid_target_tint_color", "GraphEdit", p_config.dark_theme ? Color(1, 1, 1, 0.4) : Color(0, 0, 0, 0.4)); p_theme->set_color("connection_rim_color", "GraphEdit", p_config.tree_panel_style->get_bg_color()); diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index fc75aa1f838..2fb3ce886d8 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -1453,6 +1453,10 @@ void GraphEdit::_update_connections() { Ref line_gradient = memnew(Gradient); float line_width = _get_shader_line_width(); + if (conn == hovered_connection) { + line_width *= 1.0f + (theme_cache.connection_hover_thickness / 100.0f); + } + conn->_cache.line->set_width(line_width); line_gradient->set_color(0, from_color); line_gradient->set_color(1, to_color); @@ -2842,6 +2846,7 @@ void GraphEdit::_bind_methods() { BIND_THEME_ITEM_CUSTOM(Theme::DATA_TYPE_COLOR, GraphEdit, activity_color, "activity"); BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, GraphEdit, connection_hover_tint_color); + BIND_THEME_ITEM(Theme::DATA_TYPE_CONSTANT, GraphEdit, connection_hover_thickness); BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, GraphEdit, connection_valid_target_tint_color); BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, GraphEdit, connection_rim_color); BIND_THEME_ITEM(Theme::DATA_TYPE_COLOR, GraphEdit, selection_fill); diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h index 673299a13e0..b0fdd88f43e 100644 --- a/scene/gui/graph_edit.h +++ b/scene/gui/graph_edit.h @@ -275,6 +275,7 @@ private: Color activity_color; Color connection_hover_tint_color; + int connection_hover_thickness; Color connection_valid_target_tint_color; Color connection_rim_color; diff --git a/scene/theme/default_theme.cpp b/scene/theme/default_theme.cpp index f6763bfd4d8..f4dd8a93825 100644 --- a/scene/theme/default_theme.cpp +++ b/scene/theme/default_theme.cpp @@ -1257,6 +1257,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_color("selection_stroke", "GraphEdit", Color(1, 1, 1, 0.8)); theme->set_color("activity", "GraphEdit", Color(1, 1, 1)); theme->set_color("connection_hover_tint_color", "GraphEdit", Color(0, 0, 0, 0.3)); + theme->set_constant("connection_hover_thickness", "GraphEdit", 0); theme->set_color("connection_valid_target_tint_color", "GraphEdit", Color(1, 1, 1, 0.4)); theme->set_color("connection_rim_color", "GraphEdit", style_normal_color);