diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-06-05 09:38:26 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-06-05 09:38:26 +0000 |
commit | d1a6fa113d30fc133e9401b3cce2bfcd0e76e7d3 (patch) | |
tree | bf67047daad332da54f9939efd4ae3ede7185994 /apps | |
parent | ffefc5d5e1f8d1e0cc5fa895200b57ac0595300a (diff) | |
download | rockbox-d1a6fa113d30fc133e9401b3cce2bfcd0e76e7d3.tar.gz rockbox-d1a6fa113d30fc133e9401b3cce2bfcd0e76e7d3.zip |
Addded option to hide icons in dir browser. (Patch #728377)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3731 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/deutsch.lang | 14 | ||||
-rw-r--r-- | apps/lang/english.lang | 5 | ||||
-rw-r--r-- | apps/menu.c | 3 | ||||
-rw-r--r-- | apps/settings.c | 13 | ||||
-rw-r--r-- | apps/settings.h | 1 | ||||
-rw-r--r-- | apps/settings_menu.c | 15 | ||||
-rw-r--r-- | apps/tree.c | 34 |
7 files changed, 67 insertions, 18 deletions
diff --git a/apps/lang/deutsch.lang b/apps/lang/deutsch.lang index c1e30365cf..a50e9bf96c 100644 --- a/apps/lang/deutsch.lang +++ b/apps/lang/deutsch.lang | |||
@@ -1461,10 +1461,20 @@ new: "normal" | |||
1461 | 1461 | ||
1462 | id: LANG_RECORDING_EDITABLE | 1462 | id: LANG_RECORDING_EDITABLE |
1463 | desc: Editable recordings setting | 1463 | desc: Editable recordings setting |
1464 | eng: "Editable files" | 1464 | eng: "Independent frames" |
1465 | new: "Editierbare Dateien" | 1465 | new: "unabhängige mp3-Frames" |
1466 | 1466 | ||
1467 | id: LANG_VBRFIX | 1467 | id: LANG_VBRFIX |
1468 | desc: The context menu entry | 1468 | desc: The context menu entry |
1469 | eng: "Update VBR file" | 1469 | eng: "Update VBR file" |
1470 | new: "VBR Datei aktualisieren" | 1470 | new: "VBR Datei aktualisieren" |
1471 | |||
1472 | id: LANG_SHOW_ICONS | ||
1473 | desc: in settings_menu | ||
1474 | eng: "Show Icons" | ||
1475 | new: "Icons anzeigen" | ||
1476 | |||
1477 | id: LANG_CAPTION_BACKLIGHT | ||
1478 | desc: in settings_menu | ||
1479 | eng: "Caption backlight" | ||
1480 | new: "Beleuchtung an bei Titelwechsel" | ||
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index f36c2f7990..78d2b5d710 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -1547,3 +1547,8 @@ id: LANG_RECORD_TIMESPLIT_REC | |||
1547 | decs: Display of record timer interval setting, on the record screen | 1547 | decs: Display of record timer interval setting, on the record screen |
1548 | eng: "Split time:" | 1548 | eng: "Split time:" |
1549 | new: | 1549 | new: |
1550 | |||
1551 | id: LANG_SHOW_ICONS | ||
1552 | desc: in settings_menu | ||
1553 | eng: "Show Icons" | ||
1554 | new: | ||
diff --git a/apps/menu.c b/apps/menu.c index 023f6fbbfb..b7bc542bb0 100644 --- a/apps/menu.c +++ b/apps/menu.c | |||
@@ -92,8 +92,11 @@ void put_cursorxy(int x, int y, bool on) | |||
92 | #ifdef HAVE_LCD_BITMAP | 92 | #ifdef HAVE_LCD_BITMAP |
93 | int fh, fw; | 93 | int fh, fw; |
94 | int xpos, ypos; | 94 | int xpos, ypos; |
95 | |||
96 | /* check here instead of at every call (ugly, but cheap) */ | ||
95 | if (global_settings.invert_cursor) | 97 | if (global_settings.invert_cursor) |
96 | return; | 98 | return; |
99 | |||
97 | lcd_getstringsize("A", &fw, &fh); | 100 | lcd_getstringsize("A", &fw, &fh); |
98 | xpos = x*6; | 101 | xpos = x*6; |
99 | ypos = y*fh + lcd_getymargin(); | 102 | ypos = y*fh + lcd_getymargin(); |
diff --git a/apps/settings.c b/apps/settings.c index 7805518872..a538543960 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -85,7 +85,7 @@ offset abs | |||
85 | 0x07 0x1b <treble byte> | 85 | 0x07 0x1b <treble byte> |
86 | 0x08 0x1c <loudness byte> | 86 | 0x08 0x1c <loudness byte> |
87 | 0x09 0x1d <bass boost byte> | 87 | 0x09 0x1d <bass boost byte> |
88 | 0x0a 0x1e <contrast (bit 0-5), invert bit (bit 6)> | 88 | 0x0a 0x1e <contrast (bit 0-5), invert bit (bit 6), show_icons (bit 7)> |
89 | 0x0b 0x1f <backlight_on_when_charging, invert_cursor, backlight_timeout> | 89 | 0x0b 0x1f <backlight_on_when_charging, invert_cursor, backlight_timeout> |
90 | 0x0c 0x20 <poweroff timer byte> | 90 | 0x0c 0x20 <poweroff timer byte> |
91 | 0x0d 0x21 <resume settings byte> | 91 | 0x0d 0x21 <resume settings byte> |
@@ -307,7 +307,8 @@ int settings_save( void ) | |||
307 | 307 | ||
308 | config_block[0xa] = (unsigned char) | 308 | config_block[0xa] = (unsigned char) |
309 | ((global_settings.contrast & 0x3f) | | 309 | ((global_settings.contrast & 0x3f) | |
310 | (global_settings.invert ? 0x40 : 0)); | 310 | (global_settings.invert ? 0x40 : 0) | |
311 | (global_settings.show_icons ? 0x80 : 0) ); | ||
311 | 312 | ||
312 | config_block[0xb] = (unsigned char) | 313 | config_block[0xb] = (unsigned char) |
313 | ((global_settings.backlight_on_when_charging?0x40:0) | | 314 | ((global_settings.backlight_on_when_charging?0x40:0) | |
@@ -581,6 +582,8 @@ void settings_load(void) | |||
581 | config_block[0xa] & 0x40 ? true : false; | 582 | config_block[0xa] & 0x40 ? true : false; |
582 | if ( global_settings.contrast < MIN_CONTRAST_SETTING ) | 583 | if ( global_settings.contrast < MIN_CONTRAST_SETTING ) |
583 | global_settings.contrast = DEFAULT_CONTRAST_SETTING; | 584 | global_settings.contrast = DEFAULT_CONTRAST_SETTING; |
585 | global_settings.show_icons = | ||
586 | config_block[0xa] & 0x80 ? true : false; | ||
584 | } | 587 | } |
585 | 588 | ||
586 | if (config_block[0xb] != 0xFF) { | 589 | if (config_block[0xb] != 0xFF) { |
@@ -959,6 +962,8 @@ bool settings_load_config(char* file) | |||
959 | set_cfg_bool(&global_settings.invert, value); | 962 | set_cfg_bool(&global_settings.invert, value); |
960 | else if (!strcasecmp(name, "invert cursor")) | 963 | else if (!strcasecmp(name, "invert cursor")) |
961 | set_cfg_bool(&global_settings.invert_cursor, value); | 964 | set_cfg_bool(&global_settings.invert_cursor, value); |
965 | else if (!strcasecmp(name, "show icons")) | ||
966 | set_cfg_bool(&global_settings.show_icons, value); | ||
962 | #endif | 967 | #endif |
963 | else if (!strcasecmp(name, "caption backlight")) | 968 | else if (!strcasecmp(name, "caption backlight")) |
964 | set_cfg_bool(&global_settings.caption_backlight, value); | 969 | set_cfg_bool(&global_settings.caption_backlight, value); |
@@ -1265,6 +1270,9 @@ bool settings_save_config(void) | |||
1265 | fprintf(fd, "invert cursor: %s\r\n", | 1270 | fprintf(fd, "invert cursor: %s\r\n", |
1266 | boolopt[global_settings.invert_cursor]); | 1271 | boolopt[global_settings.invert_cursor]); |
1267 | 1272 | ||
1273 | fprintf(fd, "show icons: %s\r\n", | ||
1274 | boolopt[global_settings.show_icons]); | ||
1275 | |||
1268 | fprintf(fd, "peak meter release: %d\r\n", | 1276 | fprintf(fd, "peak meter release: %d\r\n", |
1269 | global_settings.peak_meter_release); | 1277 | global_settings.peak_meter_release); |
1270 | 1278 | ||
@@ -1450,6 +1458,7 @@ void settings_reset(void) { | |||
1450 | global_settings.caption_backlight = false; | 1458 | global_settings.caption_backlight = false; |
1451 | global_settings.max_files_in_dir = 400; | 1459 | global_settings.max_files_in_dir = 400; |
1452 | global_settings.max_files_in_playlist = 10000; | 1460 | global_settings.max_files_in_playlist = 10000; |
1461 | global_settings.show_icons = true; | ||
1453 | } | 1462 | } |
1454 | 1463 | ||
1455 | bool set_bool(char* string, bool* variable ) | 1464 | bool set_bool(char* string, bool* variable ) |
diff --git a/apps/settings.h b/apps/settings.h index 49f4d588f2..96c83b0879 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -177,6 +177,7 @@ struct user_settings | |||
177 | 177 | ||
178 | int max_files_in_dir; /* Max entries in directory (file browser) */ | 178 | int max_files_in_dir; /* Max entries in directory (file browser) */ |
179 | int max_files_in_playlist; /* Max entries in playlist */ | 179 | int max_files_in_playlist; /* Max entries in playlist */ |
180 | bool show_icons; /* 0=hide 1=show */ | ||
180 | }; | 181 | }; |
181 | 182 | ||
182 | /* prototypes */ | 183 | /* prototypes */ |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 1f318036f1..cc3a1b9307 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -57,8 +57,19 @@ static bool caption_backlight(void) | |||
57 | return rc; | 57 | return rc; |
58 | } | 58 | } |
59 | 59 | ||
60 | /** | ||
61 | * Menu to set icon visibility | ||
62 | */ | ||
63 | static bool show_icons(void) | ||
64 | { | ||
65 | return set_bool( str(LANG_SHOW_ICONS), &global_settings.show_icons ); | ||
66 | } | ||
67 | |||
60 | #ifdef HAVE_LCD_BITMAP | 68 | #ifdef HAVE_LCD_BITMAP |
61 | 69 | ||
70 | /** | ||
71 | * Menu to set LCD Mode (normal/inverse) | ||
72 | */ | ||
62 | static bool invert(void) | 73 | static bool invert(void) |
63 | { | 74 | { |
64 | bool rc = set_bool_options(str(LANG_INVERT), | 75 | bool rc = set_bool_options(str(LANG_INVERT), |
@@ -70,6 +81,9 @@ static bool invert(void) | |||
70 | return rc; | 81 | return rc; |
71 | } | 82 | } |
72 | 83 | ||
84 | /** | ||
85 | * Menu to set Line Selector Type (Pointer/Bar) | ||
86 | */ | ||
73 | static bool invert_cursor(void) | 87 | static bool invert_cursor(void) |
74 | { | 88 | { |
75 | return set_bool_options(str(LANG_INVERT_CURSOR), | 89 | return set_bool_options(str(LANG_INVERT_CURSOR), |
@@ -829,6 +843,7 @@ static bool display_settings_menu(void) | |||
829 | { str(LANG_VOLUME_DISPLAY), volume_type }, | 843 | { str(LANG_VOLUME_DISPLAY), volume_type }, |
830 | { str(LANG_BATTERY_DISPLAY), battery_type }, | 844 | { str(LANG_BATTERY_DISPLAY), battery_type }, |
831 | #endif | 845 | #endif |
846 | { str(LANG_SHOW_ICONS), show_icons }, | ||
832 | { str(LANG_CAPTION_BACKLIGHT), caption_backlight }, | 847 | { str(LANG_CAPTION_BACKLIGHT), caption_backlight }, |
833 | }; | 848 | }; |
834 | 849 | ||
diff --git a/apps/tree.c b/apps/tree.c index acfc7ee263..bc9ae7b883 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -57,8 +57,8 @@ | |||
57 | #include "widgets.h" | 57 | #include "widgets.h" |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | /* Mirror of global_settings.max_files_in_dir */ | 60 | /* Boot value of global_settings.max_files_in_dir */ |
61 | int max_files_in_dir; | 61 | static int max_files_in_dir; |
62 | 62 | ||
63 | static char *name_buffer; | 63 | static char *name_buffer; |
64 | static int name_buffer_size; /* Size of allocated buffer */ | 64 | static int name_buffer_size; /* Size of allocated buffer */ |
@@ -98,7 +98,7 @@ void browse_root(void) | |||
98 | /* pixel margins */ | 98 | /* pixel margins */ |
99 | #define MARGIN_X (global_settings.scrollbar && \ | 99 | #define MARGIN_X (global_settings.scrollbar && \ |
100 | filesindir > tree_max_on_screen ? SCROLLBAR_WIDTH : 0) + \ | 100 | filesindir > tree_max_on_screen ? SCROLLBAR_WIDTH : 0) + \ |
101 | CURSOR_WIDTH + ICON_WIDTH | 101 | CURSOR_WIDTH + (global_settings.show_icons && ICON_WIDTH > 0 ? ICON_WIDTH :0) |
102 | #define MARGIN_Y (global_settings.statusbar ? STATUSBAR_HEIGHT : 0) | 102 | #define MARGIN_Y (global_settings.statusbar ? STATUSBAR_HEIGHT : 0) |
103 | 103 | ||
104 | /* position the entry-list starts at */ | 104 | /* position the entry-list starts at */ |
@@ -188,11 +188,19 @@ static int compare(const void* p1, const void* p2) | |||
188 | 188 | ||
189 | static void showfileline(int line, int direntry, bool scroll) | 189 | static void showfileline(int line, int direntry, bool scroll) |
190 | { | 190 | { |
191 | char* name = dircache[direntry].name; | ||
192 | int xpos = LINE_X; | ||
193 | |||
194 | #ifdef HAVE_LCD_CHARCELLS | ||
195 | if (!global_settings.show_icons) | ||
196 | xpos--; | ||
197 | #endif | ||
198 | |||
191 | /* if any file filter is on, strip the extension */ | 199 | /* if any file filter is on, strip the extension */ |
192 | if (global_settings.dirfilter != SHOW_ALL && | 200 | if (global_settings.dirfilter != SHOW_ALL && |
193 | !(dircache[direntry].attr & ATTR_DIRECTORY)) | 201 | !(dircache[direntry].attr & ATTR_DIRECTORY)) |
194 | { | 202 | { |
195 | char* dotpos = strrchr(dircache[direntry].name, '.'); | 203 | char* dotpos = strrchr(name, '.'); |
196 | char temp=0; | 204 | char temp=0; |
197 | if (dotpos) { | 205 | if (dotpos) { |
198 | temp = *dotpos; | 206 | temp = *dotpos; |
@@ -201,13 +209,12 @@ static void showfileline(int line, int direntry, bool scroll) | |||
201 | if(scroll) | 209 | if(scroll) |
202 | #ifdef HAVE_LCD_BITMAP | 210 | #ifdef HAVE_LCD_BITMAP |
203 | if (global_settings.invert_cursor) | 211 | if (global_settings.invert_cursor) |
204 | lcd_puts_scroll_style(LINE_X, line, dircache[direntry].name, | 212 | lcd_puts_scroll_style(xpos, line, name, STYLE_INVERT); |
205 | STYLE_INVERT); | ||
206 | else | 213 | else |
207 | #endif | 214 | #endif |
208 | lcd_puts_scroll(LINE_X, line, dircache[direntry].name); | 215 | lcd_puts_scroll(xpos, line, name); |
209 | else | 216 | else |
210 | lcd_puts(LINE_X, line, dircache[direntry].name); | 217 | lcd_puts(xpos, line, name); |
211 | if (temp) | 218 | if (temp) |
212 | *dotpos = temp; | 219 | *dotpos = temp; |
213 | } | 220 | } |
@@ -215,13 +222,12 @@ static void showfileline(int line, int direntry, bool scroll) | |||
215 | if(scroll) | 222 | if(scroll) |
216 | #ifdef HAVE_LCD_BITMAP | 223 | #ifdef HAVE_LCD_BITMAP |
217 | if (global_settings.invert_cursor) | 224 | if (global_settings.invert_cursor) |
218 | lcd_puts_scroll_style(LINE_X, line, dircache[direntry].name, | 225 | lcd_puts_scroll_style(xpos, line, name, STYLE_INVERT); |
219 | STYLE_INVERT); | ||
220 | else | 226 | else |
221 | #endif | 227 | #endif |
222 | lcd_puts_scroll(LINE_X, line, dircache[direntry].name); | 228 | lcd_puts_scroll(xpos, line, name); |
223 | else | 229 | else |
224 | lcd_puts(LINE_X, line, dircache[direntry].name); | 230 | lcd_puts(xpos, line, name); |
225 | } | 231 | } |
226 | } | 232 | } |
227 | 233 | ||
@@ -475,7 +481,7 @@ static int showdir(char *path, int start) | |||
475 | #endif | 481 | #endif |
476 | } | 482 | } |
477 | 483 | ||
478 | if (icon_type) { | 484 | if (icon_type && global_settings.show_icons) { |
479 | #ifdef HAVE_LCD_BITMAP | 485 | #ifdef HAVE_LCD_BITMAP |
480 | int offset=0; | 486 | int offset=0; |
481 | if ( line_height > 8 ) | 487 | if ( line_height > 8 ) |
@@ -493,7 +499,7 @@ static int showdir(char *path, int start) | |||
493 | } | 499 | } |
494 | 500 | ||
495 | #ifdef HAVE_LCD_BITMAP | 501 | #ifdef HAVE_LCD_BITMAP |
496 | if (global_settings.scrollbar && filesindir > tree_max_on_screen) | 502 | if (global_settings.scrollbar && (filesindir > tree_max_on_screen)) |
497 | scrollbar(SCROLLBAR_X, SCROLLBAR_Y, SCROLLBAR_WIDTH - 1, | 503 | scrollbar(SCROLLBAR_X, SCROLLBAR_Y, SCROLLBAR_WIDTH - 1, |
498 | LCD_HEIGHT - SCROLLBAR_Y, filesindir, start, | 504 | LCD_HEIGHT - SCROLLBAR_Y, filesindir, start, |
499 | start + tree_max_on_screen, VERTICAL); | 505 | start + tree_max_on_screen, VERTICAL); |