Permalink
Browse files

Added gradient

  • Loading branch information...
Diego Rocha
Diego Rocha committed Mar 8, 2012
1 parent 7e6e37c commit d07f7dac63a5449f550e41a9b6780c3ef80f2695
Showing with 24 additions and 0 deletions.
  1. +24 −0 js/ui/expo.js
View
@@ -126,6 +126,10 @@ Expo.prototype = {
// During transitions, we raise this to the top to avoid having the overview
// area be reactive; it causes too many issues such as double clicks on
// Dash elements, or mouseover handlers in the workspaces.
+
+ this._gradient = new St.Button({reactive: false});
+ this._gradient.set_style("background-gradient-end: rgba(255, 255, 255, 0.6);background-gradient-start: rgba(255, 255, 255,0);background-gradient-direction: vertical;");
+ this._group.add_actor(this._gradient);
this._coverPane = new Clutter.Rectangle({ opacity: 0,
reactive: true });
this._group.add_actor(this._coverPane);
@@ -149,6 +153,7 @@ Expo.prototype = {
this._group.hide();
global.overlay_group.add_actor(this._group);
+ this._gradient.hide();
this._coverPane.hide();
this._addWorkspaceButton.hide();
@@ -208,6 +213,9 @@ Expo.prototype = {
this._group.set_position(primary.x, primary.y);
this._group.set_size(primary.width, primary.height);
+ this._gradient.set_position(0, primary.height / 2);
+ this._gradient.set_size(primary.width, primary.height / 2);
+
this._coverPane.set_position(0, 0);
this._coverPane.set_size(primary.width, contentHeight);
@@ -284,15 +292,27 @@ Expo.prototype = {
this._background.show();
this._addWorkspaceButton.show();
this._expo.show();
+
this.activeWorkspace = this._expo._thumbnailsBox._lastActiveWorkspace;
let activeWorkspaceActor = this.activeWorkspace.actor;
this._expo._thumbnailsBox._lastActiveWorkspace._fadeOutUninterestingWindows();
+
this.allocateID = this.activeWorkspace.connect('allocated', Lang.bind(this, this._animateVisible2));
+
this.clone = new Clutter.Clone({source: activeWorkspaceActor});
if (global.settings.get_string("desktop-layout") != 'traditional' && !global.settings.get_boolean("panel-autohide"))
this.clone.set_position(0, Main.panel.actor.height);
+
this.clone.show();
this._group.add_actor(this.clone);
+
+ this._gradient.set_position(0, Main.layoutManager.primaryMonitor.height);
+ this._gradient.opacity = 255;
+ this._gradient.show();
+ Tweener.addTween(this._gradient, { y: Main.layoutManager.primaryMonitor.height / 2,
+ time: 1,
+ delay: ANIMATION_TIME,
+ transition: 'easeOutQuint'});
if (Main.panel)
Tweener.addTween(Main.panel.actor, { opacity: 0,
@@ -453,6 +473,10 @@ Expo.prototype = {
Tweener.addTween(Main.panel2.actor, {opacity: 255, time: ANIMATION_TIME, transition: 'easeOutQuad'});
}
+ Tweener.addTween(this._gradient, { opacity: 0,
+ time: ANIMATION_TIME,
+ onComplete: this.hide});
+
Tweener.addTween(this._background,
{ dim_factor: 1,
time: ANIMATION_TIME,

0 comments on commit d07f7da

Please sign in to comment.