[gnome-shell] overviewControls: Add an accessor for the visible-width property



commit fc53a25a4ce6ea000203e155ec466ef4050b16ce
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sat Apr 20 12:29:58 2013 -0400

    overviewControls: Add an accessor for the visible-width property
    
    To add a geometry that's independent of the slide factor of the workspace,
    we need to get this from outside the sliding control.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694469

 js/ui/overviewControls.js | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index b3eb5d3..ba1cf27 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -271,6 +271,11 @@ const ThumbnailsSlider = new Lang.Class({
         return alwaysZoomOut;
     },
 
+    getNonExpandedWidth: function() {
+        let child = this.actor.get_first_child();
+        return child.get_theme_node().get_length('visible-width');
+    },
+
     getSlide: function() {
         if (!this.visible)
             return 0;
@@ -282,18 +287,16 @@ const ThumbnailsSlider = new Lang.Class({
         let child = this.actor.get_first_child();
         let preferredHeight = child.get_preferred_height(-1)[1];
         let expandedWidth = child.get_preferred_width(preferredHeight)[1];
-        let visibleWidth = child.get_theme_node().get_length('visible-width');
 
-        return visibleWidth / expandedWidth;
+        return this.getNonExpandedWidth() / expandedWidth;
     },
 
     getVisibleWidth: function() {
         let alwaysZoomOut = this._getAlwaysZoomOut();
         if (alwaysZoomOut)
             return this.parent();
-
-        let child = this.actor.get_first_child();
-        return child.get_theme_node().get_length('visible-width');
+        else
+            return this.getNonExpandedWidth();
     }
 });
 


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