[gnome-maps/wip/mlundblad/search-as-you-type: 15/19] placePopover: Remove hint revealer



commit ac2ae975fcf248efba335589d83bad490170a047
Author: Marcus Lundblad <ml update uu se>
Date:   Wed May 22 22:23:41 2019 +0200

    placePopover: Remove hint revealer
    
    The "Press enter to search" hint will
    no longer be needed with
    search-as-you-type.

 data/ui/place-popover.ui | 18 ------------------
 src/placePopover.js      | 27 +--------------------------
 2 files changed, 1 insertion(+), 44 deletions(-)
---
diff --git a/data/ui/place-popover.ui b/data/ui/place-popover.ui
index afb29d5..ae663a1 100644
--- a/data/ui/place-popover.ui
+++ b/data/ui/place-popover.ui
@@ -13,24 +13,6 @@
         <property name="visible">True</property>
         <property name="can_focus">True</property>
         <property name="orientation">vertical</property>
-        <child>
-          <object class="GtkRevealer" id="hintRevealer">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <child>
-              <object class="GtkLabel" id="hintLabel">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Press enter to search</property>
-                <property name="margin_bottom">10</property>
-                <property name="margin_top">5</property>
-                <style>
-                  <class name="dim-label"/>
-                </style>
-              </object>
-            </child>
-          </object>
-        </child>
         <child>
           <object class="GtkStack" id="stack">
             <property name="visible">True</property>
diff --git a/src/placePopover.js b/src/placePopover.js
index 8dc40fd..108137a 100644
--- a/src/placePopover.js
+++ b/src/placePopover.js
@@ -39,8 +39,7 @@ var PlacePopover = GObject.registerClass({
         'selected' : { param_types: [ GObject.TYPE_OBJECT ] }
     },
     Template: 'resource:///org/gnome/Maps/ui/place-popover.ui',
-    InternalChildren: [ 'hintRevealer',
-                        'scrolledWindow',
+    InternalChildren: [ 'scrolledWindow',
                         'stack',
                         'spinner',
                         'list',
@@ -72,11 +71,6 @@ var PlacePopover = GObject.registerClass({
         // Make sure we clear all selected rows when the search string change
         this._entry.connect('changed', () => this._list.unselect_all());
 
-        // Do not show 'press enter to search' when we have
-        // selected rows in completion mode.
-        this._list.connect('selected-rows-changed',
-                           this._updateHint.bind(this));
-
         this._list.set_header_func((row, before) => {
             let header = new Gtk.Separator();
             if (before)
@@ -96,7 +90,6 @@ var PlacePopover = GObject.registerClass({
     showSpinner() {
         this._spinner.start();
         this._stack.visible_child = this._spinner;
-        this._updateHint();
 
         if (!this.visible)
             this.show();
@@ -135,17 +128,11 @@ var PlacePopover = GObject.registerClass({
 
         this._mode = Mode.COMPLETION;
         this._stack.visible_child = this._scrolledWindow;
-        this._updateHint();
 
         if (!this.visible)
             this.show();
     }
 
-    vfunc_hide() {
-        this._hintRevealer.reveal_child = false;
-        super.vfunc_hide();
-    }
-
     updateResult(places, searchString) {
         this._list.forall((row) => row.destroy());
 
@@ -175,16 +162,4 @@ var PlacePopover = GObject.registerClass({
                                                   can_focus: true });
         this._list.add(row);
     }
-
-    _updateHint() {
-        if (this._stack.visible_child === this._spinner) {
-            this._hintRevealer.reveal_child = false;
-            return;
-        }
-
-        if (this._list.get_selected_rows().length > 0)
-            this._hintRevealer.reveal_child = false;
-        else
-            this._hintRevealer.reveal_child = true;
-    }
 });


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