File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
addons/block_code/ui/blocks Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ var pinned: bool:
50
50
51
51
pinned = value
52
52
53
- if not block_pinned_container :
53
+ if pinned :
54
54
block_pinned_container = Container .new ()
55
55
block_pinned_container .mouse_filter = Control .MOUSE_FILTER_IGNORE
56
56
@@ -66,6 +66,9 @@ var pinned: bool:
66
66
block_pinned_panel .add_child (block_pinned_icon )
67
67
block_pinned_container .add_child (block_pinned_panel )
68
68
add_child (block_pinned_container )
69
+ else :
70
+ remove_child (block_pinned_container )
71
+ block_pinned_container .queue_free ()
69
72
70
73
block_pinned_container .visible = pinned
71
74
Original file line number Diff line number Diff line change @@ -42,13 +42,13 @@ func _gui_input(event: InputEvent) -> void:
42
42
if button_event .button_index == MOUSE_BUTTON_LEFT :
43
43
_drag_start_position = event .global_position
44
44
else :
45
+ if not parent_block :
46
+ parent_block = BlockTreeUtil .get_parent_block (self )
47
+
45
48
if parent_block and parent_block .can_delete :
46
49
# Accepts to avoid menu conflicts
47
50
accept_event ()
48
51
49
- if not parent_block :
50
- parent_block = BlockTreeUtil .get_parent_block (self )
51
-
52
52
# A new right-click menu with items
53
53
var _context_menu := PopupMenu .new ()
54
54
_context_menu .add_icon_item (EditorInterface .get_editor_theme ().get_icon ("Duplicate" , "EditorIcons" ), "Duplicate" )
You can’t perform that action at this time.
0 commit comments