[gtk/gtk-3-24] widget-factory: Add an Inspector menu item



commit 849b7faac88f99b5ea2c750e912656822bf172ca
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Apr 16 18:06:12 2019 -0400

    widget-factory: Add an Inspector menu item
    
    Just because we can.

 demos/widget-factory/widget-factory.c  | 9 +++++++++
 demos/widget-factory/widget-factory.ui | 4 ++++
 2 files changed, 13 insertions(+)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index e9f0219beb..72b63fcf94 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -246,6 +246,14 @@ activate_quit (GSimpleAction *action,
     }
 }
 
+static void
+activate_inspector (GSimpleAction *action,
+                    GVariant      *parameter,
+                    gpointer       user_data)
+{
+  gtk_window_set_interactive_debugging (TRUE);
+}
+
 static void
 spin_value_changed (GtkAdjustment *adjustment, GtkWidget *label)
 {
@@ -1968,6 +1976,7 @@ main (int argc, char *argv[])
   static GActionEntry app_entries[] = {
     { "about", activate_about, NULL, NULL, NULL },
     { "quit", activate_quit, NULL, NULL, NULL },
+    { "inspector", activate_inspector, NULL, NULL, NULL },
     { "main", NULL, "s", "'steak'", NULL },
     { "wine", NULL, NULL, "false", NULL },
     { "beer", NULL, NULL, "false", NULL },
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index 7a0ce05e39..df5bb617e4 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -17,6 +17,10 @@
       </item>
     </section>
     <section>
+      <item>
+        <attribute name="label" translatable="yes">_Inspector</attribute>
+        <attribute name="action">app.inspector</attribute>
+      </item>
       <item>
         <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
         <attribute name="action">win.show-help-overlay</attribute>


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