[libadwaita/wip/exalm/demo: 3/3] demo: Add inspector to the primary menu




commit 5d9499bb83c29f800f4c0222497e812345592f38
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Oct 13 15:56:43 2021 +0500

    demo: Add inspector to the primary menu
    
    Make it less empty.

 demo/adw-demo-window.ui | 6 ++++++
 demo/adwaita-demo.c     | 9 +++++++++
 2 files changed, 15 insertions(+)
---
diff --git a/demo/adw-demo-window.ui b/demo/adw-demo-window.ui
index 5303e4ae..95c29126 100644
--- a/demo/adw-demo-window.ui
+++ b/demo/adw-demo-window.ui
@@ -4,6 +4,12 @@
   <requires lib="gtk" version="4.0"/>
   <requires lib="libadwaita" version="1.0"/>
   <menu id="primary_menu">
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Inspector</attribute>
+        <attribute name="action">app.inspector</attribute>
+      </item>
+    </section>
     <section>
       <item>
         <attribute name="label" translatable="yes">_Preferences</attribute>
diff --git a/demo/adwaita-demo.c b/demo/adwaita-demo.c
index dd2ea5dc..46ca421f 100644
--- a/demo/adwaita-demo.c
+++ b/demo/adwaita-demo.c
@@ -5,6 +5,14 @@
 #include "adw-demo-preferences-window.h"
 #include "adw-demo-window.h"
 
+static void
+show_inspector (GSimpleAction *action,
+                GVariant      *state,
+                gpointer       user_data)
+{
+  gtk_window_set_interactive_debugging (TRUE);
+}
+
 static void
 show_preferences (GSimpleAction *action,
                   GVariant      *state,
@@ -83,6 +91,7 @@ main (int    argc,
   AdwApplication *app;
   int status;
   static GActionEntry app_entries[] = {
+    { "inspector", show_inspector, NULL, NULL, NULL },
     { "preferences", show_preferences, NULL, NULL, NULL },
     { "about", show_about, NULL, NULL, NULL },
   };


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