[nautilus/gtk4-preparation-trunk: 10/60] file: Add constant for minimum size to use




commit c44e05b556c3881ddb249c94d3d7315f77097375
Author: António Fernandes <antoniof gnome org>
Date:   Mon Nov 1 22:26:52 2021 +0000

    file: Add constant for minimum size to use
    
    Currently, list view doesn't use thumbnails for its first zoom levels:
    SMALL (16px) and STANDARD (32px). So, it does display thumbnails for
    LARGE (48px) and LARGER (64px). On the other hand, the icon view uses
    displays for all zoom levels, the smallest being 48px.
    
    In short: thumbnails are displayed for zoom levels that request an
    icon size of 48 logical pixels. So, the minumum size of thumbs is 48px.
    
    This is implemented by checking that the current icon size is equal to
    or lower than NAUTILUS_LIST_ICON_SIZE_STANDARD (32px).
    
    However, we are going to need to check this condition in other places,
    so it would be best to have a constant specifically for this purpose.
    
    For the sake of naming this constant reasonably, let's use the minumum
    size of 48px and update the condition checking accordingly.

 src/nautilus-file.c | 2 +-
 src/nautilus-file.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 1ec385a37..ca5a5cc1b 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -5307,7 +5307,7 @@ nautilus_thumbnail_is_limited_by_zoom (int size,
 
     zoom_level = size * scale;
 
-    if (zoom_level <= NAUTILUS_LIST_ICON_SIZE_STANDARD)
+    if (zoom_level < NAUTILUS_THUMBNAIL_MINIMUM_ICON_SIZE)
     {
         return TRUE;
     }
diff --git a/src/nautilus-file.h b/src/nautilus-file.h
index 6946be5f8..7c966389b 100644
--- a/src/nautilus-file.h
+++ b/src/nautilus-file.h
@@ -92,6 +92,8 @@ typedef enum {
        NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM = (1<<7)
 } NautilusFileIconFlags;       
 
+#define NAUTILUS_THUMBNAIL_MINIMUM_ICON_SIZE 48
+
 /* Standard Drag & Drop types. */
 typedef enum {
        NAUTILUS_ICON_DND_GNOME_ICON_LIST,


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