[gtk+] GtkScrolledWindow: Factor out a constant



commit 206f0bbf7f259868cd434733fd258810fad12281
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 9 21:12:00 2015 -0500

    GtkScrolledWindow: Factor out a constant
    
    Define INDICATOR_CLOSE_DISTANCE instead of hardcoding the same
    number of pixels in 4 different places.

 gtk/gtkscrolledwindow.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index f4e85fd..174f709 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -157,6 +157,7 @@
 #define INDICATOR_FADE_OUT_DELAY 2000
 #define INDICATOR_FADE_OUT_DURATION 1000
 #define INDICATOR_FADE_OUT_TIME 500
+#define INDICATOR_CLOSE_DISTANCE 50
 
 /* Scrolled off indication */
 #define UNDERSHOOT_SIZE 40
@@ -990,11 +991,11 @@ event_close_to_indicator (GtkScrolledWindow *sw,
     }
 
   if ((indicator == &priv->hindicator &&
-       y >= win_y - 50 &&
-       y < win_y + indicator_alloc.height + 50) ||
+       y >= win_y - INDICATOR_CLOSE_DISTANCE &&
+       y < win_y + indicator_alloc.height + INDICATOR_CLOSE_DISTANCE) ||
       (indicator == &priv->vindicator &&
-       x >= win_x - 50 &&
-       x < win_x + indicator_alloc.width + 50))
+       x >= win_x - INDICATOR_CLOSE_DISTANCE  &&
+       x < win_x + indicator_alloc.width + INDICATOR_CLOSE_DISTANCE))
     return TRUE;
 
   return FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]