summaryrefslogtreecommitdiff
path: root/apps/gui/icon.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/icon.c')
-rw-r--r--apps/gui/icon.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index b844b4bb5b..6e4cd59059 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -74,11 +74,11 @@ static const int default_height[NB_SCREENS] = {
74 74
75#define IMG_BUFSIZE (MAX_ICON_HEIGHT * MAX_ICON_WIDTH * \ 75#define IMG_BUFSIZE (MAX_ICON_HEIGHT * MAX_ICON_WIDTH * \
76 Icon_Last_Themeable *LCD_DEPTH/8) 76 Icon_Last_Themeable *LCD_DEPTH/8)
77static unsigned char icon_buffer[IMG_BUFSIZE][NB_SCREENS]; 77static unsigned char icon_buffer[NB_SCREENS][IMG_BUFSIZE];
78static bool custom_icons_loaded[NB_SCREENS] = {false}; 78static bool custom_icons_loaded[NB_SCREENS] = {false};
79static struct bitmap user_iconset[NB_SCREENS]; 79static struct bitmap user_iconset[NB_SCREENS];
80 80
81static unsigned char viewer_icon_buffer[IMG_BUFSIZE][NB_SCREENS]; 81static unsigned char viewer_icon_buffer[NB_SCREENS][IMG_BUFSIZE];
82static bool viewer_icons_loaded[NB_SCREENS] = {false}; 82static bool viewer_icons_loaded[NB_SCREENS] = {false};
83static struct bitmap viewer_iconset[NB_SCREENS]; 83static struct bitmap viewer_iconset[NB_SCREENS];
84 84
@@ -252,13 +252,15 @@ void icons_init(void)
252 { 252 {
253 snprintf(path, MAX_PATH, "%s/%s.bmp", 253 snprintf(path, MAX_PATH, "%s/%s.bmp",
254 ICON_DIR, global_settings.icon_file); 254 ICON_DIR, global_settings.icon_file);
255 load_icons(path, Iconset_Mainscreen); 255 load_icons((global_settings.icon_file[0] == '-')?NULL:path,
256 Iconset_Mainscreen);
256 } 257 }
257 if (global_settings.viewers_icon_file[0]) 258 if (global_settings.viewers_icon_file[0])
258 { 259 {
259 snprintf(path, MAX_PATH, "%s/%s.bmp", 260 snprintf(path, MAX_PATH, "%s/%s.bmp",
260 ICON_DIR, global_settings.viewers_icon_file); 261 ICON_DIR, global_settings.viewers_icon_file);
261 load_icons(path, Iconset_Mainscreen_viewers); 262 load_icons((global_settings.viewers_icon_file[0] == '-')?NULL:path,
263 Iconset_Mainscreen_viewers);
262 read_viewer_theme_file(); 264 read_viewer_theme_file();
263 } 265 }
264 else 266 else
@@ -268,13 +270,15 @@ void icons_init(void)
268 { 270 {
269 snprintf(path, MAX_PATH, "%s/%s.bmp", 271 snprintf(path, MAX_PATH, "%s/%s.bmp",
270 ICON_DIR, global_settings.remote_icon_file); 272 ICON_DIR, global_settings.remote_icon_file);
271 load_icons(path, Iconset_Remotescreen); 273 load_icons((global_settings.remote_icon_file[0] == '-')?NULL:path,
274 Iconset_Remotescreen);
272 } 275 }
273 if (global_settings.remote_viewers_icon_file[0]) 276 if (global_settings.remote_viewers_icon_file[0])
274 { 277 {
275 snprintf(path, MAX_PATH, "%s/%s.bmp", 278 snprintf(path, MAX_PATH, "%s/%s.bmp",
276 ICON_DIR, global_settings.remote_viewers_icon_file); 279 ICON_DIR, global_settings.remote_viewers_icon_file);
277 load_icons(path, Iconset_Remotescreen_viewers); 280 load_icons((global_settings.remote_viewers_icon_file[0] == '-')?NULL:path,
281 Iconset_Remotescreen_viewers);
278 } 282 }
279 else 283 else
280 load_icons(DEFAULT_REMOTE_VIEWER_BMP, Iconset_Remotescreen_viewers); 284 load_icons(DEFAULT_REMOTE_VIEWER_BMP, Iconset_Remotescreen_viewers);