[gtk/kill-tree-menu: 27/51] widget-factory: Remove the menubar



commit f5ed8f75e2b6fcee6991236188a52bc6e4d6b780
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 27 08:45:47 2019 -0500

    widget-factory: Remove the menubar

 demos/widget-factory/widget-factory.c  |  28 ----
 demos/widget-factory/widget-factory.ui | 254 ---------------------------------
 2 files changed, 282 deletions(-)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index 94ddcfae68..559fb82c87 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -1053,27 +1053,6 @@ row_activated (GtkListBox *box, GtkListBoxRow *row)
     }
 }
 
-static void
-set_accel (GtkApplication *app, GtkWidget *widget)
-{
-  GtkWidget *accel_label;
-  const gchar *action;
-  gchar **accels;
-  guint key;
-  GdkModifierType mods;
-
-  accel_label = gtk_bin_get_child (GTK_BIN (widget));
-  g_assert (GTK_IS_ACCEL_LABEL (accel_label));
-
-  action = gtk_actionable_get_action_name (GTK_ACTIONABLE (widget));
-  accels = gtk_application_get_accels_for_action (app, action);
-
-  gtk_accelerator_parse (accels[0], &key, &mods);
-  gtk_accel_label_set_accel (GTK_ACCEL_LABEL (accel_label), key, mods);
-
-  g_strfreev (accels);
-}
-
 typedef struct
 {
   GtkTextView tv;
@@ -1863,13 +1842,6 @@ activate (GApplication *app)
   g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
   g_object_set_data (G_OBJECT (widget), "print_button", widget4);
 
-  set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "quitmenuitem")));
-  set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "deletemenuitem")));
-  set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "searchmenuitem")));
-  set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "darkmenuitem")));
-  set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "aboutmenuitem")));
-  set_accel (GTK_APPLICATION (app), GTK_WIDGET (gtk_builder_get_object (builder, "bgmenuitem")));
-
   widget2 = (GtkWidget *)gtk_builder_get_object (builder, "tooltextview");
 
   widget = (GtkWidget *)gtk_builder_get_object (builder, "toolbutton1");
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index f36eb8af65..ee7bc5cbe9 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -1814,260 +1814,6 @@ microphone-sensitivity-medium-symbolic</property>
                                         <property name="menu-model">menu_bar_model</property>
                                       </object>
                                     </child>
