[gnome-boxes] Topbar take the whole width in the design



commit e25a2d016595ea216498e754193264b420c483c0
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Fri Oct 21 02:07:38 2011 +0200

    Topbar take the whole width in the design

 src/app.vala     |    4 ----
 src/sidebar.vala |    5 ++++-
 src/topbar.vala  |   17 +++++------------
 3 files changed, 9 insertions(+), 17 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index c606838..53e334e 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -117,10 +117,6 @@ private class Boxes.App: Boxes.UI {
         sidebar = new Sidebar (this);
         view = new CollectionView (this);
 
-        var size_group = new Gtk.SizeGroup (Gtk.SizeGroupMode.HORIZONTAL);
-        size_group.add_widget (topbar.corner);
-        size_group.add_widget (sidebar.notebook);
-
         window.show_all ();
 
         wizard = new Wizard (this);
diff --git a/src/sidebar.vala b/src/sidebar.vala
index 7c1e545..faf12d5 100644
--- a/src/sidebar.vala
+++ b/src/sidebar.vala
@@ -41,12 +41,16 @@ private class Boxes.Sidebar: Boxes.UI {
     public override void ui_state_changed () {
         switch (ui_state) {
         case UIState.COLLECTION:
+            actor_remove (gtk_actor);
+            app.box.pack (gtk_actor, "column", 0, "row", 0, "row-span", 2, "x-expand", false, "y-expand", true);
             notebook.page = SidebarPage.COLLECTION;
             break;
         case UIState.DISPLAY:
             actor_pin (actor);
             break;
         case UIState.WIZARD:
+            actor_remove (gtk_actor);
+            app.box.pack (gtk_actor, "column", 0, "row", 1, "x-expand", false, "y-expand", true);
             notebook.page = SidebarPage.WIZARD;
             break;
         }
@@ -98,7 +102,6 @@ private class Boxes.Sidebar: Boxes.UI {
         notebook.show_tabs = false;
 
         gtk_actor = new GtkClutter.Actor.with_contents (notebook);
-        app.box.pack (gtk_actor, "column", 0, "row", 1, "x-expand", false, "y-expand", true);
 
         var listmodel = new ListStore (5,
                                        typeof (string),
diff --git a/src/topbar.vala b/src/topbar.vala
index 8da6693..e7e8dcf 100644
--- a/src/topbar.vala
+++ b/src/topbar.vala
@@ -9,7 +9,6 @@ public enum Boxes.TopbarPage {
 
 private class Boxes.Topbar: Boxes.UI {
     public override Clutter.Actor actor { get { return gtk_actor; } }
-    public Widget corner;
     public Gtk.Label label;
 
     private App app;
@@ -33,22 +32,12 @@ private class Boxes.Topbar: Boxes.UI {
         notebook = new Gtk.Notebook ();
         notebook.set_size_request (50, (int) height);
         gtk_actor = new GtkClutter.Actor.with_contents (notebook);
-        app.box.pack (gtk_actor,
-                      "column", 0,
-                      "row", 0,
-                      "column-span", 2,
-                      "x-expand", true,
-                      "y-expand", false);
 
         /* TopbarPage.COLLECTION */
         var hbox = new Gtk.HBox (false, 0);
         notebook.append_page (hbox, null);
         hbox.get_style_context ().add_class (Gtk.STYLE_CLASS_SIDEBAR);
 
-        corner = new Gtk.EventBox ();
-        // FIXME.. corner.get_style_context ().add_class (Gtk.STYLE_CLASS_SIDEBAR);
-        hbox.pack_start (corner, false, false, 0);
-
         toolbar_start = new Gtk.Toolbar ();
         toolbar_start.icon_size = Gtk.IconSize.MENU;
         toolbar_start.get_style_context ().add_class (Gtk.STYLE_CLASS_MENUBAR);
@@ -64,7 +53,7 @@ private class Boxes.Topbar: Boxes.UI {
         label = new Gtk.Label (_("New and Recent"));
         label.name = "TopbarLabel";
         label.set_halign (Gtk.Align.START);
-        hbox.pack_start (label, true, true, 0);
+        hbox.pack_start (label, true, true, 20);
 
         toolbar_end = new Gtk.Toolbar ();
         toolbar_end.icon_size = Gtk.IconSize.MENU;
@@ -94,6 +83,8 @@ private class Boxes.Topbar: Boxes.UI {
     public override void ui_state_changed () {
         switch (ui_state) {
         case UIState.COLLECTION:
+            actor_remove (gtk_actor);
+            app.box.pack (gtk_actor, "row", 0, "column", 1, "x-expand", true, "y-expand", false);
             notebook.page = TopbarPage.COLLECTION;
             toolbar_start.hide ();
             toolbar_end.hide ();
@@ -106,6 +97,8 @@ private class Boxes.Topbar: Boxes.UI {
             actor_pin (gtk_actor);
             break;
         case UIState.WIZARD:
+            actor_remove (gtk_actor);
+            app.box.pack (gtk_actor, "row", 0, "column", 0, "column-span", 2, "x-expand", true, "y-expand", false);
             notebook.page = TopbarPage.WIZARD;
             break;
 



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