[evince/wip/gpoo/gtk4-rebase-port: 95/96] libview: Move zoom mode shortcut to EvView




commit 0f134bfb3ce71a07bc6b39d81d02084eaecc1136
Author: Qiu Wenbo <qiuwenbo kylinos com cn>
Date:   Sun Dec 12 15:03:50 2021 +0800

    libview: Move zoom mode shortcut to EvView
    
    Signed-off-by: Qiu Wenbo <qiuwenbo kylinos com cn>

 libview/ev-view.c      | 19 +++++++++++++++++++
 shell/ev-application.c |  3 ---
 2 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index aab8f9708..82e567824 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -8172,6 +8172,25 @@ ev_view_init (EvView *view)
        g_signal_connect (controller, "prepare",
                           G_CALLBACK (on_drag_prepare), view);
        gtk_widget_add_controller (widget, controller);
+
+       controller = gtk_shortcut_controller_new();
+       gtk_shortcut_controller_add_shortcut (GTK_SHORTCUT_CONTROLLER (controller),
+                       gtk_shortcut_new_with_arguments (
+                               gtk_shortcut_trigger_parse_string ("w"),
+                               gtk_shortcut_action_parse_string("action(win.sizing-mode)"),
+                               "s", "fit-width"));
+       gtk_shortcut_controller_add_shortcut (GTK_SHORTCUT_CONTROLLER (controller),
+                       gtk_shortcut_new_with_arguments (
+                               gtk_shortcut_trigger_parse_string ("f"),
+                               gtk_shortcut_action_parse_string("action(win.sizing-mode)"),
+                               "s", "fit-page"));
+       gtk_shortcut_controller_add_shortcut (GTK_SHORTCUT_CONTROLLER (controller),
+                       gtk_shortcut_new_with_arguments (
+                               gtk_shortcut_trigger_parse_string ("a"),
+                               gtk_shortcut_action_parse_string("action(win.sizing-mode)"),
+                               "s", "automatic"));
+       gtk_widget_add_controller (widget, controller);
+
 }
 
 /*** Callbacks ***/
diff --git a/shell/ev-application.c b/shell/ev-application.c
index bd4d64b07..6343ea56e 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -966,9 +966,6 @@ ev_application_startup (GApplication *gapplication)
           "win.go-previous-page",       "p", "<Ctrl>Page_Up", NULL,
           "win.go-back-history",        "<alt>P", "Back", NULL,
           "win.go-forward-history",     "<alt>N", "Forward", NULL,
-          "win.sizing-mode::fit-page",  "f", NULL,
-          "win.sizing-mode::fit-width", "w", NULL,
-          "win.sizing-mode::automatic", "a", NULL,
           "win.default-zoom",           "<Ctrl>0", "<Ctrl>KP_0", NULL,
           "win.toggle-menu",            "F10", NULL,
           "win.caret-navigation",       "F7", NULL,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]