From fe313fb1fd407cb8250b27b7c6ef9559ef53b84a Mon Sep 17 00:00:00 2001 From: Guillaume Chereau Date: Fri, 12 Jan 2024 09:59:41 +0800 Subject: [PATCH] Show '*' in file name when it has changed Will need to make sure this does not affect the performances, since this work by computing the hash of the image at each frame! --- src/goxel.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/goxel.c b/src/goxel.c index b870055d8..07c85eb82 100644 --- a/src/goxel.c +++ b/src/goxel.c @@ -427,7 +427,13 @@ void goxel_release_graphics(void) static void update_window_title(void) { char buf[1024]; - sprintf(buf, "Goxel %s%s %s", GOXEL_VERSION_STR, DEBUG ? " (debug)" : "", + bool changed; + + changed = image_get_key(goxel.image) != goxel.image->saved_key; + sprintf(buf, "Goxel %s%s %s%s", + GOXEL_VERSION_STR, + DEBUG ? " (debug)" : "", + changed ? "*" : "", goxel.image->path ?: ""); sys_set_window_title(buf); }