[gtk+] scrolledwindow: improve v/hscrollbar proximity detection
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] scrolledwindow: improve v/hscrollbar proximity detection
- Date: Wed, 24 Dec 2014 14:27:27 +0000 (UTC)
commit d2b2b34ae5900d94b650f9ed657d09e3915100f3
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Dec 1 13:59:22 2014 +0100
scrolledwindow: improve v/hscrollbar proximity detection
Only horizontal coordinates are checked for the vertical scrollbar, and
vice versa.
gtk/gtkscrolledwindow.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 774b59b..f08b04c 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -954,10 +954,12 @@ event_close_to_indicator (GtkScrolledWindow *sw,
GdkEvent *event)
{
GtkAllocation alloc, indicator_alloc;
+ GtkScrolledWindowPrivate *priv;
GtkWidget *event_widget;
gint win_x, win_y;
gdouble x, y;
+ priv = sw->priv;
event_widget = gtk_get_event_widget (event);
gdk_event_get_coords (event, &x, &y);
@@ -978,14 +980,12 @@ event_close_to_indicator (GtkScrolledWindow *sw,
y = ycoord;
}
- if (x < 0 || x > alloc.width ||
- y < 0 || y > alloc.height)
- return FALSE;
-
- if (x > win_x - 50 &&
- x < win_x + indicator_alloc.width + 50 &&
- y > win_y - 50 &&
- y < win_y + indicator_alloc.height + 50)
+ if ((indicator == &priv->hindicator &&
+ y >= win_y - 50 &&
+ y < win_y + indicator_alloc.height + 50) ||
+ (indicator == &priv->vindicator &&
+ x >= win_x - 50 &&
+ x < win_x + indicator_alloc.width + 50))
return TRUE;
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]