[pitivi/1.0] mainwindow: Move the Save and Render buttons on the right side
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/1.0] mainwindow: Move the Save and Render buttons on the right side
- Date: Thu, 30 Nov 2017 08:50:37 +0000 (UTC)
commit 0d7987e5c079cdfd2ea686a211de32dc2179fb28
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Wed Oct 25 23:57:36 2017 +0200
mainwindow: Move the Save and Render buttons on the right side
The hamburger menu has a few export options, so this would group them
together. On the right side they are closer to the preview window, which
seems useful.
Removed the Save button icon because the word "Save" is well known, the
icon not so much, and only adds complexity.
Made the icons small.
Made the Undo/Redo buttons linked, redo button icon-only, to save some
space.
Fixes T7829
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D1868
data/pixmaps/pitivi-render-16.png | Bin 912 -> 0 bytes
data/pixmaps/pitivi-render-22.png | Bin 1289 -> 0 bytes
data/pixmaps/pitivi-render-24.png | Bin 1289 -> 0 bytes
pitivi/mainwindow.py | 62 ++++++++++++++++---------------------
pitivi/render.py | 8 +---
5 files changed, 29 insertions(+), 41 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 2ffe723..dc4d01a 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -219,23 +219,6 @@ class MainWindow(Gtk.ApplicationWindow, Loggable):
# Main "toolbar" (using client-side window decorations with HeaderBar)
self._headerbar = Gtk.HeaderBar()
self._create_headerbar_buttons()
- self.builder.add_from_file(
- os.path.join(get_ui_dir(), "mainmenubutton.ui"))
-
- # FIXME : see https://bugzilla.gnome.org/show_bug.cgi?id=729263
- self.builder.connect_signals_full(self._builderConnectCb, self)
-
- self._menubutton = self.builder.get_object("menubutton")
-
- if Gtk.get_major_version() == 3 and Gtk.get_minor_version() < 13:
- open_menu_image = self.builder.get_object("open_menu_image")
- open_menu_image.set_property("icon_name", "emblem-system-symbolic")
-
- self._menubutton_items = {}
- for widget in self.builder.get_object("menu").get_children():
- self._menubutton_items[Gtk.Buildable.get_name(widget)] = widget
-
- self._headerbar.pack_end(self._menubutton)
self._headerbar.set_show_close_button(True)
self._headerbar.show_all()
self.set_titlebar(self._headerbar)
@@ -393,32 +376,25 @@ class MainWindow(Gtk.ApplicationWindow, Loggable):
layers_representation.grab_focus()
def _create_headerbar_buttons(self):
+
undo_button = Gtk.Button.new_from_icon_name(
- "edit-undo-symbolic", Gtk.IconSize.LARGE_TOOLBAR)
+ "edit-undo-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
undo_button.set_always_show_image(True)
undo_button.set_label(_("Undo"))
undo_button.set_action_name("app.undo")
undo_button.set_use_underline(True)
redo_button = Gtk.Button.new_from_icon_name(
- "edit-redo-symbolic", Gtk.IconSize.LARGE_TOOLBAR)
+ "edit-redo-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
redo_button.set_always_show_image(True)
- redo_button.set_label(_("Redo"))
redo_button.set_action_name("app.redo")
redo_button.set_use_underline(True)
- separator = Gtk.Separator()
-
- self.save_button = Gtk.Button.new_from_icon_name(
- "document-save", Gtk.IconSize.LARGE_TOOLBAR)
- self.save_button.set_always_show_image(True)
- self.save_button.set_label(_("Save"))
+ self.save_button = Gtk.Button.new_with_label(_("Save"))
self.save_button.set_focus_on_click(False)
- render_icon = Gtk.Image.new_from_file(
- os.path.join(get_pixmap_dir(), "pitivi-render-24.png"))
- self.render_button = Gtk.Button()
- self.render_button.set_image(render_icon)
+ self.render_button = Gtk.Button.new_from_icon_name(
+ "system-run-symbolic", Gtk.IconSize.SMALL_TOOLBAR)
self.render_button.set_always_show_image(True)
self.render_button.set_label(_("Render"))
self.render_button.set_tooltip_text(
@@ -426,11 +402,27 @@ class MainWindow(Gtk.ApplicationWindow, Loggable):
self.render_button.set_sensitive(False) # The only one we have to set.
self.render_button.connect("clicked", self._renderCb)
- self._headerbar.pack_start(undo_button)
- self._headerbar.pack_start(redo_button)
- self._headerbar.pack_start(separator)
- self._headerbar.pack_start(self.save_button)
- self._headerbar.pack_start(self.render_button)
+ undo_redo_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0)
+ undo_redo_box.get_style_context().add_class("linked")
+ undo_redo_box.pack_start(undo_button, expand=False, fill=False, padding=0)
+ undo_redo_box.pack_start(redo_button, expand=False, fill=False, padding=0)
+ self._headerbar.pack_start(undo_redo_box)
+
+ self.builder.add_from_file(
+ os.path.join(get_ui_dir(), "mainmenubutton.ui"))
+
+ # FIXME : see https://bugzilla.gnome.org/show_bug.cgi?id=729263
+ self.builder.connect_signals_full(self._builderConnectCb, self)
+
+ self._menubutton = self.builder.get_object("menubutton")
+
+ self._menubutton_items = {}
+ for widget in self.builder.get_object("menu").get_children():
+ self._menubutton_items[Gtk.Buildable.get_name(widget)] = widget
+
+ self._headerbar.pack_end(self._menubutton)
+ self._headerbar.pack_end(self.save_button)
+ self._headerbar.pack_end(self.render_button)
def _set_keyboard_shortcuts(self):
self.app.shortcuts.register_group("win", _("Project"), position=20)
diff --git a/pitivi/render.py b/pitivi/render.py
index b97879d..4a56f55 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -320,10 +320,7 @@ class RenderingProgressDialog(GObject.Object):
# Parent the dialog with mainwindow, since renderingdialog is hidden.
# It allows this dialog to properly minimize together with mainwindow
self.window.set_transient_for(self.app.gui)
-
- # UI widgets
- self.window.set_icon_from_file(
- configure.get_pixmap_dir() + "/pitivi-render-16.png")
+ self.window.set_icon_name("system-run-symbolic")
# We will only show the close/play buttons when the render is done:
self.play_rendered_file_button.hide()
@@ -601,8 +598,7 @@ class RenderDialog(Loggable):
self.render_presets.setupUi(self.presets_combo, self.preset_menubutton)
self.render_presets.loadAll()
- icon = os.path.join(configure.get_pixmap_dir(), "pitivi-render-16.png")
- self.window.set_icon_from_file(icon)
+ self.window.set_icon_name("system-run-symbolic")
self.window.set_transient_for(self.app.gui)
def _settings_changed_cb(self, unused_project, key, value):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]