[gnome-shell] dash: add a SlidingControl for the dash actor



commit 2247065dc50b23c7567a6aef19fa2882c73b68dd
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Jan 23 23:11:23 2013 -0500

    dash: add a SlidingControl for the dash actor
    
    Will be needed to hide and show it when searching.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682050

 data/theme/gnome-shell.css |    6 +-----
 js/ui/overview.js          |    4 +++-
 js/ui/overviewControls.js  |   29 +++++++++++++++++++++++++++++
 3 files changed, 33 insertions(+), 6 deletions(-)
---
diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
index e107ab8..eb4340a 100644
--- a/data/theme/gnome-shell.css
+++ b/data/theme/gnome-shell.css
@@ -772,15 +772,11 @@ StScrollBar StButton#vhandle:active {
 }
 
 #searchResultsContent {
+    padding-left: 20px;
     padding-right: 20px;
     spacing: 16px;
 }
 
-#searchResultsContent:rtl {
-    padding-right: 0px;
-    padding-left: 20px;
-}
-
 .search-section {
     /* This should be equal to #searchResultsContent spacing */
     spacing: 16px;
diff --git a/js/ui/overview.js b/js/ui/overview.js
index adff625..399bd19 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -225,13 +225,15 @@ const Overview = new Lang.Class({
 
         // TODO - recalculate everything when desktop size changes
         this._dash = new Dash.Dash();
-        this._group.add_actor(this._dash.actor);
         this.dashIconSize = this._dash.iconSize;
         this._dash.connect('icon-size-changed',
                            Lang.bind(this, function() {
                                this.dashIconSize = this._dash.iconSize;
                            }));
 
+        this._dashSlider = new OverviewControls.DashSlider(this._dash);
+        this._group.add_actor(this._dashSlider.actor);
+
         // Translators: this is the name of the dock/favorites area on
         // the left of the overview
         Main.ctrlAltTabManager.addGroup(this._dash.actor, _("Dash"), 'user-bookmarks-symbolic');
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index 61c3e3f..8413874 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -203,3 +203,32 @@ const ThumbnailsSlider = new Lang.Class({
         return visibleWidth / expandedWidth;
     }
 });
+
+const DashSlider = new Lang.Class({
+    Name: 'DashSlider',
+    Extends: SlidingControl,
+
+    _init: function(dash) {
+        this.parent();
+
+        this.layout.slideDirection = SlideDirection.LEFT;
+
+        this.dash = dash;
+
+        // SlideLayout reads the actor's expand flags to decide
+        // whether to allocate the natural size to its child, or the whole
+        // available allocation
+        dash.actor.x_expand = true;
+        dash.actor.y_expand = true;
+        this.actor.add_actor(this.dash.actor);
+
+        this.dash.connect('icon-size-changed', Lang.bind(this, this.updateSlide));
+    },
+
+    getSlide: function() {
+        if (this.visible || this.inDrag)
+            return 1;
+        else
+            return 0;
+    }
+});


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