From a3be127cf840c96240c0229ef375e720bf4a0740 Mon Sep 17 00:00:00 2001 From: James Westman Date: Thu, 12 Mar 2020 12:52:10 -0500 Subject: [PATCH] favoritesPopover: Minor style improvements - Clean up margins/spacing: The margin in the popover is 6px and the spacing between the entry and listbox is also 6px - Remove the revealer around the search entry, and change the entry's visibility directly. You can't modify your favorites list from inside the popover anyway, so the reveal animation was never visible. - Fix the height calculation for the listbox Fixes #136. --- data/ui/favorites-popover.ui | 13 ++++--------- src/favoritesPopover.js | 5 ++--- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/data/ui/favorites-popover.ui b/data/ui/favorites-popover.ui index 352084a4..7ee1bbb6 100644 --- a/data/ui/favorites-popover.ui +++ b/data/ui/favorites-popover.ui @@ -14,17 +14,12 @@ True False vertical + 6 + 6 - + True - False - - - True - True - 10 - - + True diff --git a/src/favoritesPopover.js b/src/favoritesPopover.js index 3a0454ff..8386eaa0 100644 --- a/src/favoritesPopover.js +++ b/src/favoritesPopover.js @@ -30,7 +30,6 @@ const _N_VISIBLE = 6; var FavoritesPopover = GObject.registerClass({ Template: 'resource:///org/gnome/Maps/ui/favorites-popover.ui', InternalChildren: [ 'mainGrid', - 'revealer', 'entry', 'scrolledWindow', 'list' ], @@ -71,10 +70,10 @@ var FavoritesPopover = GObject.registerClass({ this.connect('notify::rows', () => { let visible = Math.min(this._rows, _N_VISIBLE); let separators = visible - 1; // separators are 1px - let height = (PlaceListRow.ROW_HEIGHT + 6) * visible + separators; + let height = PlaceListRow.ROW_HEIGHT * visible + separators; this._scrolledWindow.min_content_height = height; - this._revealer.reveal_child = this._rows > _N_VISIBLE; + this._entry.visible = this._rows > _N_VISIBLE; }); this._entry.connect('changed', -- GitLab