diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-04-27 12:13:06 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-04-27 12:13:35 -0400 |
commit | f1b423e60f88793b6cc739a145bea2b2a93ac80a (patch) | |
tree | 5267aaa4b28565424fc0b6ffee39cdefcbb1f27d | |
parent | 6cd3c73f21a4d61fbf4e4d9b93de2f7f79d8fa54 (diff) | |
download | gtk+-f1b423e60f88793b6cc739a145bea2b2a93ac80a.tar.gz |
Add a popover menu example to gtk3-widget-factory
-rw-r--r-- | demos/widget-factory/widget-factory.c | 7 | ||||
-rw-r--r-- | demos/widget-factory/widget-factory.ui | 84 |
2 files changed, 82 insertions, 9 deletions
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index 937dc63e88..7404e59674 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -286,6 +286,13 @@ main (int argc, char *argv[]) static GActionEntry app_entries[] = { { "about", activate_about, NULL, NULL, NULL }, { "quit", activate_quit, NULL, NULL, NULL }, + + { "main", NULL, "s", "''", NULL }, + { "wine", NULL, NULL, "false", NULL }, + { "beer", NULL, NULL, "false", NULL }, + { "water", NULL, NULL, "false", NULL }, + { "dessert", NULL, "s", "''", NULL } + }; gint status; diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui index abd1ddba7a..cfe5905674 100644 --- a/demos/widget-factory/widget-factory.ui +++ b/demos/widget-factory/widget-factory.ui @@ -24,6 +24,56 @@ </item> </section> </menu> + <menu id="dinner_menu"> + <section> + <item> + <attribute name="label" translatable="yes">Steak</attribute> + <attribute name="action">app.main</attribute> + <attribute name="target">steak</attribute> + </item> + <item> + <attribute name="label" translatable="yes">Pizza</attribute> + <attribute name="action">app.main</attribute> + <attribute name="target">pizza</attribute> + </item> + </section> + <section> + <item> + <attribute name="label" translatable="yes">Wine</attribute> + <attribute name="action">app.wine</attribute> + </item> + <item> + <attribute name="label" translatable="yes">Beer</attribute> + <attribute name="action">app.beer</attribute> + </item> + <item> + <attribute name="label" translatable="yes">Water</attribute> + <attribute name="action">app.water</attribute> + </item> + </section> + <section> + <submenu> + <attribute name="label" translatable="yes">Dessert</attribute> + <section> + <item> + <attribute name="label" translatable="yes">Brownies</attribute> + <attribute name="action">app.dessert</attribute> + <attribute name="target">brownies</attribute> + </item> + <item> + <attribute name="label" translatable="yes">Banana Sundae</attribute> + <attribute name="action">app.dessert</attribute> + <attribute name="target">sundae</attribute> + </item> + <item> + <attribute name="label" translatable="yes">Lemon Bars</attribute> + <attribute name="action">app.dessert</attribute> + <attribute name="target">bars</attribute> + </item> + </section> + </submenu> + </section> + </menu> <object class="GtkAdjustment" id="adjustment1"> <property name="upper">100</property> <property name="value">50</property> @@ -1922,15 +1972,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property> </packing> </child> <child> - <object class="GtkLabel" id="filler1"> - <property name="visible">True</property> - </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">0</property> - </packing> - </child> - <child> <object class="GtkLabel" id="filler2"> <property name="visible">True</property> </object> @@ -2087,6 +2128,31 @@ Suspendisse feugiat quam quis dolor accumsan cursus. </property> <property name="top-attach">3</property> </packing> </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="orientation">horizontal</property> + <child> + <object class="GtkMenuButton"> + <property name="visible">True</property> + <property name="menu-model">dinner_menu</property> + <property name="halign">center</property> + <property name="valign">center</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="icon-name">document-open-recent-symbolic</property> + <property name="icon-size">4</property> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> </object> </child> </object> |