@@ -16,14 +16,15 @@ var csf : float
1616var popup_menu_item_height : int
1717
1818const MAX_POPUP_HEIGHT = 375
19+ const SLOT_SVG = "<svg width=\" 16\" height=\" 16\" >
20+ <circle cx=\" 8\" cy=\" 8\" r=\" 5\" fill=\" #FFF\" /></svg>"
1921
20- const INACTIVE_COLOR := Color .DIM_GRAY
21- const INACTIVE_LINK_COLOR := Color .WHITE
22- const ACTIVE_COLOR := Color (0.643 , 0.514 , 1.0 , 1.0 )
23- const ACTIVE_LINK_COLOR := Color (0.753 , 0.667 , 1.0 , 1.0 )
24- const CONTEXT_COLOR := Color .STEEL_BLUE
25- const CONTEXT_LINK_COLOR := Color (0.374 , 0.609 , 0.805 , 1.0 )
26- const SLOT_SVG = "<svg width=\" 16\" height=\" 16\" ><circle cx=\" 8\" cy=\" 8\" r=\" 5\" fill=\" #FFF\" /></svg>"
22+ var inactive_color : Color
23+ var inactive_link_color : Color
24+ var active_color : Color
25+ var active_link_color : Color
26+ var context_color : Color
27+ var context_link_color : Color
2728
2829var source : GraphNode
2930var target : GraphNode
@@ -43,32 +44,40 @@ func _ready() -> void:
4344 popup_menu_item_height = (get_theme_constant ("v_separation" , "PopupMenu" )
4445 + get_theme_font_size ("font" ))
4546
47+ _setup_colors ()
4648 frame = StyleBoxFlat .new ()
47- frame .border_color = INACTIVE_COLOR
48- frame .corner_detail = 4
4949 frame .draw_center = false
50- frame .set_border_width_all (7 )
51- frame .set_corner_radius_all (4 )
52- frame .set_expand_margin_all (12.0 )
50+ frame .border_color = inactive_color
51+ frame .corner_detail = get_theme_constant ("corner_detail" , "MM_LazyLink" )
52+ frame .set_border_width_all (get_theme_constant ("border_width" , "MM_LazyLink" ))
53+ frame .set_corner_radius_all (get_theme_constant ("corner_radius" , "MM_LazyLink" ))
54+ frame .set_expand_margin_all (get_theme_constant ("expand_margin" , "MM_LazyLink" ))
5355
5456 linked_frame = frame .duplicate ()
55- linked_frame .border_color = ACTIVE_COLOR
57+ linked_frame .border_color = active_color
5658
59+ func _setup_colors () -> void :
60+ inactive_color = get_theme_color ("inactive_color" , "MM_LazyLink" )
61+ inactive_link_color = get_theme_color ("inactive_link_color" , "MM_LazyLink" )
62+ active_color = get_theme_color ("active_color" , "MM_LazyLink" )
63+ active_link_color = get_theme_color ("active_link_color" , "MM_LazyLink" )
64+ context_color = get_theme_color ("context_color" , "MM_LazyLink" )
65+ context_link_color = get_theme_color ("context_link_color" , "MM_LazyLink" )
5766
5867func _draw () -> void :
5968 if not is_context_linking and source :
6069 if target :
6170 if is_context_link :
62- _set_colors (INACTIVE_COLOR , CONTEXT_COLOR ,
63- CONTEXT_LINK_COLOR , CONTEXT_COLOR )
71+ _set_colors (inactive_color , context_color ,
72+ context_link_color , context_color )
6473 else :
65- _set_colors (ACTIVE_COLOR , ACTIVE_COLOR ,
66- ACTIVE_LINK_COLOR , ACTIVE_COLOR )
74+ _set_colors (active_color , active_color ,
75+ active_link_color , active_color )
6776 draw_style_box (linked_frame , source .get_rect ())
6877 draw_style_box (linked_frame , target .get_rect ())
6978 else :
70- _set_colors (INACTIVE_COLOR , INACTIVE_COLOR ,
71- INACTIVE_LINK_COLOR , INACTIVE_COLOR )
79+ _set_colors (inactive_color , inactive_color ,
80+ inactive_link_color , inactive_color )
7281 draw_style_box (frame , source .get_rect ())
7382
7483
0 commit comments