[gnome-boxes/wip/csd: 3/4] topbar, app: Switch to client-side decoration



commit 6b851bce083edd87b47b715a723ac090c3ecb8d2
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Aug 29 17:53:49 2013 +0300

    topbar,app: Switch to client-side decoration
    
    In preparation for the wayland tech demo in 3.10, all other GNOME 3 apps
    are switching to client-side window decoration so we should too.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706414

 src/app.vala    |    7 +------
 src/topbar.vala |   17 +++++++++++++----
 2 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index 567f6e9..b9263d1 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -478,7 +478,6 @@ private class Boxes.App: Boxes.UI {
 
         window = new Gtk.ApplicationWindow (application);
         window.show_menubar = false;
-        window.hide_titlebar_when_maximized = true;
 
         // restore window geometry/position
         var size = settings.get_value ("window-size");
@@ -584,11 +583,7 @@ private class Boxes.App: Boxes.UI {
 
         stage.add_child (vbox_actor);
 
-        var topbar_revealer = new Boxes.Revealer (true);
-        topbar_revealer.name = "topbar-revealer";
-        topbar_revealer.x_expand = true;
-        vbox_actor.add_child (topbar_revealer);
-        topbar_revealer.add (topbar.actor);
+        window.set_titlebar (topbar.widget);
 
         searchbar_revealer = new Boxes.Revealer (true);
         searchbar_revealer.resize = true;
diff --git a/src/topbar.vala b/src/topbar.vala
index a1d7475..f8967a2 100644
--- a/src/topbar.vala
+++ b/src/topbar.vala
@@ -10,9 +10,20 @@ public enum Boxes.TopbarPage {
 }
 
 private class Boxes.Topbar: Boxes.UI {
-    public override Clutter.Actor actor { get { return gtk_actor; } }
+    // FIXME: This is really redundant now that App is using widget property
+    // instead but parent Boxes.UI currently requires an actor. Hopefully
+    // soon we can move more towards new Gtk classes and Boxes.UI requires
+    // a widget property instead.
+    public override Clutter.Actor actor {
+        get {
+            var gtk_actor = new GtkClutter.Actor.with_contents (notebook);
+            gtk_actor.name = "topbar";
+
+            return actor;
+        }
+    }
 
-    private GtkClutter.Actor gtk_actor; // the topbar box
+    public Gtk.Widget widget { get { return notebook; } }
     public Notebook notebook;
 
     private Gtk.Spinner spinner;
@@ -42,8 +53,6 @@ private class Boxes.Topbar: Boxes.UI {
 
     private void setup_topbar () {
         notebook = new Gtk.Notebook ();
-        gtk_actor = new GtkClutter.Actor.with_contents (notebook);
-        gtk_actor.name = "topbar";
 
         /* TopbarPage.COLLECTION */
         var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);


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