Browse code

Bind "W" key to zoom_to_fit.

Arthur A. Gleckler authored on 07/03/2022 23:17:07 • José Fonseca committed on 08/03/2022 08:57:47
Showing 2 changed files

... ...
@@ -110,6 +110,7 @@ You can also pass the following options:
110 110
       Q                         quit
111 111
       P                         print
112 112
       T                         toggle toolbar
113
+      W                         zoom to fit
113 114
       Escape                    halt animation
114 115
       Ctrl-drag                 zoom in/out
115 116
       Shift-drag                zooms an area
... ...
@@ -355,6 +355,9 @@ class DotWidget(Gtk.DrawingArea):
355 355
             toolbar = win.uimanager.get_widget("/ToolBar")
356 356
             toolbar.set_visible(not toolbar.get_visible())
357 357
             return True
358
+        if event.keyval == Gdk.KEY_w:
359
+            self.zoom_to_fit()
360
+            return True
358 361
         return False
359 362
 
360 363
     print_settings = None