From 16ecee965b67eaf37e52c745f6369f49377e86b2 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Sun, 14 Jun 2015 17:58:12 +0200 Subject: EogThumbView: Set icon view columns to the real number of images GtkIconView's layout code was redone in gtk+-3.4.3 and 3.4.4 breaking EogThumbView which would scale the thumbnails so small that the thumbview would not be shown itself in single row mode. This should work with gtk+-3.4.2 and earlier as well. taken from: https://git.gnome.org/browse/eog/commit/?id=888b5ed --- src/eom-thumb-nav.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/eom-thumb-nav.c') diff --git a/src/eom-thumb-nav.c b/src/eom-thumb-nav.c index 702b4c5..24c2431 100644 --- a/src/eom-thumb-nav.c +++ b/src/eom-thumb-nav.c @@ -545,8 +545,13 @@ eom_thumb_nav_set_mode (EomThumbNav *nav, EomThumbNavMode mode) switch (mode) { case EOM_THUMB_NAV_MODE_ONE_ROW: +#if GTK_CHECK_VERSION (3, 4, 3) + gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview), + GTK_ORIENTATION_HORIZONTAL); +#else gtk_icon_view_set_columns (GTK_ICON_VIEW (priv->thumbview), G_MAXINT); +#endif gtk_widget_set_size_request (priv->thumbview, -1, -1); eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview), @@ -561,7 +566,12 @@ eom_thumb_nav_set_mode (EomThumbNav *nav, EomThumbNavMode mode) break; case EOM_THUMB_NAV_MODE_ONE_COLUMN: +#if GTK_CHECK_VERSION (3, 4, 3) + gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview), + GTK_ORIENTATION_VERTICAL); +#else gtk_icon_view_set_columns (GTK_ICON_VIEW (priv->thumbview), 1); +#endif gtk_widget_set_size_request (priv->thumbview, -1, -1); eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview), @@ -577,7 +587,12 @@ eom_thumb_nav_set_mode (EomThumbNav *nav, EomThumbNavMode mode) break; case EOM_THUMB_NAV_MODE_MULTIPLE_ROWS: +#if GTK_CHECK_VERSION (3, 4, 3) + gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview), + GTK_ORIENTATION_VERTICAL); +#else gtk_icon_view_set_columns (GTK_ICON_VIEW (priv->thumbview), -1); +#endif gtk_widget_set_size_request (priv->thumbview, -1, 220); eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview), @@ -593,7 +608,12 @@ eom_thumb_nav_set_mode (EomThumbNav *nav, EomThumbNavMode mode) break; case EOM_THUMB_NAV_MODE_MULTIPLE_COLUMNS: +#if GTK_CHECK_VERSION (3, 4, 3) + gtk_orientable_set_orientation (GTK_ORIENTABLE(priv->thumbview), + GTK_ORIENTATION_VERTICAL); +#else gtk_icon_view_set_columns (GTK_ICON_VIEW (priv->thumbview), -1); +#endif gtk_widget_set_size_request (priv->thumbview, 230, -1); eom_thumb_view_set_item_height (EOM_THUMB_VIEW (priv->thumbview), -- cgit v1.2.1