[gnome-maps] favoritesPopover: Minor style improvements



commit a3be127cf840c96240c0229ef375e720bf4a0740
Author: James Westman <james flyingpimonster net>
Date:   Thu Mar 12 12:52:10 2020 -0500

    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 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
+        <property name="row_spacing">6</property>
+        <property name="margin">6</property>
         <child>
-          <object class="GtkRevealer" id="revealer">
+          <object class="GtkEntry" id="entry">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <child>
-              <object class="GtkEntry" id="entry">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="margin">10</property>
-              </object>
-            </child>
+            <property name="can_focus">True</property>
           </object>
         </child>
         <child>
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',


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