[gnome-maps] favoritePopover: Account for separators in height



commit d350c6a02eb6bcba8b40364c9ed2226c64f64b8e
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Tue Apr 21 09:55:44 2015 +0200

    favoritePopover: Account for separators in height
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748104

 src/favoritesPopover.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/favoritesPopover.js b/src/favoritesPopover.js
index 7ab7432..b6d5650 100644
--- a/src/favoritesPopover.js
+++ b/src/favoritesPopover.js
@@ -27,7 +27,6 @@ const PlaceListRow = imports.placeListRow;
 const PlaceStore = imports.placeStore;
 
 const _N_VISIBLE = 6;
-const _ROW_HEIGHT = 50;
 
 const FavoritesPopover = new Lang.Class({
     Name: 'FavoritesPopover',
@@ -73,9 +72,10 @@ const FavoritesPopover = new Lang.Class({
 
         this.connect('notify::rows', (function() {
             let visible = Math.min(this._rows, _N_VISIBLE);
+            let separators = visible - 1; // separators are 1px
+            let height = (PlaceListRow.ROW_HEIGHT + 6) * visible + separators;
 
-            // + 6 Makes it pixel perfect
-            this._scrolledWindow.min_content_height = visible * (PlaceListRow.ROW_HEIGHT + 6);
+            this._scrolledWindow.min_content_height = height;
             this._revealer.reveal_child = this._rows > _N_VISIBLE;
         }).bind(this));
 


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