forked from len0rd/rockbox
Fixed busy loop, and implemented a simpler kind of cursor blinking that also ensures blinking always starts with 'cursor visible' after button actions. Removed redraw variable, since we now always redraw.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9757 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a1db431d50
commit
b5991b27ca
1 changed files with 109 additions and 113 deletions
|
|
@ -338,10 +338,9 @@ int kbd_input(char* text, int buflen)
|
|||
int statusbar_size = global_settings.statusbar ? STATUSBAR_HEIGHT : 0;
|
||||
unsigned short ch, tmp, hlead = 0, hvowel = 0, htail = 0;
|
||||
bool hangul = false;
|
||||
bool redraw = true;
|
||||
unsigned char *utf8;
|
||||
const unsigned char *p;
|
||||
int cur_blink = current_tick;
|
||||
bool cur_blink = true;
|
||||
#ifdef KBD_MORSE_INPUT
|
||||
bool morse_reading = false;
|
||||
unsigned char morse_code = 0;
|
||||
|
|
@ -448,8 +447,6 @@ int kbd_input(char* text, int buflen)
|
|||
{
|
||||
len_utf8 = utf8length(text);
|
||||
|
||||
if(redraw)
|
||||
{
|
||||
lcd_clear_display();
|
||||
|
||||
#ifdef KBD_MORSE_INPUT
|
||||
|
|
@ -534,14 +531,15 @@ int kbd_input(char* text, int buflen)
|
|||
|
||||
/* cursor */
|
||||
i = (curpos + 1) * text_w;
|
||||
if(cur_blink%125 > 50)
|
||||
if (cur_blink)
|
||||
lcd_vline(i, main_y, main_y + font_h-1);
|
||||
cur_blink = !cur_blink;
|
||||
|
||||
if (hangul) /* draw underbar */
|
||||
lcd_hline(curpos*text_w, (curpos+1)*text_w, main_y+font_h-1);
|
||||
cur_blink = current_tick;
|
||||
|
||||
#ifdef HAS_BUTTONBAR
|
||||
/* draw the status bar */
|
||||
/* draw the button bar */
|
||||
gui_buttonbar_set(&buttonbar, "Shift", "OK", "Del");
|
||||
gui_buttonbar_draw(&buttonbar);
|
||||
#endif
|
||||
|
|
@ -566,12 +564,8 @@ int kbd_input(char* text, int buflen)
|
|||
|
||||
gui_syncstatusbar_draw(&statusbars, true);
|
||||
lcd_update();
|
||||
}
|
||||
|
||||
/* The default action is to redraw */
|
||||
redraw = true;
|
||||
|
||||
button = button_get(false);
|
||||
button = button_get_w_tmo(HZ/2);
|
||||
#ifdef KBD_MORSE_INPUT
|
||||
if (morse_mode)
|
||||
{
|
||||
|
|
@ -940,7 +934,6 @@ int kbd_input(char* text, int buflen)
|
|||
|
||||
if (global_settings.talk_menu) /* voice UI? */
|
||||
talk_spell(text, false); /* speak revised text */
|
||||
redraw = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -953,7 +946,10 @@ int kbd_input(char* text, int buflen)
|
|||
|
||||
}
|
||||
if (button != BUTTON_NONE)
|
||||
{
|
||||
lastbutton = button;
|
||||
cur_blink = true;
|
||||
}
|
||||
}
|
||||
#ifdef HAS_BUTTONBAR
|
||||
global_settings.buttonbar=buttonbar_config;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue