[gnome-maps/wip/cdavis/post-port-cleanups: 14/22] placesPopover: Use libadwaita menu styles




commit 864bafa381466e6ecbc8d2481d65eeee030a0202
Author: Christopher Davis <christopherdavis gnome org>
Date:   Sun Aug 21 13:09:28 2022 -0400

    placesPopover: Use libadwaita menu styles

 data/ui/place-popover.ui | 90 ++++++++++++++++++++++--------------------------
 src/placePopover.js      |  8 -----
 2 files changed, 42 insertions(+), 56 deletions(-)
---
diff --git a/data/ui/place-popover.ui b/data/ui/place-popover.ui
index f4fed434..d0fdcf33 100644
--- a/data/ui/place-popover.ui
+++ b/data/ui/place-popover.ui
@@ -6,60 +6,54 @@
     <property name="hexpand">False</property>
     <property name="height-request">320</property>
     <style>
-      <class name="maps-popover"/>
+      <class name="menu"/>
     </style>
-    <child>
-      <object class="GtkGrid" id="mainGrid">
-        <property name="focusable">1</property>
-        <property name="orientation">vertical</property>
+    <property name="child">
+      <object class="GtkStack" id="stack">
+        <property name="transition-type">crossfade</property>
+        <style>
+          <class name="maps-stack"/>
+        </style>
         <child>
-          <object class="GtkStack" id="stack">
-            <property name="transition-type">crossfade</property>
+          <object class="GtkScrolledWindow" id="scrolledWindow">
+            <property name="hscrollbar_policy">never</property>
+            <property name="child">
+              <object class="GtkListBox" id="list">
+                <property name="hexpand">1</property>
+                <property name="vexpand">1</property>
+              </object>
+            </property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkSpinner" id="spinner">
+            <property name="halign">center</property>
+            <property name="valign">center</property>
+            <property name="width_request">16</property>
+            <property name="height_request">16</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="noResultsLabel">
+            <property name="label" translatable="1">No results found</property>
+            <property name="width_request">16</property>
+            <property name="height_request">16</property>
             <style>
-              <class name="maps-stack"/>
+              <class name="dim-label"/>
+            </style>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="errorLabel">
+            <property name="label" translatable="1">An error has occurred</property>
+            <property name="width_request">16</property>
+            <property name="height_request">16</property>
+            <style>
+              <class name="dim-label"/>
             </style>
-            <child>
-              <object class="GtkScrolledWindow" id="scrolledWindow">
-                <property name="hscrollbar_policy">never</property>
-                <property name="child">
-                  <object class="GtkListBox" id="list">
-                    <property name="hexpand">1</property>
-                    <property name="vexpand">1</property>
-                  </object>
-                </property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkSpinner" id="spinner">
-                <property name="halign">center</property>
-                <property name="valign">center</property>
-                <property name="width_request">16</property>
-                <property name="height_request">16</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkLabel" id="noResultsLabel">
-                <property name="label" translatable="1">No results found</property>
-                <property name="width_request">16</property>
-                <property name="height_request">16</property>
-                <style>
-                  <class name="dim-label"/>
-                </style>
-              </object>
-            </child>
-            <child>
-              <object class="GtkLabel" id="errorLabel">
-                <property name="label" translatable="1">An error has occurred</property>
-                <property name="width_request">16</property>
-                <property name="height_request">16</property>
-                <style>
-                  <class name="dim-label"/>
-                </style>
-              </object>
-            </child>
           </object>
         </child>
       </object>
-    </child>
+    </property>
   </template>
 </interface>
diff --git a/src/placePopover.js b/src/placePopover.js
index c1abce6a..836ad49a 100644
--- a/src/placePopover.js
+++ b/src/placePopover.js
@@ -45,14 +45,6 @@ export class PlacePopover extends SearchPopover {
                 this.emit('selected', row.place);
         });
 
-        this._list.set_header_func((row, before) => {
-            let header = new Gtk.Separator();
-            if (before)
-                row.set_header(header);
-            else
-                row.set_header(null);
-        });
-
         let rowHeight = PlaceListRow.ROW_HEIGHT;
         this._scrolledWindow.min_content_height = numVisible * rowHeight + 6;
 


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