[gtk+] GtkScrolledWindow: Don't require proximity for track points
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkScrolledWindow: Don't require proximity for track points
- Date: Sat, 10 Jan 2015 02:15:35 +0000 (UTC)
commit 11eb64a2b69f02d916d0448065a5108ad106f30c
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 9 21:09:22 2015 -0500
GtkScrolledWindow: Don't require proximity for track points
These are hard to navigate precisely, so show wide scrollbars
right away.
gtk/gtkscrolledwindow.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 9c709bc..f4e85fd 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -440,7 +440,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
class->scroll_child = gtk_scrolled_window_scroll_child;
class->move_focus_out = gtk_scrolled_window_move_focus_out;
-
+
g_object_class_install_property (gobject_class,
PROP_HADJUSTMENT,
g_param_spec_object ("hadjustment",
@@ -1040,7 +1040,6 @@ captured_event_cb (GtkWidget *widget,
GtkScrolledWindow *sw;
GdkInputSource input_source;
GdkDevice *source_device;
- gboolean indicator_close;
sw = GTK_SCROLLED_WINDOW (widget);
priv = sw->priv;
@@ -1064,17 +1063,18 @@ captured_event_cb (GtkWidget *widget,
indicator_start_fade (&priv->hindicator, 1.0);
indicator_start_fade (&priv->vindicator, 1.0);
- /* Check whether we're hovering close to the vertical scrollbar */
- indicator_close = check_update_scrollbar_proximity (sw, &priv->vindicator,
- event);
-
- if (!indicator_close)
+ if (strstr (gdk_device_get_name (source_device), "TrackPoint"))
{
- /* Otherwise check the horizontal scrollbar */
- check_update_scrollbar_proximity (sw, &priv->hindicator, event);
+ indicator_set_over (&priv->hindicator, TRUE);
+ indicator_set_over (&priv->vindicator, TRUE);
}
else
- indicator_set_over (&priv->hindicator, FALSE);
+ {
+ if (!check_update_scrollbar_proximity (sw, &priv->vindicator, event))
+ check_update_scrollbar_proximity (sw, &priv->hindicator, event);
+ else
+ indicator_set_over (&priv->hindicator, FALSE);
+ }
}
else if (event->type == GDK_LEAVE_NOTIFY &&
event->crossing.mode == GDK_CROSSING_UNGRAB)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]