[yelp] yelp-location-entry: Limit history drop-down to 8, #define it



commit ac24945f7a4f19d49ee1fa738296be2067a38e34
Author: Shaun McCance <shaunm gnome org>
Date:   Tue Oct 18 15:11:55 2011 -0400

    yelp-location-entry: Limit history drop-down to 8, #define it
    
    15 was too much. With the double-tall entries with the descs, the
    history list would scroll on reasonable laptop screens.

 libyelp/yelp-location-entry.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/libyelp/yelp-location-entry.c b/libyelp/yelp-location-entry.c
index a7ebfa9..ead3441 100644
--- a/libyelp/yelp-location-entry.c
+++ b/libyelp/yelp-location-entry.c
@@ -242,6 +242,8 @@ static GHashTable *completions;
 
 static guint location_entry_signals[LAST_SIGNAL] = {0,};
 
+#define MAX_HISTORY 8
+
 G_DEFINE_TYPE (YelpLocationEntry, yelp_location_entry, GTK_TYPE_COMBO_BOX)
 #define GET_PRIV(object) (G_TYPE_INSTANCE_GET_PRIVATE((object), YELP_TYPE_LOCATION_ENTRY, YelpLocationEntryPrivate))
 
@@ -1390,11 +1392,11 @@ view_uri_selected (YelpView          *view,
                             HISTORY_COL_URI, struri,
                             HISTORY_COL_FLAGS, LOCATION_ENTRY_IS_LOADING,
                             -1);
-        /* Limit to 15 entries. There are two extra for the search entry and
-         * the separator above it.
+        /* Limit to MAX_HISTORY entries. There are two extra for the search entry
+         * and the separator above it.
          */
         num = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (priv->history), NULL);
-        if (num > 17) {
+        if (num > MAX_HISTORY + 2) {
             if (gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (priv->history),
                                                                &last, NULL,
                                                                num - 3)) {



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