[gtk+] Deprecate and ignore gtk-keynav-cursor-only and gtk-keynav-wrap-around



commit b101d465be26f23dbbb113472c3395bd5362aa00
Author: William Jon McCann <william jon mccann gmail com>
Date:   Wed Jun 26 15:33:10 2013 -0400

    Deprecate and ignore gtk-keynav-cursor-only and gtk-keynav-wrap-around

 gtk/gtkmenushell.c   |   19 ++-----------------
 gtk/gtknotebook.c    |   26 +++++---------------------
 gtk/gtkradiobutton.c |   24 +-----------------------
 gtk/gtkrange.c       |   37 -------------------------------------
 gtk/gtksettings.c    |    5 +++++
 gtk/gtkwidget.c      |   13 +------------
 6 files changed, 14 insertions(+), 110 deletions(-)
---
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index 06e68f7..5bc426b 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -1435,11 +1435,6 @@ gtk_menu_shell_real_move_selected (GtkMenuShell  *menu_shell,
     {
       GList *node = g_list_find (priv->children, priv->active_menu_item);
       GList *start_node = node;
-      gboolean wrap_around;
-
-      g_object_get (gtk_widget_get_settings (GTK_WIDGET (menu_shell)),
-                    "gtk-keynav-wrap-around", &wrap_around,
-                    NULL);
 
       if (distance > 0)
         {
@@ -1449,13 +1444,8 @@ gtk_menu_shell_real_move_selected (GtkMenuShell  *menu_shell,
             {
               if (node)
                 node = node->next;
-              else if (wrap_around)
-                node = priv->children;
               else
-                {
-                  gtk_widget_error_bell (GTK_WIDGET (menu_shell));
-                  break;
-                }
+                node = priv->children;
             }
         }
       else
@@ -1466,13 +1456,8 @@ gtk_menu_shell_real_move_selected (GtkMenuShell  *menu_shell,
             {
               if (node)
                 node = node->prev;
-              else if (wrap_around)
-                node = g_list_last (priv->children);
               else
-                {
-                  gtk_widget_error_bell (GTK_WIDGET (menu_shell));
-                  break;
-                }
+                node = g_list_last (priv->children);
             }
         }
       
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index c446a26..4838ec7 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1318,18 +1318,9 @@ gtk_notebook_change_current_page (GtkNotebook *notebook,
 
       if (!current)
         {
-          gboolean wrap_around;
-
-          g_object_get (gtk_widget_get_settings (GTK_WIDGET (notebook)),
-                        "gtk-keynav-wrap-around", &wrap_around,
-                        NULL);
-
-          if (wrap_around)
-            current = gtk_notebook_search_page (notebook, NULL,
-                                                offset < 0 ? STEP_PREV : STEP_NEXT,
-                                                TRUE);
-          else
-            break;
+          current = gtk_notebook_search_page (notebook, NULL,
+                                              offset < 0 ? STEP_PREV : STEP_NEXT,
+                                              TRUE);
         }
 
       offset += offset < 0 ? 1 : -1;
@@ -4171,15 +4162,8 @@ focus_tabs_move (GtkNotebook     *notebook,
                                        search_direction, TRUE);
   if (!new_page)
     {
-      gboolean wrap_around;
-
-      g_object_get (gtk_widget_get_settings (GTK_WIDGET (notebook)),
-                    "gtk-keynav-wrap-around", &wrap_around,
-                    NULL);
-
-      if (wrap_around)
-        new_page = gtk_notebook_search_page (notebook, NULL,
-                                             search_direction, TRUE);
+      new_page = gtk_notebook_search_page (notebook, NULL,
+                                           search_direction, TRUE);
     }
 
   if (new_page)
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c
index 56bb999..ca221ed 100644
--- a/gtk/gtkradiobutton.c
+++ b/gtk/gtkradiobutton.c
@@ -663,12 +663,9 @@ gtk_radio_button_focus (GtkWidget         *widget,
   
   if (gtk_widget_is_focus (widget))
     {
-      GtkSettings *settings = gtk_widget_get_settings (widget);
       GSList *focus_list, *tmp_list;
       GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
       GtkWidget *new_focus = NULL;
-      gboolean cursor_only;
-      gboolean wrap_around;
 
       switch (direction)
        {
@@ -712,26 +709,8 @@ gtk_radio_button_focus (GtkWidget         *widget,
            }
        }
 
-      g_object_get (settings,
-                    "gtk-keynav-cursor-only", &cursor_only,
-                    "gtk-keynav-wrap-around", &wrap_around,
-                    NULL);
-
       if (!new_focus)
        {
-          if (cursor_only)
-            {
-              g_slist_free (focus_list);
-              return FALSE;
-            }
-
-          if (!wrap_around)
-            {
-              g_slist_free (focus_list);
-              gtk_widget_error_bell (widget);
-              return TRUE;
-            }
-
          tmp_list = focus_list;
 
          while (tmp_list)
@@ -754,8 +733,7 @@ gtk_radio_button_focus (GtkWidget         *widget,
        {
          gtk_widget_grab_focus (new_focus);
 
-          if (!cursor_only)
-            gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (new_focus), TRUE);
+          gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (new_focus), TRUE);
        }
 
       return TRUE;
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 8339e52..4a42597 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -3256,43 +3256,6 @@ static void
 gtk_range_move_slider (GtkRange     *range,
                        GtkScrollType scroll)
 {
-  GtkRangePrivate *priv = range->priv;
-  gboolean cursor_only;
-
-  g_object_get (gtk_widget_get_settings (GTK_WIDGET (range)),
-                "gtk-keynav-cursor-only", &cursor_only,
-                NULL);
-
-  if (cursor_only)
-    {
-      GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (range));
-
-      if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
-        {
-          if (scroll == GTK_SCROLL_STEP_UP ||
-              scroll == GTK_SCROLL_STEP_DOWN)
-            {
-              if (toplevel)
-                gtk_widget_child_focus (toplevel,
-                                        scroll == GTK_SCROLL_STEP_UP ?
-                                        GTK_DIR_UP : GTK_DIR_DOWN);
-              return;
-            }
-        }
-      else
-        {
-          if (scroll == GTK_SCROLL_STEP_LEFT ||
-              scroll == GTK_SCROLL_STEP_RIGHT)
-            {
-              if (toplevel)
-                gtk_widget_child_focus (toplevel,
-                                        scroll == GTK_SCROLL_STEP_LEFT ?
-                                        GTK_DIR_LEFT : GTK_DIR_RIGHT);
-              return;
-            }
-        }
-    }
-
   if (! gtk_range_scroll (range, scroll))
     gtk_widget_error_bell (GTK_WIDGET (range));
 }
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index fba3b0f..afd1a0a 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -839,6 +839,9 @@ gtk_settings_class_init (GtkSettingsClass *class)
    * to be present on the used input device.
    *
    * Since: 2.12
+   *
+   * Deprecated: 3.10: Generally, the behavior for touchscreen input should be
+   *             performed dynamically based on gdk_event_get_source_device().
    */
   result = settings_install_property_parser (class,
                                              g_param_spec_boolean ("gtk-keynav-cursor-only",
@@ -857,6 +860,8 @@ gtk_settings_class_init (GtkSettingsClass *class)
    * navigation, such as menus, menubars and notebooks.
    *
    * Since: 2.12
+   *
+   * Deprecated: 3.10: This setting is ignored.
    */
   result = settings_install_property_parser (class,
                                              g_param_spec_boolean ("gtk-keynav-wrap-around",
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index c0cb526..f5d7d0e 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -7603,8 +7603,6 @@ static gboolean
 gtk_widget_real_keynav_failed (GtkWidget        *widget,
                                GtkDirectionType  direction)
 {
-  gboolean cursor_only;
-
   switch (direction)
     {
     case GTK_DIR_TAB_FORWARD:
@@ -7615,11 +7613,6 @@ gtk_widget_real_keynav_failed (GtkWidget        *widget,
     case GTK_DIR_DOWN:
     case GTK_DIR_LEFT:
     case GTK_DIR_RIGHT:
-      g_object_get (gtk_widget_get_settings (widget),
-                    "gtk-keynav-cursor-only", &cursor_only,
-                    NULL);
-      if (cursor_only)
-        return FALSE;
       break;
     }
 
@@ -10100,11 +10093,7 @@ gtk_widget_child_focus (GtkWidget       *widget,
  *
  * The default ::keynav-failed handler returns %TRUE for
  * %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
- * values of #GtkDirectionType, it looks at the
- * #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
- * if the setting is %TRUE. This way the entire user interface
- * becomes cursor-navigatable on input devices such as mobile phones
- * which only have cursor keys but no tab key.
+ * values of #GtkDirectionType it returns %FALSE.
  *
  * Whenever the default handler returns %TRUE, it also calls
  * gtk_widget_error_bell() to notify the user of the failed keyboard


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