[gnome-contacts] window: Fix the location of the buttons in the headerbar when is split



commit 4cae8d4267950a02a1f470efd4bbd474b76d19d1
Author: Yosef Or Boczko <yoseforb gmail com>
Date:   Sun Jan 12 02:06:09 2014 +0200

    window: Fix the location of the buttons in the headerbar when is split
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722013

 src/contacts-window.ui   |    1 +
 src/contacts-window.vala |    9 +++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/contacts-window.ui b/src/contacts-window.ui
index e802fed..3ccffa9 100644
--- a/src/contacts-window.ui
+++ b/src/contacts-window.ui
@@ -16,6 +16,7 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="title" translatable="yes">All Contacts</property>
+            <property name="show_close_button">True</property>
             <style>
               <class name="contacts-left-header-bar"/>
               <class name="titlebar"/>
diff --git a/src/contacts-window.vala b/src/contacts-window.vala
index 3f8d633..15e2250 100644
--- a/src/contacts-window.vala
+++ b/src/contacts-window.vala
@@ -64,6 +64,15 @@ public class Contacts.Window : Gtk.ApplicationWindow {
   public Window (Gtk.Application app) {
     Object (application: app);
 
+    string layout_desc;
+    string[] tokens;
+
+    layout_desc = Gtk.Settings.get_default ().gtk_decoration_layout;
+    tokens = layout_desc.split (":", 2);
+    if (tokens != null) {
+      right_toolbar.decoration_layout = ":%s".printf (tokens[1]);
+      left_toolbar.decoration_layout = tokens[0];
+    }
   }
 
   public void activate_selection_mode (bool active) {


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