From 5b07a1fc393e2213a9e253e5fd7c0f75ae95e29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Stadler?= Date: Sat, 5 Nov 2011 23:05:00 +0100 Subject: [PATCH] Add zoom reset action --- debug-viewer/GstDebugViewer/GUI/window.py | 10 ++++++++-- debug-viewer/data/menus.ui | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/debug-viewer/GstDebugViewer/GUI/window.py b/debug-viewer/GstDebugViewer/GUI/window.py index 411c1558bd..832526e271 100644 --- a/debug-viewer/GstDebugViewer/GUI/window.py +++ b/debug-viewer/GstDebugViewer/GUI/window.py @@ -219,7 +219,8 @@ class Window (object): ("clear-line-view", gtk.STOCK_CLEAR, None), ("show-about", gtk.STOCK_ABOUT, None), ("enlarge-text", gtk.STOCK_ZOOM_IN, _("Enlarge Text"), "plus"), - ("shrink-text", gtk.STOCK_ZOOM_OUT, _("Shrink Text"), "minus")]) + ("shrink-text", gtk.STOCK_ZOOM_OUT, _("Shrink Text"), "minus"), + ("reset-text", gtk.STOCK_ZOOM_100, _("Normal Text Size"), "0")]) self.actions.add_group (group) self.actions.reload_file.props.sensitive = False @@ -300,7 +301,8 @@ class Window (object): "hide-before-line", "hide-after-line", "show-hidden-lines", "edit-copy-line", "edit-copy-message", "set-base-time", "hide-log-level", "hide-log-category", "hide-log-object", - "hide-filename", "show-about", "enlarge-text", "shrink-text"): + "hide-filename", "show-about", "enlarge-text", "shrink-text", + "reset-text"): name = action_name.replace ("-", "_") action = getattr (self.actions, name) handler = getattr (self, "handle_%s_action_activate" % (name,)) @@ -587,6 +589,10 @@ class Window (object): self.update_zoom_level (-1) + def handle_reset_text_action_activate (self, action): + + self.update_zoom_level (-self.zoom_level) + def update_zoom_level (self, delta_step): if not delta_step: diff --git a/debug-viewer/data/menus.ui b/debug-viewer/data/menus.ui index 12fd77027c..2e8bb320f5 100644 --- a/debug-viewer/data/menus.ui +++ b/debug-viewer/data/menus.ui @@ -35,8 +35,9 @@ - - + + +