From aa9db8ef8ed9b27b0a9648715f4609c96a9baab9 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Fri, 16 Apr 2010 18:26:26 +0300 Subject: [PATCH] Add zoom in/out actions, reduce vertical row padding Add two actions to shrink and enlarge the text in the log pane. Add a theme overide to set expander size to 1 (see bug #615985) and also turn focus lines off. Remove extra ypadding on cells. --- debug-viewer/GstDebugViewer/GUI/app.py | 13 +++++++++++++ debug-viewer/GstDebugViewer/GUI/columns.py | 1 + debug-viewer/GstDebugViewer/GUI/window.py | 20 ++++++++++++++++++-- debug-viewer/data/menus.ui | 6 ++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/debug-viewer/GstDebugViewer/GUI/app.py b/debug-viewer/GstDebugViewer/GUI/app.py index bd53a359a5..de17305294 100644 --- a/debug-viewer/GstDebugViewer/GUI/app.py +++ b/debug-viewer/GstDebugViewer/GUI/app.py @@ -80,6 +80,19 @@ class App (object): self.load_plugins () self.windows = [] + + # we override expander size because of: + # https://bugzilla.gnome.org/show_bug.cgi?id=615985 + rcstring = """ + style "no-expander-treeview-style" { + GtkTreeView::expander_size = 1 + #GtkTreeView::vertical-separator = 0 + GtkWidget::focus-line-width = 0 + } + + widget "*.log_view" style "no-expander-treeview-style" + """ + gtk.rc_parse_string (rcstring) self.open_window () diff --git a/debug-viewer/GstDebugViewer/GUI/columns.py b/debug-viewer/GstDebugViewer/GUI/columns.py index 5f9521be1a..62df7f3e57 100644 --- a/debug-viewer/GstDebugViewer/GUI/columns.py +++ b/debug-viewer/GstDebugViewer/GUI/columns.py @@ -72,6 +72,7 @@ class TextColumn (SizedColumn): column.pack_start (cell) cell.props.yalign = 0. + cell.props.ypad = 0 if self.font_family: cell.props.family = self.font_family diff --git a/debug-viewer/GstDebugViewer/GUI/window.py b/debug-viewer/GstDebugViewer/GUI/window.py index c44276eb26..ee3437d565 100644 --- a/debug-viewer/GstDebugViewer/GUI/window.py +++ b/debug-viewer/GstDebugViewer/GUI/window.py @@ -215,7 +215,9 @@ class Window (object): ("close-window", gtk.STOCK_CLOSE, _("Close _Window"), "W"), ("cancel-load", gtk.STOCK_CANCEL, None,), ("clear-line-view", gtk.STOCK_CLEAR, None), - ("show-about", gtk.STOCK_ABOUT, 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")]) self.actions.add_group (group) self.actions.reload_file.props.sensitive = False @@ -295,7 +297,7 @@ 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",): + "hide-filename", "show-about", "enlarge-text", "shrink-text"): name = action_name.replace ("-", "_") action = getattr (self.actions, name) handler = getattr (self, "handle_%s_action_activate" % (name,)) @@ -574,6 +576,20 @@ class Window (object): col_id = LogModelBase.COL_MESSAGE self.clipboard.set_text (self.get_active_line ()[col_id]) + def handle_enlarge_text_action_activate (self, action): + for col in self.column_manager.columns: + cell = col.view_column.get_cell_renderers ()[0] + cell.props.scale *= 1.15 + col.view_column.queue_resize () + self.widgets.log_view_scrolled_window.props.vadjustment.emit ("value-changed") + + def handle_shrink_text_action_activate (self, action): + for col in self.column_manager.columns: + cell = col.view_column.get_cell_renderers ()[0] + cell.props.scale /= 1.15 + col.view_column.queue_resize () + self.widgets.log_view_scrolled_window.props.vadjustment.emit ("value-changed") + def add_model_filter (self, filter): self.progress_dialog = ProgressDialog (self, _("Filtering")) diff --git a/debug-viewer/data/menus.ui b/debug-viewer/data/menus.ui index 4e049cbddc..a88b4df6fa 100644 --- a/debug-viewer/data/menus.ui +++ b/debug-viewer/data/menus.ui @@ -34,6 +34,9 @@ + + + @@ -66,6 +69,9 @@ + + +