]> uap-core.de Git - mizunara.git/commitdiff
save current number of selected items
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Wed, 29 Jan 2025 20:17:58 +0000 (21:17 +0100)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Wed, 29 Jan 2025 20:17:58 +0000 (21:17 +0100)
mizunara/gtk-filesview.c
mizunara/gtk-filesview.h

index c035167a8fb07d7ce360af4ff6896afda7fe05a3..52fb8a026e7de3bdde27d916197b829fcdc65403 100644 (file)
@@ -262,7 +262,7 @@ void mz_files_view_snapshot(GtkWidget *widget, GtkSnapshot *snapshot) {
         int img_y_offset = (item_height - img_alloc.height - label_alloc.height) / 2;
         int label_x_offset = (item_width - label_alloc.width) / 2;
 
-        
+        size_t selection_count = 0;
           
         int x = 0;
         int y = 0;
@@ -285,6 +285,7 @@ void mz_files_view_snapshot(GtkWidget *widget, GtkSnapshot *snapshot) {
                     gtk_snapshot_append_node(snapshot, highlight_clip_node);
                 } else {
                     view->items[i].isselected = 1;
+                    selection_count++;
                 }
             } else if (view->update_selection == 1) {
                 view->items[i].isselected = 0;
@@ -324,6 +325,11 @@ void mz_files_view_snapshot(GtkWidget *widget, GtkSnapshot *snapshot) {
                 y++;
             }
         }
+        
+        if(view->update_selection) {
+            view->selection_count = selection_count;
+            printf("selection_count: %d\n", (int)selection_count);
+        }
     }
 
     // draw children
index 423f778047379bd2aa86c6de9560af21c5036901..fd2f5bad0a5010774728ae5d6b91c1b74be9bcd7 100644 (file)
@@ -64,7 +64,9 @@ typedef struct MzFilesView {
     int current_width;
     MzViewSection *sections;
     size_t numsections;
-      
+    
+    size_t selection_count;
+    
     int highlight_col;
     int highlight_row;