diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-04-22 08:50:24 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-04-22 08:50:24 +0000 |
| commit | 9d3694ced6bd3a00ef9fca2522cf9821f945cba7 (patch) | |
| tree | 6b68b816b868549bb4f17daaccf5731fcaba685d | |
| parent | 814d402d4c9c011ee7e357e74cca6a64176a33d8 (diff) | |
| download | rockbox-9d3694ced6bd3a00ef9fca2522cf9821f945cba7.zip rockbox-9d3694ced6bd3a00ef9fca2522cf9821f945cba7.tar.gz rockbox-9d3694ced6bd3a00ef9fca2522cf9821f945cba7.tar.bz2 rockbox-9d3694ced6bd3a00ef9fca2522cf9821f945cba7.tar.xz | |
Fix FS#7056 - dont display garbage if the viewer icon set and the main iconset have different icon heights
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13237 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/filetypes.c | 14 | ||||
| -rw-r--r-- | apps/gui/icon.c | 11 | ||||
| -rw-r--r-- | apps/settings.h | 1 |
3 files changed, 14 insertions, 12 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c index 0daae1b..69448a7 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -145,10 +145,7 @@ void read_viewer_theme_file(void) custom_filetype_icons[0] = Icon_Folder; for (i=1; i<filetype_count; i++) { - if (filetypes[i].icon < Icon_Last_Themeable) - custom_filetype_icons[i] = filetypes[i].icon; - else - custom_filetype_icons[i] = Icon_Questionmark; + custom_filetype_icons[i] = filetypes[i].icon; } snprintf(buffer, MAX_PATH, "%s/%s.icons", ICON_DIR, @@ -181,6 +178,7 @@ void read_viewer_theme_file(void) void filetype_init(void) { + int i; /* set the directory item first */ filetypes[0].extension = NULL; filetypes[0].plugin = NULL; @@ -193,6 +191,14 @@ void filetype_init(void) #ifdef HAVE_LCD_BITMAP read_viewer_theme_file(); #endif + /* figure out how many viewer icons have been loaded */ + global_status.viewer_icon_count = Icon_Last_Themeable; + for (i=1; i<filetype_count; i++) + { + if (custom_filetype_icons[i] > global_status.viewer_icon_count) + global_status.viewer_icon_count = custom_filetype_icons[i]; + } + global_status.viewer_icon_count -= Icon_Last_Themeable; } /* remove all white spaces from string */ diff --git a/apps/gui/icon.c b/apps/gui/icon.c index 37eb1a7..968d835 100644 --- a/apps/gui/icon.c +++ b/apps/gui/icon.c @@ -129,16 +129,11 @@ void screen_put_iconxy(struct screen * display, { icon -= Icon_Last_Themeable; if (!viewer_icons_loaded[screen] || + (global_status.viewer_icon_count*height + > viewer_iconset[screen].height) || (icon * height > viewer_iconset[screen].height)) { -#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1) - if (screen == SCREEN_REMOTE) - { - screen_put_iconxy(display, xpos, ypos, Icon_Questionmark); - return; - } -#endif - screen_clear_area(display, xpos, ypos, width, height); + screen_put_iconxy(display, xpos, ypos, Icon_Questionmark); return; } data = viewer_iconset[screen].data; diff --git a/apps/settings.h b/apps/settings.h index 1fee6b4..0a82051 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -300,6 +300,7 @@ struct system_status relative to MIN_FREQ */ #endif char last_screen; + int viewer_icon_count; }; struct user_settings |