From cbde386126f77276b54c60397693facf20f63c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sabri=20=C3=9Cnal?= Date: Sat, 17 Dec 2022 17:07:22 +0000 Subject: [PATCH] help-overlay: Improve some shortcuts and help-overlay --- data/gtk/help_overlay.ui | 110 ++++++++++++++++++++++++--------------- src/application.rs | 9 ++-- 2 files changed, 74 insertions(+), 45 deletions(-) diff --git a/data/gtk/help_overlay.ui b/data/gtk/help_overlay.ui index 2fb35bc..a457927 100644 --- a/data/gtk/help_overlay.ui +++ b/data/gtk/help_overlay.ui @@ -5,6 +5,7 @@ shortcuts + 12 General Shortcuts @@ -20,6 +21,12 @@ win.toggle-properties + + + Set as Background + win.set-background + + Toggle Fullscreen @@ -67,48 +74,56 @@ Navigate Images - - - - Next Image - gesture-two-finger-swipe-right - - - - - Previous Image - gesture-two-finger-swipe-left - - + GTK_TEXT_DIR_LTR Next Image Right + GTK_TEXT_DIR_LTR Previous Image Left + + + GTK_TEXT_DIR_RTL + Next Image + Left + + + + + GTK_TEXT_DIR_RTL + Previous Image + Right + + + + + + + Rotate Image + + + Rotate Clockwise + <Ctrl>R + + + + + Rotate Counterclockwise + <Ctrl><Shift>R + + Zoom Image - - - Zoom In - gesture-stretch - - - - - Zoom Out - gesture-pinch - - Zoom In @@ -124,26 +139,51 @@ Best Fit - win.zoom-best-fit + <Ctrl>0 0 Original Scale - 1 + <Ctrl>1 1 200% Scale - 2 + <Ctrl>2 2 - Rotate Image + Gestures + + + + Next Image + gesture-two-finger-swipe-right + + + + + Previous Image + gesture-two-finger-swipe-left + + + + + Zoom In + gesture-stretch + + + + + Zoom Out + gesture-pinch + + Rotate Clockwise @@ -156,18 +196,6 @@ gesture-rotate-counterclockwise - - - Rotate Clockwise - <Ctrl>R - - - - - Rotate Counterclockwise - <Ctrl><Shift>R - - diff --git a/src/application.rs b/src/application.rs index ec5b56b..cf44246 100644 --- a/src/application.rs +++ b/src/application.rs @@ -168,15 +168,16 @@ impl LpApplication { self.set_accels_for_action("win.copy", &["C"]); self.set_accels_for_action("win.show-help-overlay", &["question"]); self.set_accels_for_action("win.leave-fullscreen", &["Escape"]); - self.set_accels_for_action("win.toggle-properties", &["F9"]); + self.set_accels_for_action("win.toggle-properties", &["F9", "Return"]); self.set_accels_for_action("win.toggle-fullscreen", &["F11"]); + self.set_accels_for_action("win.set-background", &["F8"]); self.set_accels_for_action("win.previous", &["Left"]); self.set_accels_for_action("win.next", &["Right"]); - self.set_accels_for_action("win.zoom-to(1.0)", &["1"]); - self.set_accels_for_action("win.zoom-to(2.0)", &["2"]); - self.set_accels_for_action("win.zoom-best-fit", &["0", "0"]); + self.set_accels_for_action("win.zoom-to(1.0)", &["1", "KP_1", "1", "KP_1"]); + self.set_accels_for_action("win.zoom-to(2.0)", &["2", "KP_2", "2", "KP_2"]); + self.set_accels_for_action("win.zoom-best-fit", &["0", "KP_0", "0", "KP_0"]); self.set_accels_for_action( "win.zoom-in", &[