[rhythmbox] shell: remove the app menu and always show the menu button
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] shell: remove the app menu and always show the menu button
- Date: Tue, 20 Aug 2019 04:10:28 +0000 (UTC)
commit 052d5d4fab6d35b456d3f19f503b44802e53c83b
Author: Jonathan Matthew <jonathan d14n org>
Date: Fri Dec 28 12:50:40 2018 +1000
shell: remove the app menu and always show the menu button
While we're here, fix the icon name to be more consistent with
everything else.
shell/rb-application.c | 12 ------------
shell/rb-shell.c | 37 +++++++++----------------------------
2 files changed, 9 insertions(+), 40 deletions(-)
---
diff --git a/shell/rb-application.c b/shell/rb-application.c
index 7550f669f..9d294aede 100644
--- a/shell/rb-application.c
+++ b/shell/rb-application.c
@@ -352,7 +352,6 @@ static void
impl_startup (GApplication *app)
{
RBApplication *rb = RB_APPLICATION (app);
- gboolean shell_shows_app_menu;
GtkBuilder *builder;
GMenuModel *menu;
GtkCssProvider *provider;
@@ -380,22 +379,11 @@ impl_startup (GApplication *app)
G_N_ELEMENTS (app_actions),
app);
- g_object_get (gtk_settings_get_default (),
- "gtk-shell-shows-app-menu", &shell_shows_app_menu,
- NULL);
-
builder = rb_builder_load ("app-menu.ui", NULL);
menu = G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu"));
rb_application_link_shared_menus (rb, G_MENU (menu));
rb_application_add_shared_menu (rb, "app-menu", menu);
- /* only set the app menu if the shell shows it; otherwise, we'll
- * stick a menu button in the toolbar.
- */
- if (shell_shows_app_menu) {
- gtk_application_set_app_menu (GTK_APPLICATION (app), menu);
- }
-
g_object_unref (builder);
/* Use our own css provider */
diff --git a/shell/rb-shell.c b/shell/rb-shell.c
index 2cd3b38d0..ccd0fbfaa 100644
--- a/shell/rb-shell.c
+++ b/shell/rb-shell.c
@@ -715,7 +715,6 @@ static void
construct_load_ui (RBShell *shell)
{
GApplication *app = g_application_get_default ();
- gboolean shell_shows_app_menu;
GtkWidget *toolbar;
GtkBuilder *builder;
GtkToolItem *tool_item;
@@ -760,29 +759,22 @@ construct_load_ui (RBShell *shell)
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), tool_item, -1);
- /* menu tool button, only shown if the shell doesn't show the app menu,
- * or in party mode where the app menu is inaccessible.
- */
+ /* menu tool button */
menu_button = gtk_menu_button_new ();
model = rb_application_get_shared_menu (RB_APPLICATION (app), "app-menu");
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button), model);
gtk_style_context_add_class (gtk_widget_get_style_context (menu_button), GTK_STYLE_CLASS_RAISED);
g_object_set (menu_button, "margin-top", 12, "margin-bottom", 12, NULL);
- g_object_get (gtk_settings_get_default (),
- "gtk-shell-shows-app-menu", &shell_shows_app_menu,
- NULL);
- if (shell_shows_app_menu == FALSE) {
- gtk_widget_add_accelerator (menu_button,
- "activate",
- shell->priv->accel_group,
- GDK_KEY_F10,
- 0,
- GTK_ACCEL_VISIBLE);
- rb_application_set_menu_accelerators (shell->priv->application, model, TRUE);
- }
+ gtk_widget_add_accelerator (menu_button,
+ "activate",
+ shell->priv->accel_group,
+ GDK_KEY_F10,
+ 0,
+ GTK_ACCEL_VISIBLE);
+ rb_application_set_menu_accelerators (shell->priv->application, model, TRUE);
- image = gtk_image_new_from_icon_name ("emblem-system-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR);
+ image = gtk_image_new_from_icon_name ("open-menu-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_container_add (GTK_CONTAINER (menu_button), image);
shell->priv->menu_button = GTK_WIDGET (gtk_tool_item_new ());
@@ -2564,7 +2556,6 @@ window_state_event_cb (GtkWidget *widget,
static void
rb_shell_sync_party_mode (RBShell *shell)
{
- gboolean shell_shows_app_menu = TRUE;
GAction *action;
/* party mode does not use gsettings as a model since it
@@ -2574,16 +2565,6 @@ rb_shell_sync_party_mode (RBShell *shell)
action = g_action_map_lookup_action (G_ACTION_MAP (shell->priv->application), "quit");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), !shell->priv->party_mode);
- /* show/hide menu button */
- g_object_get (gtk_settings_get_default (),
- "gtk-shell-shows-app-menu", &shell_shows_app_menu,
- NULL);
- if (shell_shows_app_menu && (shell->priv->party_mode == FALSE)) {
- gtk_widget_hide (GTK_WIDGET (shell->priv->menu_button));
- } else {
- gtk_widget_show (GTK_WIDGET (shell->priv->menu_button));
- }
-
/* show/hide queue as sidebar ? */
g_object_set (shell->priv->player_shell, "queue-only", shell->priv->party_mode, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]