summaryrefslogtreecommitdiff
path: root/gtk/gtkscale.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-05-05 14:57:21 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-05-10 23:24:48 -0400
commitedc31a264c6778274376e892dc38ab186c952c4a (patch)
tree90f976c6f00ba5803249f5db904e65b97ee0cde5 /gtk/gtkscale.c
parentf6a4e68973fcf78504e320453c576abb789d9e03 (diff)
downloadgtk+-edc31a264c6778274376e892dc38ab186c952c4a.tar.gz
widget: Add a :focusable property
Add back a property that determines whether an individual widget will accept focus or not. :can-focus prevents the focus from ever entering the entire widget hierarchy below a widget, and :focusable just determines if grabbing the focus to the widget itself will succeed. See #2686
Diffstat (limited to 'gtk/gtkscale.c')
-rw-r--r--gtk/gtkscale.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 3f043c6305..455a004ac9 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -806,8 +806,7 @@ gtk_scale_class_init (GtkScaleClass *class)
add_slider_binding (binding_set, GDK_KEY_KP_Subtract, GDK_CONTROL_MASK,
GTK_SCROLL_PAGE_BACKWARD);
-
-
+
add_slider_binding (binding_set, GDK_KEY_Home, 0,
GTK_SCROLL_START);
@@ -830,11 +829,11 @@ gtk_scale_init (GtkScale *scale)
GtkScalePrivate *priv = gtk_scale_get_instance_private (scale);
GtkRange *range = GTK_RANGE (scale);
+ gtk_widget_set_focusable (GTK_WIDGET (scale), TRUE);
+
priv->value_pos = GTK_POS_TOP;
priv->digits = 1;
- gtk_widget_set_can_focus (GTK_WIDGET (scale), TRUE);
-
gtk_range_set_slider_size_fixed (range, TRUE);
_gtk_range_set_has_origin (range, TRUE);