[gnome-boxes] Topbar itself creates/setup its display toolbar



commit 00e5b7b5b7237b952ead9d6bc4eeb14020aed9b5
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Jan 8 14:53:40 2014 +0000

    Topbar itself creates/setup its display toolbar

 data/ui/topbar.ui     |    6 +++---
 src/display-page.vala |    7 +------
 src/topbar.vala       |   10 ++++------
 3 files changed, 8 insertions(+), 15 deletions(-)
---
diff --git a/data/ui/topbar.ui b/data/ui/topbar.ui
index a2bc436..558317a 100644
--- a/data/ui/topbar.ui
+++ b/data/ui/topbar.ui
@@ -325,10 +325,10 @@
 
     <!-- Display -->
     <child>
-      <object class="GtkBox" id="display_hbox">
+      <object class="BoxesDisplayToolbar" id="display_toolbar">
         <property name="visible">True</property>
-        <property name="orientation">horizontal</property>
-        <property name="spacing">0</property>
+        <property name="overlay">False</property>
+        <property name="handle-drag">False</property>
       </object>
     </child>
   </template>
diff --git a/src/display-page.vala b/src/display-page.vala
index 3c117aa..d5693df 100644
--- a/src/display-page.vala
+++ b/src/display-page.vala
@@ -136,14 +136,13 @@ private class Boxes.DisplayToolbar: Gtk.HeaderBar {
 private class Boxes.DisplayPage: GLib.Object {
     public Widget widget { get { return box; } }
 
-    public DisplayToolbar title_toolbar; // Toolbar used when window is not maximized
+    public DisplayToolbar toolbar;
 
     private EventBox event_box;
     private Box box;
     private DisplayToolbar overlay_toolbar;
     private EventBox overlay_toolbar_box;
     private Grid notification_grid;
-    private DisplayToolbar toolbar;
     private uint toolbar_hide_id;
     private uint toolbar_show_id;
     private ulong cursor_id;
@@ -241,12 +240,8 @@ private class Boxes.DisplayPage: GLib.Object {
 
         box.show_all ();
 
-        title_toolbar = new DisplayToolbar (false, false);
-
         toolbar.bind_property ("title", overlay_toolbar, "title", BindingFlags.SYNC_CREATE);
         toolbar.bind_property ("subtitle", overlay_toolbar, "subtitle", BindingFlags.SYNC_CREATE);
-        toolbar.bind_property ("title", title_toolbar, "title", BindingFlags.SYNC_CREATE);
-        toolbar.bind_property ("subtitle", title_toolbar, "subtitle", BindingFlags.SYNC_CREATE);
     }
 
     public void add_notification (Widget w) {
diff --git a/src/topbar.vala b/src/topbar.vala
index 68f6e4a..4213a34 100644
--- a/src/topbar.vala
+++ b/src/topbar.vala
@@ -55,9 +55,7 @@ private class Boxes.Topbar: Gtk.Notebook, Boxes.UI {
     [GtkChild]
     private Gtk.HeaderBar collection_toolbar;
     [GtkChild]
-    private Gtk.Box display_hbox;
-
-    private Gtk.HeaderBar display_toolbar;
+    private DisplayToolbar display_toolbar;
 
     public string? _status;
     public string? status {
@@ -96,9 +94,9 @@ private class Boxes.Topbar: Gtk.Notebook, Boxes.UI {
         App.app.collection.item_removed.connect (update_select_btn);
         update_selection_label ();
 
-        display_toolbar = App.app.display_page.title_toolbar;
-        display_hbox.pack_start (display_toolbar, true, true, 0);
-        display_toolbar.show_all ();
+        var toolbar = App.app.display_page.toolbar;
+        toolbar.bind_property ("title", display_toolbar, "title", BindingFlags.SYNC_CREATE);
+        toolbar.bind_property ("subtitle", display_toolbar, "subtitle", BindingFlags.SYNC_CREATE);
 
         update_search_btn ();
         App.app.collection.item_added.connect (update_search_btn);


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