Collection window - thumbnail focus
authorColin Clark <colin.clark@cclark.uk>
Sat, 24 Mar 2018 10:37:17 +0000 (10:37 +0000)
committerColin Clark <colin.clark@cclark.uk>
Sat, 24 Mar 2018 10:37:17 +0000 (10:37 +0000)
If a collection is being shown in an image window, moving through the
images causes the thumbnail in focus in the collection window to follow

src/collect-table.c
src/collect-table.h
src/image.c

index cfe14a4..f4954e7 100644 (file)
@@ -401,7 +401,7 @@ static void collection_table_select_invert_all(CollectTable *ct)
        collection_table_update_status(ct);
 }
 
-static void collection_table_select(CollectTable *ct, CollectInfo *info)
+void collection_table_select(CollectTable *ct, CollectInfo *info)
 {
        ct->prev_selection = info;
 
@@ -1008,7 +1008,7 @@ static GtkWidget *collection_table_popup_menu(CollectTable *ct, gboolean over_ic
  *-------------------------------------------------------------------
  */
 
-static void collection_table_set_focus(CollectTable *ct, CollectInfo *info)
+void collection_table_set_focus(CollectTable *ct, CollectInfo *info)
 {
        GtkTreeIter iter;
        gint row, col;
index cc4d92e..15b3317 100644 (file)
@@ -41,6 +41,7 @@ void collection_table_set_labels(CollectTable *ct, GtkWidget *status, GtkWidget
 
 CollectInfo *collection_table_get_focus_info(CollectTable *ct);
 GList *collection_table_selection_get_list(CollectTable *ct);
-
+void collection_table_set_focus(CollectTable *ct, CollectInfo *info);
+void collection_table_select(CollectTable *ct, CollectInfo *info);
 #endif
 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */
index 52591a8..4bd602c 100644 (file)
@@ -24,6 +24,7 @@
 
 
 #include "collect.h"
+#include "collect-table.h"
 #include "color-man.h"
 #include "exif.h"
 #include "metadata.h"
@@ -1174,9 +1175,18 @@ void image_change_pixbuf(ImageWindow *imd, GdkPixbuf *pixbuf, gdouble zoom, gboo
 
 void image_change_from_collection(ImageWindow *imd, CollectionData *cd, CollectInfo *info, gdouble zoom)
 {
+       CollectWindow *cw;
+
        if (!cd || !info || !g_list_find(cd->list, info)) return;
 
        image_change_real(imd, info->fd, cd, info, zoom);
+       cw = collection_window_find(cd);
+       if (cw)
+               {
+               collection_table_set_focus(cw->table, info);
+               collection_table_unselect_all(cw->table);
+               collection_table_select(cw->table,info);
+               }
 }
 
 CollectionData *image_get_collection(ImageWindow *imd, CollectInfo **info)