[gtk+/wip/baedert/box: 25/67] Stop checking GtkSettings:gtk-enable-mnemonics



commit 7b55c27b1ff8fd4f69249a33964cbffcd9473f8c
Author: Timm Bäder <mail baedert org>
Date:   Wed Oct 12 21:56:23 2016 +0200

    Stop checking GtkSettings:gtk-enable-mnemonics

 gtk/gtklabel.c     |   14 +-------------
 gtk/gtkmenushell.c |   10 +---------
 gtk/gtkwindow.c    |   12 +++---------
 3 files changed, 5 insertions(+), 31 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 7f2781c..28c47dc 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -2015,9 +2015,6 @@ gtk_label_screen_changed (GtkWidget *widget,
 
   if (! shortcuts_connected)
     {
-      g_signal_connect (settings, "notify::gtk-enable-mnemonics",
-                        G_CALLBACK (label_shortcut_setting_changed),
-                        NULL);
       g_signal_connect (settings, "notify::gtk-enable-accels",
                         G_CALLBACK (label_shortcut_setting_changed),
                         NULL);
@@ -2684,10 +2681,6 @@ gtk_label_set_markup_internal (GtkLabel    *label,
       gboolean enable_mnemonics = TRUE;
       gboolean auto_mnemonics = TRUE;
 
-      g_object_get (gtk_widget_get_settings (GTK_WIDGET (label)),
-                    "gtk-enable-mnemonics", &enable_mnemonics,
-                    NULL);
-
       if (!(enable_mnemonics && priv->mnemonics_visible &&
             (!auto_mnemonics ||
              (gtk_widget_is_sensitive (GTK_WIDGET (label)) &&
@@ -2906,7 +2899,6 @@ gtk_label_set_pattern_internal (GtkLabel    *label,
 {
   GtkLabelPrivate *priv = label->priv;
   PangoAttrList *attrs;
-  gboolean enable_mnemonics = TRUE;
   gboolean auto_mnemonics = TRUE;
 
   if (priv->pattern_set)
@@ -2914,11 +2906,7 @@ gtk_label_set_pattern_internal (GtkLabel    *label,
 
   if (is_mnemonic)
     {
-      g_object_get (gtk_widget_get_settings (GTK_WIDGET (label)),
-                    "gtk-enable-mnemonics", &enable_mnemonics,
-                    NULL);
-
-      if (enable_mnemonics && priv->mnemonics_visible && pattern &&
+      if (priv->mnemonics_visible && pattern &&
           (!auto_mnemonics ||
            (gtk_widget_is_sensitive (GTK_WIDGET (label)) &&
             (!priv->mnemonic_widget ||
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index c284c6a..ef559af 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -951,7 +951,6 @@ gtk_menu_shell_key_press (GtkWidget   *widget,
 {
   GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget);
   GtkMenuShellPrivate *priv = menu_shell->priv;
-  gboolean enable_mnemonics;
 
   priv->keyboard_mode = TRUE;
 
@@ -962,14 +961,7 @@ gtk_menu_shell_key_press (GtkWidget   *widget,
   if (gtk_bindings_activate_event (G_OBJECT (widget), event))
     return TRUE;
 
-  g_object_get (gtk_widget_get_settings (widget),
-                "gtk-enable-mnemonics", &enable_mnemonics,
-                NULL);
-
-  if (enable_mnemonics)
-    return gtk_menu_shell_activate_mnemonic (menu_shell, event);
-
-  return FALSE;
+  return gtk_menu_shell_activate_mnemonic (menu_shell, event);
 }
 
 static gint
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index b25ebc6..fa81608 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -10804,7 +10804,6 @@ gtk_window_activate_key (GtkWindow   *window,
   GtkKeyHash *key_hash;
   GtkWindowKeyEntry *found_entry = NULL;
   gboolean enable_accels;
-  gboolean enable_mnemonics;
 
   g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
   g_return_val_if_fail (event != NULL, FALSE);
@@ -10821,7 +10820,6 @@ gtk_window_activate_key (GtkWindow   *window,
                                              event->group);
 
       g_object_get (gtk_widget_get_settings (GTK_WIDGET (window)),
-                    "gtk-enable-mnemonics", &enable_mnemonics,
                     "gtk-enable-accels", &enable_accels,
                     NULL);
 
@@ -10830,11 +10828,8 @@ gtk_window_activate_key (GtkWindow   *window,
          GtkWindowKeyEntry *entry = tmp_list->data;
          if (entry->is_mnemonic)
             {
-              if( enable_mnemonics)
-              {
-                found_entry = entry;
-                break;
-              }
+              found_entry = entry;
+              break;
             }
           else 
             {
@@ -10852,8 +10847,7 @@ gtk_window_activate_key (GtkWindow   *window,
     {
       if (found_entry->is_mnemonic)
         {
-          if( enable_mnemonics)
-            return gtk_window_mnemonic_activate (window, found_entry->keyval,
+          return gtk_window_mnemonic_activate (window, found_entry->keyval,
                                                found_entry->modifiers);
         }
       else


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