summaryrefslogtreecommitdiff
path: root/mutter-plugin
diff options
authorNeil Jagdish Patel <neil.patel@canonical.com>2010-01-08 11:48:15 +0000
committerNeil Jagdish Patel <neil.patel@canonical.com>2010-01-08 11:48:15 +0000
commit5985ad7bd592dc904b767e2dfc3d3cf3b9bd0472 (patch)
treee7058e4407208c369f43efec9c169307db3911a5 /mutter-plugin
parentec804c44fc41ae66e79a4c01a800983dbf231063 (diff)
[mutter] clean up code
modified: mutter-plugin/plugin.vala (bzr r44.2.9)
Diffstat (limited to 'mutter-plugin')
-rw-r--r--mutter-plugin/plugin.vala62
1 files changed, 43 insertions, 19 deletions
diff --git a/mutter-plugin/plugin.vala b/mutter-plugin/plugin.vala
index b5d4cac76..f28e2bf25 100644
--- a/mutter-plugin/plugin.vala
+++ b/mutter-plugin/plugin.vala
@@ -48,6 +48,9 @@ namespace Unity
set { _plugin = value; this.real_construct (); }
}
+ private static const int PANEL_HEIGHT = 23;
+ private static const int QUICKLAUNCHER_WIDTH = 54;
+
private Clutter.Stage stage;
private Application app;
private WindowManagement wm;
@@ -83,12 +86,15 @@ namespace Unity
this.quicklauncher = new Quicklauncher.View (this);
this.quicklauncher.opacity = 0;
this.stage.add_actor (this.quicklauncher);
+ this.stage.raise_child (this.quicklauncher,
+ this.plugin.get_window_group());
this.quicklauncher.animate (Clutter.AnimationMode.EASE_IN_SINE, 400,
"opacity", 255);
this.places = new Places.View ();
this.places.opacity = 0;
this.stage.add_actor (this.places);
+ this.stage.raise_child (this.places, this.quicklauncher);
this.places_showing = false;
this.relayout ();
@@ -103,15 +109,26 @@ namespace Unity
this.background.set_size (width, height);
this.background.set_position (0, 0);
- this.quicklauncher.set_size (54, height-24);
- this.quicklauncher.set_position (0, 24);
-
- this.places.set_size (width - 54, height -23);
- this.places.set_position (54, 23);
-
- this.plugin.set_stage_input_area (0, 24, 54, (int)(height - 24));
- //this.plugin.set_stage_input_region (uint region);
- //this.plugin.set_stage_reactive (true);
+ this.quicklauncher.set_size (this.QUICKLAUNCHER_WIDTH,
+ height-this.PANEL_HEIGHT);
+ this.quicklauncher.set_position (0, this.PANEL_HEIGHT);
+ this.quicklauncher.set_clip (0, 0,
+ this.QUICKLAUNCHER_WIDTH,
+ height-this.PANEL_HEIGHT);
+
+ this.places.set_size (width, height);
+ this.places.set_position (0, 0);
+
+ this.plugin.set_stage_input_area (0,
+ this.PANEL_HEIGHT,
+ this.QUICKLAUNCHER_WIDTH,
+ (int)(height - this.PANEL_HEIGHT));
+
+ /* Leaving this here to remind me that we need to use these when
+ * there are fullscreen windows etc
+ * this.plugin.set_stage_input_region (uint region);
+ * this.plugin.set_stage_reactive (true);
+ */
}
/*
@@ -134,25 +151,32 @@ namespace Unity
this.places_showing = false;
this.places.animate (Clutter.AnimationMode.EASE_OUT_SINE, 300,
"opacity", 0);
- this.plugin.get_window_group ().animate (Clutter.AnimationMode.EASE_IN_SINE, 300, "opacity", 255);
+ var win_group = this.plugin.get_window_group ();
+ win_group.animate (Clutter.AnimationMode.EASE_IN_SINE, 300,
+ "opacity", 255);
+
this.plugin.set_stage_input_area (0,
- 24,
- 54,
- (int)(this.stage.height - 24));
+ this.PANEL_HEIGHT,
+ this.QUICKLAUNCHER_WIDTH,
+ (int)(this.stage.height
+ - this.PANEL_HEIGHT));
}
else
{
this.places_showing = true;
- this.places.animate (Clutter.AnimationMode.EASE_OUT_SINE, 300,
+ this.places.animate (Clutter.AnimationMode.EASE_IN_SINE, 300,
"opacity", 255);
- this.plugin.get_window_group ().animate (Clutter.AnimationMode.EASE_IN_SINE, 300, "opacity", 0);
+
+ var win_group = this.plugin.get_window_group ();
+ win_group.animate (Clutter.AnimationMode.EASE_OUT_SINE, 300,
+ "opacity", 0);
+
this.plugin.set_stage_input_area (0,
- 24,
+ this.PANEL_HEIGHT,
(int)this.stage.width,
- (int)this.stage.height-24);
+ (int)this.stage.height
+ - this.PANEL_HEIGHT);
}
- this.places.queue_relayout ();
-
debug ("Places showing: %s", this.places_showing ? "true":"false");
}