From 8d9e1e820768b262035fb0865f7fc59a3bd8c499 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 21 Jul 2020 22:11:25 +0300 Subject: [PATCH] Fullscreen can be toggled on and off from the View menu --- CHANGELOG.md | 1 + Translations/Translations.pot | 3 +++ src/Main.gd | 3 --- src/UI/TopMenuContainer.gd | 12 ++++++++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdee1f535..7356e399f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Darshan Phaldesai (luiq54), Igor Santarek (jegor377), rob-a-bolton, Kinwailo - The "create new image" dialog now remembers the last created canvas size. The default image settings are being used only when Pixelorama first launches. ([#178](https://github.com/Orama-Interactive/Pixelorama/issues/178)) - Language and theme checkboxes are now radio buttons. - The Blue theme has more similar margins and seperations with the rest of the themes. +- Fullscreen can be toggled on and off from the View menu. ### Fixed - Exporting large images and drawing with large image brushes is now a lot faster. (Because of Godot 3.2.2) diff --git a/Translations/Translations.pot b/Translations/Translations.pot index 856a35e2d..7c58adfa8 100644 --- a/Translations/Translations.pot +++ b/Translations/Translations.pot @@ -151,6 +151,9 @@ msgstr "" msgid "Zen Mode" msgstr "" +msgid "Fullscreen Mode" +msgstr "" + msgid "Fill with color:" msgstr "" diff --git a/src/Main.gd b/src/Main.gd index a7109e836..0b36d89df 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -52,9 +52,6 @@ func _input(event : InputEvent) -> void: if get_focus_owner() is LineEdit: get_focus_owner().release_focus() - if event.is_action_pressed("toggle_fullscreen"): - OS.window_fullscreen = !OS.window_fullscreen - if event.is_action_pressed("redo_secondary"): # Shift + Ctrl + Z redone = true Global.current_project.undo_redo.redo() diff --git a/src/UI/TopMenuContainer.gd b/src/UI/TopMenuContainer.gd index 84abf3d49..702c205a9 100644 --- a/src/UI/TopMenuContainer.gd +++ b/src/UI/TopMenuContainer.gd @@ -65,7 +65,8 @@ func setup_view_menu() -> void: "Show Rulers" : InputMap.get_action_list("show_rulers")[0].get_scancode_with_modifiers(), "Show Guides" : InputMap.get_action_list("show_guides")[0].get_scancode_with_modifiers(), "Show Animation Timeline" : 0, - "Zen Mode" : InputMap.get_action_list("zen_mode")[0].get_scancode_with_modifiers() + "Zen Mode" : InputMap.get_action_list("zen_mode")[0].get_scancode_with_modifiers(), + "Fullscreen Mode" : InputMap.get_action_list("toggle_fullscreen")[0].get_scancode_with_modifiers(), } view_menu = Global.view_menu.get_popup() @@ -234,8 +235,10 @@ func view_menu_id_pressed(id : int) -> void: toggle_show_guides() 4: # Show animation timeline toggle_show_anim_timeline() - 5: # Fullscreen mode + 5: # Zen mode toggle_zen_mode() + 6: # Fullscreen mode + toggle_fullscreen() Global.canvas.update() @@ -288,6 +291,11 @@ func toggle_zen_mode() -> void: view_menu.set_item_checked(5, zen_mode) +func toggle_fullscreen() -> void: + OS.window_fullscreen = !OS.window_fullscreen + view_menu.set_item_checked(6, OS.window_fullscreen) + + func image_menu_id_pressed(id : int) -> void: if Global.current_project.layers[Global.current_project.current_layer].locked: # No changes if the layer is locked return