[gtk+] range: start autoscrolling near the edges of ranges
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] range: start autoscrolling near the edges of ranges
- Date: Mon, 7 Oct 2013 20:39:49 +0000 (UTC)
commit 9fc3e59673e6e64ca9db8c4f1beb8d41a82563b3
Author: William Jon McCann <william jon mccann gmail com>
Date: Mon Oct 7 12:01:13 2013 -0400
range: start autoscrolling near the edges of ranges
If a range goes all the way to the edge of the screen then we don't
have any way to activate autoscrolling. By adding a small region
at the ends of the range we can handle this case. This is the same
approach used in treeviews.
gtk/gtkrange.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index aff4ff3..092dd4b 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -65,6 +65,7 @@
#define TIMEOUT_REPEAT 50
#define ZOOM_HOLD_TIME 500
#define AUTOSCROLL_FACTOR 20
+#define SCROLL_EDGE_SIZE 15
typedef struct _GtkRangeStepTimer GtkRangeStepTimer;
@@ -3052,9 +3053,9 @@ update_autoscroll_mode (GtkRange *range)
pos = range->priv->mouse_x;
}
- if (pos < 0)
+ if (pos < SCROLL_EDGE_SIZE)
mode = GTK_SCROLL_STEP_BACKWARD;
- else if (pos > size)
+ else if (pos > (size - SCROLL_EDGE_SIZE))
mode = GTK_SCROLL_STEP_FORWARD;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]