Commit b101d465 authored by William Jon McCann's avatar William Jon McCann

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

parent b26c74e5
......@@ -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);
}
}
......
......@@ -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)
......
......@@ -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;
......
......@@ -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));
}
......
......@@ -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",
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment