Skip to content
Snippets Groups Projects
Commit a0072d60 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Also update window title for thumbnail windows (closes #280)

parent f05ba61a
No related branches found
No related tags found
No related merge requests found
......@@ -138,6 +138,7 @@ void show_mini_usage(void);
void slideshow_change_image(winwidget winwid, int change, int render);
void slideshow_pause_toggle(winwidget w);
char *slideshow_create_name(feh_file * file, winwidget winwid);
char *thumbnail_create_name(feh_file * file, winwidget winwid);
void init_keyevents(void);
void init_buttonbindings(void);
void feh_event_handle_keypress(XEvent * ev);
......
......@@ -876,3 +876,16 @@ int feh_thumbnail_setup_thumbnail_dir(void)
return status;
}
char *thumbnail_create_name(feh_file * file, winwidget winwid)
{
char *s = NULL;
if (!opt.thumb_title) {
s = estrdup(file->filename);
} else {
s = estrdup(feh_printf(opt.thumb_title, file, winwid));
}
return(s);
}
......@@ -634,9 +634,14 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias)
feh_draw_info(winwid);
if (winwid->errstr)
feh_draw_errstr(winwid);
if (opt.title && (current_file != NULL)) {
/* title might contain e.g. the zoom specifier -> rewrite */
char *s = slideshow_create_name(FEH_FILE(current_file->data), winwid);
if (opt.title && (winwid->type != WIN_TYPE_THUMBNAIL_VIEWER) &&
(winwid->file != NULL)) {
char *s = slideshow_create_name(FEH_FILE(winwid->file->data), winwid);
winwidget_rename(winwid, s);
free(s);
} else if (opt.thumb_title && (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER) &&
(winwid->file != NULL)) {
char *s = thumbnail_create_name(FEH_FILE(winwid->file->data), winwid);
winwidget_rename(winwid, s);
free(s);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment