From 344950a2e26d22e6b32723b222a02998e75fc8b9 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 3 Jun 2024 02:38:05 +0200 Subject: [PATCH] preview: obtain the correct icon size from the helper --- src/plugins/preview.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/plugins/preview.c b/src/plugins/preview.c index 35b60d1..26f9d27 100644 --- a/src/plugins/preview.c +++ b/src/plugins/preview.c @@ -408,8 +408,13 @@ static void _preview_get_image_size(Preview * preview, gint * width, #endif return; } +#if GTK_CHECK_VERSION(2, 6, 0) + *width = preview->helper->get_icon_size(preview->helper->browser, + BROWSER_VIEW_THUMBNAILS); +#else *width = PREVIEW_IMAGE_SIZE_DEFAULT; - *height = PREVIEW_IMAGE_SIZE_DEFAULT; +#endif + *height = *width; if(preview->path != NULL && (pixbuf = gdk_pixbuf_new_from_file(preview->path, &error)) != NULL) @@ -451,8 +456,14 @@ static void _preview_get_widget_size(Preview * preview, gint * width, else #endif { +#if GTK_CHECK_VERSION(2, 6, 0) + *width = preview->helper->get_icon_size( + preview->helper->browser, + BROWSER_VIEW_THUMBNAILS); +#else *width = PREVIEW_IMAGE_SIZE_DEFAULT; - *height = PREVIEW_IMAGE_SIZE_DEFAULT; +#endif + *height = *width; } #ifdef DEBUG fprintf(stderr, "DEBUG: %s() %dx%d\n", __func__, *width, *height);