From 996433f46de0fdc50079942990eebc39306d4837 Mon Sep 17 00:00:00 2001 From: Flairieve Date: Fri, 29 Nov 2019 03:57:56 -0600 Subject: [PATCH] Fixed color picker bug --- addons/graphics_editor/ColorPicker.gd | 6 +++--- addons/graphics_editor/Editor.tscn | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/graphics_editor/ColorPicker.gd b/addons/graphics_editor/ColorPicker.gd index 07d628d..c80b70f 100644 --- a/addons/graphics_editor/ColorPicker.gd +++ b/addons/graphics_editor/ColorPicker.gd @@ -1,14 +1,14 @@ tool extends ColorPickerButton -#TODO: Picking a color from the canvas is actually broken? - var color_picking = false var mouse_on_top = false func _ready(): var color_picker = get_picker() + var color_picker_popup = get_popup() var color_picker_button = color_picker.get_children()[0].get_children()[1] + color_picker_popup.connect("popup_hide", self, "color_picker_popup_hide") color_picker_button.disconnect("pressed", color_picker, "_screen_pick_pressed") color_picker_button.connect("pressed", self, "color_picker_button_pressed") @@ -24,7 +24,7 @@ func color_picker_button_pressed(): if not color_picking: color_picking = true -func _on_ColorPicker_focus_exited(): +func color_picker_popup_hide(): color_picking = false func _on_ColorPicker_mouse_entered(): diff --git a/addons/graphics_editor/Editor.tscn b/addons/graphics_editor/Editor.tscn index 152548f..f0a00a5 100644 --- a/addons/graphics_editor/Editor.tscn +++ b/addons/graphics_editor/Editor.tscn @@ -283,7 +283,6 @@ script = ExtResource( 15 ) [connection signal="pressed" from="ToolMenu/Buttons/BucketTool" to="." method="_on_BucketTool_pressed"] [connection signal="pressed" from="ToolMenu/Buttons/RainbowTool" to="." method="_on_RainbowTool_pressed"] [connection signal="color_changed" from="ToolMenu/Buttons/ColorPicker" to="." method="_on_ColorPicker_color_changed"] -[connection signal="focus_exited" from="ToolMenu/Buttons/ColorPicker" to="ToolMenu/Buttons/ColorPicker" method="_on_ColorPicker_focus_exited"] [connection signal="mouse_entered" from="ToolMenu/Buttons/ColorPicker" to="ToolMenu/Buttons/ColorPicker" method="_on_ColorPicker_mouse_entered"] [connection signal="mouse_exited" from="ToolMenu/Buttons/ColorPicker" to="ToolMenu/Buttons/ColorPicker" method="_on_ColorPicker_mouse_exited"] [connection signal="pressed" from="ToolMenu/Layers/Panel/AddLayer" to="ToolMenu/Layers" method="_on_AddLayer_pressed"]