-                                    <child>
-                                      <object class="GtkMenuBar">
-                                        <child>
-                                          <object class="GtkMenuItem" id="menuitem1">
-                                            <property name="label" translatable="yes">File</property>
-                                            <property name="use-underline">1</property>
-                                            <child type="submenu">
-                                              <object class="GtkMenu" id="menu1">
-                                                <child>
-                                                  <object class="GtkMenuItem" id="menuitem101">
-                                                    <property name="label" translatable="yes">_New</property>
-                                                    <property name="use-underline">1</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkMenuItem" id="menuitem102">
-                                                    <property name="label" 
translatable="yes">_Open</property>
-                                                    <property name="use-underline">1</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkMenuItem" id="menuitem103">
-                                                    <property name="label" 
translatable="yes">_Save</property>
-                                                    <property name="use-underline">1</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkMenuItem" id="menuitem104">
-                                                    <property name="label" translatable="yes">Save 
_As</property>
-                                                    <property name="use-underline">1</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkSeparatorMenuItem" 
id="separatormenuitem1"/>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkMenuItem" id="quitmenuitem">
-                                                    <property name="label" 
translatable="yes">_Quit</property>
-                                                    <property name="use-underline">1</property>
-                                                    <property name="action-name">app.quit</property>
-                                                  </object>
-                                                </child>
-                                              </object>
-                                            </child>
-                                          </object>
-                                        </child>
-                                        <child>
-                                          <object class="GtkMenuItem" id="menuitem2">
-                                            <property name="label" translatable="yes">Edit</property>
-                                            <property name="use-underline">1</property>
-                                            <child type="submenu">
-                                              <object class="GtkMenu" id="menu2">
-                                                <child>
-                                                  <object class="GtkMenuItem" id="menuitem106">
-                                                    <property name="label" translatable="yes">Cu_t</property>
-                                                    <property name="can-focus">1</property>
-                                                    <property name="use-underline">1</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkMenuItem" id="menuitem107">
-                                                    <property name="label" 
translatable="yes">_Copy</property>
-                                                    <property name="use-underline">1</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkMenuItem" id="menuitem108">
-                                                    <property name="label" 
translatable="yes">_Paste</property>
-                                                    <property name="use-underline">1</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkMenuItem" id="deletemenuitem">
-                                                    <property name="label" 
translatable="yes">_Delete</property>
-                                                    <property name="use-underline">1</property>
-                                                    <property name="action-name">win.delete</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkMenuItem" id="searchmenuitem">
-                                                    <property name="label" 
translatable="yes">_Search</property>
-                                                    <property name="use-underline">1</property>
-                                                    <property name="action-name">win.search</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkMenuItem" id="checksmenuitem">
-                                                    <property name="label">_Checks</property>
-                                                    <property name="use-underline">1</property>
-                                                    <child type="submenu">
-                                                      <object class="GtkMenu" id="checkssubmenu">
-                                                        <child>
-                                                          <object class="GtkCheckMenuItem" 
id="checkmenuitem1">
-                                                            <property name="label">_Check</property>
-                                                            <property name="active">1</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkCheckMenuItem" 
id="checkmenuitem2">
-                                                            <property name="label">_Check</property>
-                                                            <property name="active">1</property>
-                                                            <property name="sensitive">0</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkCheckMenuItem" 
id="checkmenuitem3">
-                                                            <property name="label">_Check</property>
-                                                            <property name="inconsistent">1</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkCheckMenuItem" 
id="checkmenuitem4">
-                                                            <property name="label">_Check</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkCheckMenuItem" 
id="checkmenuitem5">
-                                                            <property name="label">_Check</property>
-                                                            <property name="sensitive">0</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkCheckMenuItem" 
id="checkmenuitem6">
-                                                            <property name="label">_Check</property>
-                                                            <property name="inconsistent">1</property>
-                                                            <property name="sensitive">0</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                      </object>
-                                                    </child>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkMenuItem" id="radiosmenuitem">
-                                                    <property name="label">_Radios</property>
-                                                    <property name="use-underline">1</property>
-                                                    <child type="submenu">
-                                                      <object class="GtkMenu" id="radiossubmenu">
-                                                        <child>
-                                                          <object class="GtkRadioMenuItem" 
id="radiomenuitem1">
-                                                            <property name="label">_Radio</property>
-                                                            <property name="active">1</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkRadioMenuItem" 
id="radiomenuitem2">
-                                                            <property name="label">_Radio</property>
-                                                            <property name="active">1</property>
-                                                            <property name="sensitive">0</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkRadioMenuItem" 
id="radiomenuitem3">
-                                                            <property name="label">_Radio</property>
-                                                            <property name="inconsistent">1</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkRadioMenuItem" 
id="radiomenuitem4">
-                                                            <property name="label">_Radio</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkRadioMenuItem" 
id="radiomenuitem5">
-                                                            <property name="label">_Radio</property>
-                                                            <property name="sensitive">0</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                        <child>
-                                                          <object class="GtkRadioMenuItem" 
id="radiomenuitem6">
-                                                            <property name="label">_Radio</property>
-                                                            <property name="inconsistent">1</property>
-                                                            <property name="sensitive">0</property>
-                                                            <property name="use-underline">1</property>
-                                                          </object>
-                                                        </child>
-                                                      </object>
-                                                    </child>
-                                                  </object>
-                                                </child>
-                                              </object>
-                                            </child>
-                                          </object>
-                                        </child>
-                                        <child>
-                                          <object class="GtkMenuItem" id="menuitem3">
-                                            <property name="label" translatable="yes">View</property>
-                                            <property name="use-underline">1</property>
-                                            <child type="submenu">
-                                              <object class="GtkMenu" id="view-menu">
-                                                <child>
-                                                  <object class="GtkCheckMenuItem" id="darkmenuitem">
-                                                    <property name="label">_Dark theme</property>
-                                                    <property name="use-underline">1</property>
-                                                    <property name="action-name">win.dark</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkCheckMenuItem" id="toolbarmenuitem">
-                                                    <property name="label">_Toolbar</property>
-                                                    <property name="active">1</property>
-                                                    <property name="use-underline">1</property>
-                                                    <property name="action-name">win.toolbar</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkCheckMenuItem" id="statusbarmenuitem">
-                                                    <property name="label">_Statusbar</property>
-                                                    <property name="active">1</property>
-                                                    <property name="use-underline">1</property>
-                                                    <property name="action-name">win.statusbar</property>
-                                                  </object>
-                                                </child>
-                                                <child>
-                                                  <object class="GtkMenuItem" id="bgmenuitem">
-                                                    <property name="label">_Select Background</property>
-                                                    <property name="use-underline">1</property>
-                                                    <property name="action-name">win.background</property>
-                                                  </object>
-                                                </child>
-                                              </object>
-                                            </child>
-                                          </object>
-                                        </child>
-                                        <child>
-                                          <object class="GtkMenuItem" id="menuitem4">
-                                            <property name="label" translatable="yes">Help</property>
-                                            <property name="use-underline">1</property>
-                                            <child type="submenu">
-                                              <object class="GtkMenu" id="menu3">
-                                                <child>
-                                                  <object class="GtkMenuItem" id="aboutmenuitem">
-                                                    <property name="label" 
translatable="yes">_About</property>
-                                                    <property name="use-underline">1</property>
-                                                    <property name="action-name">app.about</property>
-                                                  </object>
-                                                </child>
-                                              </object>
-                                            </child>
-                                          </object>
-                                        </child>
-                                      </object>
-                                    </child>
                                     <child>
                                       <object class="GtkToolbar" id="toolbar">
                                         <child>


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