diff options
author | Benjamin Otte <otte@redhat.com> | 2012-06-13 19:26:09 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-06-14 07:41:40 +0200 |
commit | 6d9d87806ad957bfabebd18989c8989efce19c01 (patch) | |
tree | 7f97b0484dd5b29da7942951194ef0c76461514d /gtk | |
parent | 7c1b5611940d7540e7b7ebd4cc63b0eee88dac46 (diff) | |
download | gtk+-6d9d87806ad957bfabebd18989c8989efce19c01.tar.gz |
iconview: clamp item size to be in [minimum, natural]
Minimum size is necessary so you can see the item. If we can't get that
we need to scroll.
Natural as the maximum is used so that the spacing between items doesn't
increase when resizing the iconview, but empty space is added to the
right/bottom instead.
https://bugzilla.gnome.org/show_bug.cgi?id=677809
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkiconview.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index cdce24cc34..63f67a52b5 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -1598,7 +1598,7 @@ gtk_icon_view_compute_n_items_for_size (GtkIconView *icon_view, if (min_item_size) { *min_item_size = size / *min_items; - *min_item_size = MIN (*min_item_size, natural); + *min_item_size = CLAMP (*min_item_size, minimum, natural); *min_item_size -= spacing; *min_item_size -= 2 * priv->item_padding; } @@ -1606,7 +1606,7 @@ gtk_icon_view_compute_n_items_for_size (GtkIconView *icon_view, if (max_item_size) { *max_item_size = size / *max_items; - *max_item_size = MIN (*max_item_size, natural); + *max_item_size = CLAMP (*max_item_size, minimum, natural); *max_item_size -= spacing; *max_item_size -= 2 * priv->item_padding; } |