[gnome-boxes] foo



commit 6100cd47a423b6b365f224efb64bbcc210b3e5f6
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Fri Oct 7 21:44:58 2011 +0200

    foo

 src/app.vala           |   18 +++++++++++-------
 src/spice-display.vala |    3 ++-
 src/util.vala          |    1 +
 3 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index a234b89..78ef84f 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -25,6 +25,7 @@ private class Boxes.App: Boxes.UI {
     public Clutter.Stage stage;
     public Clutter.State state;
     public Clutter.Box box; // the whole app box
+    public Clutter.Box display_box; // the display box above
     public CollectionItem current_item; // current object/vm manipulated
     public GVir.Connection connection;
     public static const uint duration = 555;  // default to 1/2 for all transitions
@@ -79,9 +80,9 @@ private class Boxes.App: Boxes.UI {
         window.add (embed);
         stage = embed.get_stage () as Clutter.Stage;
 
-        var actor = new GtkClutter.Actor (); // just to have background
-        actor.add_constraint (new Clutter.BindConstraint ((Clutter.Actor) stage, BindCoordinate.SIZE, 0));
-        stage.add_actor (actor);
+        var background = new GtkClutter.Actor (); // just to have background
+        background.add_constraint (new Clutter.BindConstraint (stage, BindCoordinate.SIZE, 0));
+        stage.add_actor (background);
 
         state = new Clutter.State ();
         state.set_duration (null, null, duration);
@@ -91,8 +92,8 @@ private class Boxes.App: Boxes.UI {
 
         box_table = new Clutter.TableLayout ();
         box = new Clutter.Box (box_table);
-        box.add_constraint (new Clutter.BindConstraint ((Clutter.Actor) stage, BindCoordinate.SIZE, 0));
-        ((Clutter.Container) stage).add_actor (box);
+        box.add_constraint (new Clutter.BindConstraint (stage, BindCoordinate.SIZE, 0));
+        stage.add_actor (box);
 
         topbar = new Topbar (this);
         sidebar = new Sidebar (this);
@@ -102,6 +103,9 @@ private class Boxes.App: Boxes.UI {
         size_group.add_widget (topbar.corner);
         size_group.add_widget (sidebar.notebook);
 
+        display_box = new Clutter.Box (new Clutter.BinLayout (Clutter.BinAlignment.CENTER, Clutter.BinAlignment.CENTER));
+        stage.add_actor (display_box);
+
         window.show ();
 
         ui_state = UIState.COLLECTION;
@@ -119,17 +123,17 @@ private class Boxes.App: Boxes.UI {
             o.ui_state = ui_state;
         }
 
-        box.set_layout_manager (box_table);
-
         switch (ui_state) {
         case UIState.DISPLAY:
             box.set_layout_manager (new Clutter.FixedLayout ());
             state.set_state ("display");
             break;
         case UIState.CREDS:
+            box.set_layout_manager (box_table);
             state.set_state ("creds");
             break;
         case UIState.COLLECTION:
+            box.set_layout_manager (box_table);
             state.set_state ("collection");
             break;
         default:
diff --git a/src/spice-display.vala b/src/spice-display.vala
index 88787a2..a4dd1c2 100644
--- a/src/spice-display.vala
+++ b/src/spice-display.vala
@@ -12,10 +12,11 @@ private class Boxes.SpiceDisplay: Boxes.Display {
     }
 
     public override Gtk.Widget get_display (int n) throws Boxes.Error {
-        var display = displays.lookup (n);
+        var display = displays.lookup (n) as Spice.Display;
 
         if (display == null) {
             display = new Spice.Display (session, n);
+            display.scaling = true;
         }
 
         if (display == null) {
diff --git a/src/util.vala b/src/util.vala
index 2744d5e..139cca7 100644
--- a/src/util.vala
+++ b/src/util.vala
@@ -5,6 +5,7 @@ using Xml;
 
 namespace Boxes {
     // FIXME: Remove these when we can use Vala release that provides binding for gdkkeysyms.h
+    private const uint F10_KEY = 0xffc7;
     private const uint F11_KEY = 0xffc8;
     private const uint F12_KEY = 0xffc9;
 



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