diff options
author | Robert Hak <adiamas@rockbox.org> | 2002-05-30 08:06:42 +0000 |
---|---|---|
committer | Robert Hak <adiamas@rockbox.org> | 2002-05-30 08:06:42 +0000 |
commit | c501ac7be23652f7a06c9d9211cb6ebeef4c377a (patch) | |
tree | a8c27e8f4c830223fc3dc280c7c1061eee2d87f6 | |
parent | 00c6f5136f876cdf71118621e5514db59f1143d7 (diff) | |
download | rockbox-c501ac7be23652f7a06c9d9211cb6ebeef4c377a.tar.gz rockbox-c501ac7be23652f7a06c9d9211cb6ebeef4c377a.zip |
corrected the curson not being drawn for the recorder
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@814 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/main_menu.c | 4 | ||||
-rw-r--r-- | apps/menu.c | 21 |
2 files changed, 18 insertions, 7 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c index df9350ad5a..e53832a42c 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c | |||
@@ -76,9 +76,9 @@ static int show_logo(void) | |||
76 | void show_splash(void) | 76 | void show_splash(void) |
77 | { | 77 | { |
78 | lcd_clear_display(); | 78 | lcd_clear_display(); |
79 | 79 | ||
80 | if (show_logo() != 0) | 80 | if (show_logo() != 0) |
81 | return; | 81 | return; |
82 | } | 82 | } |
83 | 83 | ||
84 | void version(void) | 84 | void version(void) |
diff --git a/apps/menu.c b/apps/menu.c index e359f75799..a863925eca 100644 --- a/apps/menu.c +++ b/apps/menu.c | |||
@@ -55,6 +55,10 @@ static void menu_draw(int m) | |||
55 | i++) { | 55 | i++) { |
56 | lcd_puts(1, i-menus[m].top, menus[m].items[i].desc); | 56 | lcd_puts(1, i-menus[m].top, menus[m].items[i].desc); |
57 | } | 57 | } |
58 | |||
59 | /* place the cursor */ | ||
60 | lcd_puts(0, menus[m].cursor - menus[m].top, "-"); | ||
61 | |||
58 | lcd_update(); | 62 | lcd_update(); |
59 | } | 63 | } |
60 | 64 | ||
@@ -64,18 +68,27 @@ static void menu_draw(int m) | |||
64 | */ | 68 | */ |
65 | static void put_cursor(int m, int target) | 69 | static void put_cursor(int m, int target) |
66 | { | 70 | { |
67 | lcd_puts(0, menus[m].cursor - menus[m].top, " "); | 71 | bool do_update = true; |
72 | |||
73 | lcd_puts(0, menus[m].cursor - menus[m].top, " "); | ||
74 | menus[m].cursor = target; | ||
68 | 75 | ||
69 | if ( target < menus[m].top ) { | 76 | if ( target < menus[m].top ) { |
70 | menus[m].top--; | 77 | menus[m].top--; |
71 | menu_draw(m); | 78 | menu_draw(m); |
79 | do_update = false; | ||
72 | } | 80 | } |
73 | else if ( target-menus[m].top > MENU_LINES-1 ) { | 81 | else if ( target-menus[m].top > MENU_LINES-1 ) { |
74 | menus[m].top++; | 82 | menus[m].top++; |
75 | menu_draw(m); | 83 | menu_draw(m); |
84 | do_update = false; | ||
76 | } | 85 | } |
77 | menus[m].cursor = target; | 86 | |
78 | lcd_puts(0, menus[m].cursor - menus[m].top, "-"); | 87 | if (do_update) { |
88 | lcd_puts(0, menus[m].cursor - menus[m].top, "-"); | ||
89 | lcd_update(); | ||
90 | } | ||
91 | |||
79 | } | 92 | } |
80 | 93 | ||
81 | int menu_init(struct menu_items* mitems, int count) | 94 | int menu_init(struct menu_items* mitems, int count) |
@@ -108,7 +121,6 @@ void menu_exit(int m) | |||
108 | void menu_run(int m) | 121 | void menu_run(int m) |
109 | { | 122 | { |
110 | menu_draw(m); | 123 | menu_draw(m); |
111 | lcd_puts(0, menus[m].cursor - menus[m].top, "-"); | ||
112 | 124 | ||
113 | while(1) { | 125 | while(1) { |
114 | switch( button_get(true) ) { | 126 | switch( button_get(true) ) { |
@@ -145,7 +157,6 @@ void menu_run(int m) | |||
145 | 157 | ||
146 | /* Return to previous display state */ | 158 | /* Return to previous display state */ |
147 | menu_draw(m); | 159 | menu_draw(m); |
148 | lcd_puts(0, menus[m].cursor - menus[m].top, "-"); | ||
149 | break; | 160 | break; |
150 | 161 | ||
151 | #ifdef HAVE_RECORDER_KEYPAD | 162 | #ifdef HAVE_RECORDER_KEYPAD |