[gnome-tweak-tool] Make Title Bar match mockups



commit f8a3ad13c64411f765933fc54cbcb0f74c8102a7
Author: Alex Muñoz <alexmudoz gmail com>
Date:   Sun Aug 18 03:12:21 2013 -0400

    Make Title Bar match mockups

 gtweak/tweaks/tweak_group_shell_extensions.py |    4 +--
 gtweak/tweakview.py                           |   49 +++++++++++++++++--------
 2 files changed, 35 insertions(+), 18 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_group_shell_extensions.py b/gtweak/tweaks/tweak_group_shell_extensions.py
index f995c6f..0b1bcc4 100644
--- a/gtweak/tweaks/tweak_group_shell_extensions.py
+++ b/gtweak/tweaks/tweak_group_shell_extensions.py
@@ -101,7 +101,6 @@ class _ShellExtensionTweak(Gtk.ListBoxRow, Tweak):
     
         self.add(self.hbox)
         self.widget_for_size_group = None
-        self.get_style_context().add_class('tweak-white')
 
     def _on_disable_extension(self, de, sw):
         sw.set_active(False)
@@ -292,8 +291,7 @@ class ShellExtensionTweakGroup(ListBoxTweakGroup):
             
         ListBoxTweakGroup.__init__(self,
                                    _("Extensions"),
-                                   *extension_tweaks,
-                                   css_class='tweak-group-white')
+                                   *extension_tweaks)
         
         self.set_header_func(self._list_header_func, None)
 
diff --git a/gtweak/tweakview.py b/gtweak/tweakview.py
index 633601f..7990b01 100644
--- a/gtweak/tweakview.py
+++ b/gtweak/tweakview.py
@@ -44,9 +44,7 @@ class Window(Gtk.ApplicationWindow):
 
     def __init__(self, app, model):
         Gtk.ApplicationWindow.__init__(self,
-                              title="Tweak Tool",
-                              application=app,
-                              hide_titlebar_when_maximized=True)
+                                       application=app)
         
         self.set_size_request(800, 600)
         self.set_position(Gtk.WindowPosition.CENTER)
@@ -56,6 +54,9 @@ class Window(Gtk.ApplicationWindow):
         right_box = self.main_content()
         separator = Gtk.Separator(orientation=Gtk.Orientation.VERTICAL)
         
+        titlebar = self.titlebar()
+        self.set_titlebar(titlebar)
+
         main_box.pack_start(left_box, False, False, 0)
         main_box.pack_start(separator, False, False, 0)
         main_box.pack_start(right_box, True, True, 0)
@@ -67,19 +68,35 @@ class Window(Gtk.ApplicationWindow):
 
         self.connect("key-press-event", self._on_key_press)
         self.add(main_box)
-        
-    def sidebar(self):
-        left_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
-       
-        left_header = Gtk.HeaderBar()
-        left_header.set_title("Tweaks")
-        
+    
+    def titlebar(self):
+        hbar = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
+
+        self.right_header = Gtk.HeaderBar()
+        self.right_header.props.show_close_button = True
+
         icon = Gtk.Image()
         icon.set_from_icon_name("edit-find-symbolic", Gtk.IconSize.BUTTON)
         self.button = Gtk.ToggleButton()
         self.button.add(icon)
         self.button.connect("toggled", self._on_find_toggled)
-         
+        
+        lbl = Gtk.Label("Tweaks")
+        align = Gtk.Alignment(left_padding = 35, right_padding = 70)
+        align.add(lbl)
+        
+        separator = Gtk.VSeparator()
+        
+        self.right_header.pack_start(self.button)
+        self.right_header.pack_start(align)
+        self.right_header.pack_start(separator)
+        
+        return self.right_header
+        
+        
+    def sidebar(self):
+        left_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
+        
         self.revealer = Gtk.Revealer()
         self.entry = Gtk.SearchEntry(placeholder_text="Search Tweaks...")
         self.entry.props.margin_left = 5
@@ -99,8 +116,8 @@ class Window(Gtk.ApplicationWindow):
                           Gtk.PolicyType.AUTOMATIC)
         scroll.add(self.listbox)
         
-        left_header.pack_start(self.button)
-        left_box.pack_start(left_header, False, False, 0)
+        separator = Gtk.HSeparator()
+        left_box.pack_start(separator, False, False, 0)
         left_box.pack_start(self.revealer, False, False, 0)
         left_box.pack_start(scroll, True, True, 0)
         
@@ -109,12 +126,14 @@ class Window(Gtk.ApplicationWindow):
     def main_content(self):        
         right_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
         
-        self.right_header = Gtk.HeaderBar()
         #GRR why can I not put margin in the CSS of a GtkStack
         self.stack = Gtk.Stack()
         self.stack.get_style_context().add_class("main-container")
         self.stack.props.margin = 20
-        right_box.pack_start(self.right_header, False, False, 0)
+        
+        separator = Gtk.HSeparator()
+        right_box.pack_start(separator, False, False, 0)
+        
         right_box.pack_start(self.stack, True, True, 0)
         
         return right_box


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