Mercurial > hg > forks > geeqie
changeset 2737:065402476db8
Collection window - thumbnail focus
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
author | Colin Clark <colin.clark@cclark.uk> |
---|---|
date | Sat, 24 Mar 2018 10:37:17 +0000 |
parents | 83c5953c719d |
children | c6e5a43c87e5 |
files | src/collect-table.c src/collect-table.h src/image.c |
diffstat | 3 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/collect-table.c Wed Mar 21 13:59:50 2018 +0000 +++ b/src/collect-table.c Sat Mar 24 10:37:17 2018 +0000 @@ -401,7 +401,7 @@ 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 void collection_table_set_focus(CollectTable *ct, CollectInfo *info) +void collection_table_set_focus(CollectTable *ct, CollectInfo *info) { GtkTreeIter iter; gint row, col;
--- a/src/collect-table.h Wed Mar 21 13:59:50 2018 +0000 +++ b/src/collect-table.h Sat Mar 24 10:37:17 2018 +0000 @@ -41,6 +41,7 @@ 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: */
--- a/src/image.c Wed Mar 21 13:59:50 2018 +0000 +++ b/src/image.c Sat Mar 24 10:37:17 2018 +0000 @@ -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_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)