[gtk/widget-factory-inspector: 1/2] widget-factory: Add an Inspector menu item
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/widget-factory-inspector: 1/2] widget-factory: Add an Inspector menu item
- Date: Tue, 16 Apr 2019 22:54:54 +0000 (UTC)
commit 226e0eadf0bec58b8da3eeef7e9449b48e9f4064
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 7a32c37610..c6969ea95e 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -262,6 +262,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)
{
@@ -1935,6 +1943,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 aa61c3b0f7..095cbdbc56 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -16,6 +16,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]