1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Disable "New Brush" in the Edit menu if there is no selection

This commit is contained in:
Manolis Papadeas 2021-11-06 17:19:20 +02:00
parent f6b15cb562
commit 87261e93c6
2 changed files with 3 additions and 0 deletions

View file

@ -105,6 +105,7 @@ func selection_bitmap_changed() -> void:
image = bitmap_to_image(selection_bitmap)
image_texture.create_from_image(image, 0)
Global.canvas.selection.marching_ants_outline.texture = image_texture
Global.top_menu_container.edit_menu_button.get_popup().set_item_disabled(6, !has_selection)
func _selection_offset_changed(value : Vector2) -> void:
@ -226,6 +227,7 @@ func change_project() -> void:
Global.canvas.selection.big_bounding_rectangle = get_selection_rectangle()
Global.canvas.selection.big_bounding_rectangle.position += selection_offset
Global.canvas.selection.update()
Global.top_menu_container.edit_menu_button.get_popup().set_item_disabled(6, !has_selection)
var i := 0
for camera in [Global.camera, Global.camera2, Global.camera_preview]:

View file

@ -91,6 +91,7 @@ func setup_edit_menu() -> void:
edit_menu.add_item(item, i, edit_menu_items[item])
i += 1
edit_menu.set_item_disabled(6, true)
edit_menu.connect("id_pressed", self, "edit_menu_id_pressed")