[gtk+] Use a PAGE_STEP macro instead of a magic number



commit ca801abb4ccd6a925c867a99d4322c915f4e02f9
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Mon Jun 27 19:58:21 2011 +0300

    Use a PAGE_STEP macro instead of a magic number
    
    Helps to understand the code.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=653512

 gtk/gtkentry.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 0e2d931..8e1b7ec 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -117,6 +117,7 @@
 #define DRAW_TIMEOUT     20
 #define COMPLETION_TIMEOUT 300
 #define PASSWORD_HINT_MAX 8
+#define PAGE_STEP 14
 
 #define MAX_ICONS 2
 
@@ -9591,13 +9592,13 @@ gtk_entry_completion_key_press (GtkWidget   *widget,
 	    completion->priv->current_selected = -1;
 	  else if (completion->priv->current_selected < matches) 
 	    {
-	      completion->priv->current_selected -= 14;
+	      completion->priv->current_selected -= PAGE_STEP;
 	      if (completion->priv->current_selected < 0)
 		completion->priv->current_selected = 0;
 	    }
 	  else 
 	    {
-	      completion->priv->current_selected -= 14;
+	      completion->priv->current_selected -= PAGE_STEP;
 	      if (completion->priv->current_selected < matches - 1)
 		completion->priv->current_selected = matches - 1;
 	    }
@@ -9608,7 +9609,7 @@ gtk_entry_completion_key_press (GtkWidget   *widget,
 	    completion->priv->current_selected = 0;
 	  else if (completion->priv->current_selected < matches - 1)
 	    {
-	      completion->priv->current_selected += 14;
+	      completion->priv->current_selected += PAGE_STEP;
 	      if (completion->priv->current_selected > matches - 1)
 		completion->priv->current_selected = matches - 1;
 	    }
@@ -9618,7 +9619,7 @@ gtk_entry_completion_key_press (GtkWidget   *widget,
 	    }
 	  else
 	    {
-	      completion->priv->current_selected += 14;
+	      completion->priv->current_selected += PAGE_STEP;
 	      if (completion->priv->current_selected > matches + actions - 1)
 		completion->priv->current_selected = matches + actions - 1;
 	    }



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