[gnome-maps/gnome-3-16] favoritePopover: Account for separators in	height
- From: Jonas Danielsson <jonasdn src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-maps/gnome-3-16] favoritePopover: Account for separators in	height
 
- Date: Tue, 21 Apr 2015 07:56:54 +0000 (UTC)
 
commit c2cdab9e8b17a88489cf24c1e646b7bee4036fe1
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Tue Apr 21 09:55:44 2015 +0200
    favoritePopover: Account for separators in height
 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]