From 4f54ffc9878fe2b926b09c9bd873929dba85a72d Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Thu, 4 Jan 2024 16:28:39 +0200 Subject: [PATCH] Rename "Crop Image" to "Crop to Selection" and "Trim Image" to "Crop to Content" Same names as the GNU Image Manipulation Program, much more clear as to what each option does. --- Translations/Translations.pot | 8 +++++--- project.godot | 4 ++-- src/Autoload/DrawingAlgos.gd | 4 ++-- src/Autoload/Global.gd | 8 ++++---- src/Classes/Project.gd | 2 +- src/UI/TopMenuContainer/TopMenuContainer.gd | 14 +++++++------- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Translations/Translations.pot b/Translations/Translations.pot index d2dc4a488..e70ba5a47 100644 --- a/Translations/Translations.pot +++ b/Translations/Translations.pot @@ -140,7 +140,7 @@ msgstr "" msgid "Delete Permanently" msgstr "" -#. When you move something to recycle bin +#. Found when requesting to delete a palette or an extension. Refers to when you move something to recycle bin. msgid "Move to Trash" msgstr "" @@ -156,10 +156,12 @@ msgstr "" msgid "Percentage" msgstr "" -msgid "Crop Image" +#. Found in the image menu. Sets the size of the project to be the same as the size of the active selection. +msgid "Crop to Selection" msgstr "" -msgid "Trim Image" +#. Found in the image menu. Automatically trims out all the transparent pixels, making the image smaller. +msgid "Crop to Content" msgstr "" msgid "Resize Canvas" diff --git a/project.godot b/project.godot index 0183b31f4..b69501bac 100644 --- a/project.godot +++ b/project.godot @@ -639,11 +639,11 @@ scale_image={ "deadzone": 0.5, "events": [] } -crop_image={ +crop_to_selection={ "deadzone": 0.5, "events": [] } -trim_image={ +crop_to_content={ "deadzone": 0.5, "events": [] } diff --git a/src/Autoload/DrawingAlgos.gd b/src/Autoload/DrawingAlgos.gd index 6e7660456..7ceac387a 100644 --- a/src/Autoload/DrawingAlgos.gd +++ b/src/Autoload/DrawingAlgos.gd @@ -518,7 +518,7 @@ func center(indices: Array) -> void: ## Sets the size of the project to be the same as the size of the active selection. -func crop_image() -> void: +func crop_to_selection() -> void: if not Global.current_project.has_selection: return Global.canvas.selection.transform_content_confirm() @@ -537,7 +537,7 @@ func crop_image() -> void: ## Automatically makes the project smaller by looping through all of the cels and ## trimming out the pixels that are transparent in all cels. -func trim_image() -> void: +func crop_to_content() -> void: Global.canvas.selection.transform_content_confirm() var used_rect := Rect2i() for f in Global.current_project.frames: diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index ec5c014e7..fced34451 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -44,8 +44,8 @@ enum ImageMenu { RESIZE_CANVAS, OFFSET_IMAGE, SCALE_IMAGE, - CROP_IMAGE, - TRIM_IMAGE, + CROP_TO_SELECTION, + CROP_TO_CONTENT, FLIP, ROTATE, OUTLINE, @@ -568,8 +568,8 @@ func _initialize_keychain() -> void: "new_brush": Keychain.InputAction.new("", "Edit menu", true), "preferences": Keychain.InputAction.new("", "Edit menu", true), "scale_image": Keychain.InputAction.new("", "Image menu", true), - "crop_image": Keychain.InputAction.new("", "Image menu", true), - "trim_image": Keychain.InputAction.new("", "Image menu", true), + "crop_to_selection": Keychain.InputAction.new("", "Image menu", true), + "crop_to_content": Keychain.InputAction.new("", "Image menu", true), "resize_canvas": Keychain.InputAction.new("", "Image menu", true), "offset_image": Keychain.InputAction.new("", "Image menu", true), "mirror_image": Keychain.InputAction.new("", "Image menu", true), diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index 648939cb1..1c4316a6e 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -178,7 +178,7 @@ func selection_map_changed() -> void: Global.canvas.selection.marching_ants_outline.texture = image_texture Global.top_menu_container.edit_menu.set_item_disabled(Global.EditMenu.NEW_BRUSH, !has_selection) Global.top_menu_container.image_menu.set_item_disabled( - Global.ImageMenu.CROP_IMAGE, !has_selection + Global.ImageMenu.CROP_TO_SELECTION, !has_selection ) diff --git a/src/UI/TopMenuContainer/TopMenuContainer.gd b/src/UI/TopMenuContainer/TopMenuContainer.gd index efb020d34..81ce15e7a 100644 --- a/src/UI/TopMenuContainer/TopMenuContainer.gd +++ b/src/UI/TopMenuContainer/TopMenuContainer.gd @@ -278,8 +278,8 @@ func _setup_image_menu() -> void: "Resize Canvas": "resize_canvas", "Offset Image": "offset_image", "Scale Image": "scale_image", - "Crop Image": "crop_image", - "Trim Image": "trim_image", + "Crop to Selection": "crop_to_selection", + "Crop to Content": "crop_to_content", "Mirror Image": "mirror_image", "Rotate Image": "rotate_image", "Outline": "outline", @@ -296,7 +296,7 @@ func _setup_image_menu() -> void: for item in image_menu_items: _set_menu_shortcut(image_menu_items[item], image_menu, i, item) i += 1 - image_menu.set_item_disabled(Global.ImageMenu.CROP_IMAGE, true) + image_menu.set_item_disabled(Global.ImageMenu.CROP_TO_SELECTION, true) image_menu.id_pressed.connect(image_menu_id_pressed) @@ -682,10 +682,10 @@ func image_menu_id_pressed(id: int) -> void: _popup_dialog(Global.control.get_node("Dialogs/ImageEffects/ScaleImage")) Global.ImageMenu.OFFSET_IMAGE: _popup_dialog(Global.control.get_node("Dialogs/ImageEffects/OffsetImage")) - Global.ImageMenu.CROP_IMAGE: - DrawingAlgos.crop_image() - Global.ImageMenu.TRIM_IMAGE: - DrawingAlgos.trim_image() + Global.ImageMenu.CROP_TO_SELECTION: + DrawingAlgos.crop_to_selection() + Global.ImageMenu.CROP_TO_CONTENT: + DrawingAlgos.crop_to_content() Global.ImageMenu.RESIZE_CANVAS: _popup_dialog(Global.control.get_node("Dialogs/ImageEffects/ResizeCanvas")) Global.ImageMenu.FLIP: