[krb5-auth-dialog] main-window: Use menu-model



commit 3f461bf1838b5f82a129dc4efe16714af5e07bdc
Author: Guido Günther <agx sigxcpu org>
Date:   Thu Oct 20 17:00:19 2022 +0200

    main-window: Use menu-model
    
    This gets the styling right and is simpler

 src/resources/ui/ka-main-window.ui | 63 ++++++++++++++------------------------
 1 file changed, 23 insertions(+), 40 deletions(-)
---
diff --git a/src/resources/ui/ka-main-window.ui b/src/resources/ui/ka-main-window.ui
index 5c60ee3..c03a810 100644
--- a/src/resources/ui/ka-main-window.ui
+++ b/src/resources/ui/ka-main-window.ui
@@ -1,45 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk" version="4.0"/>
-  <object class="GtkPopover" id="menu_main">
-    <property name="child">
-      <object class="GtkBox">
-        <property name="margin-start">10</property>
-        <property name="margin-top">10</property>
-        <property name="margin-bottom">10</property>
-        <property name="margin-end">10</property>
-        <property name="orientation">vertical</property>
-        <child>
-          <object class="GtkModelButton">
-            <property name="visible">True</property>
-            <property name="action-name">app.preferences</property>
-            <property name="text" translatable="yes">Prefere_nces</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkModelButton">
-            <property name="visible">True</property>
-            <property name="action-name">app.about</property>
-            <property name="text" translatable="yes">_About</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkModelButton">
-            <property name="visible">True</property>
-            <property name="action-name">app.help</property>
-            <property name="text" translatable="yes">_Help</property>
-          </object>
-        </child>
-        <child>
-          <object class="GtkModelButton">
-            <property name="visible">True</property>
-            <property name="action-name">app.quit</property>
-            <property name="text" translatable="yes">_Quit</property>
-          </object>
-        </child>
-      </object>
-    </property>
-  </object>
+
+  <menu id="menu_main">
+    <section>
+      <item>
+        <attribute name="action">app.preferences</attribute>
+        <attribute name="label" translatable="yes">Prefere_nces</attribute>
+      </item>
+      <item>
+        <attribute name="action">app.about</attribute>
+        <attribute name="label" translatable="yes">_About</attribute>
+      </item>
+      <item>
+        <attribute name="action">app.help</attribute>
+        <attribute name="label" translatable="yes">_Help</attribute>
+      </item>
+      <item>
+        <attribute name="action">app.quit</attribute>
+        <attribute name="label" translatable="yes">_Quit</attribute>
+      </item>
+    </section>
+  </menu>
+
   <object class="GtkAdjustment" id="adjustment1">
     <property name="upper">100</property>
     <property name="step_increment">1</property>
@@ -90,7 +73,7 @@
         <child type="end">
           <object class="GtkMenuButton">
             <property name="receives-default">True</property>
-            <property name="popover">menu_main</property>
+            <property name="menu-model">menu_main</property>
             <child>
               <object class="GtkImage">
                 <property name="icon_name">open-menu-symbolic</property>


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