forked from len0rd/rockbox
(1) Don't print on invisible lines. (2) Proper message for aborted filename input.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6443 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
68ffd8fd2f
commit
ed5b06b04c
1 changed files with 12 additions and 4 deletions
|
@ -68,6 +68,10 @@ void print(char *word, int invert) {
|
||||||
printing.position=0;
|
printing.position=0;
|
||||||
newpos=printing.position+strlen+1;
|
newpos=printing.position+strlen+1;
|
||||||
}
|
}
|
||||||
|
/* Fixme: the display code needs to keep the current item visible instead of
|
||||||
|
* just displaying the first items. */
|
||||||
|
if (printing.font_h*printing.line >= LCD_HEIGHT)
|
||||||
|
return;
|
||||||
rb->lcd_putsxy(printing.font_w*printing.position,printing.font_h*printing.line,word);
|
rb->lcd_putsxy(printing.font_w*printing.position,printing.font_h*printing.line,word);
|
||||||
if(invert)
|
if(invert)
|
||||||
rb->lcd_invertrect(printing.font_w*printing.position,printing.font_h*printing.line,printing.font_w*strlen,printing.font_h);
|
rb->lcd_invertrect(printing.font_w*printing.position,printing.font_h*printing.line,printing.font_w*strlen,printing.font_h);
|
||||||
|
@ -85,6 +89,10 @@ void print(char *word, int invert) {
|
||||||
printing.position = 0;
|
printing.position = 0;
|
||||||
newpos = printing.position + strlen + (invert ? 3 : 1);
|
newpos = printing.position + strlen + (invert ? 3 : 1);
|
||||||
}
|
}
|
||||||
|
/* Fixme: the display code needs to keep the current item visible instead of
|
||||||
|
* just displaying the first items. */
|
||||||
|
if (printing.line >= 2)
|
||||||
|
return;
|
||||||
if (invert) {
|
if (invert) {
|
||||||
rb->lcd_putc(printing.position, printing.line, MARKER_LEFT);
|
rb->lcd_putc(printing.position, printing.line, MARKER_LEFT);
|
||||||
rb->lcd_puts(printing.position + 1, printing.line, word);
|
rb->lcd_puts(printing.position + 1, printing.line, word);
|
||||||
|
@ -226,8 +234,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
databox_init();
|
databox_init();
|
||||||
filename[0] = '\0';
|
filename[0] = '\0';
|
||||||
if(rb->kbd_input(filename, sizeof filename)) {
|
if(rb->kbd_input(filename, sizeof filename)) {
|
||||||
rb->splash(HZ*2, true, "Something went wrong with the filename.. exiting..");
|
rb->splash(HZ*2, true, "Cancelled...");
|
||||||
return PLUGIN_ERROR;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
/* add / in front if omitted */
|
/* add / in front if omitted */
|
||||||
if(filename[0]!='/') {
|
if(filename[0]!='/') {
|
||||||
|
@ -278,7 +286,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BUTTON_RIGHT:
|
case BUTTON_RIGHT:
|
||||||
#ifdef BUTTON_DOWN
|
#ifdef BUTTON_UP
|
||||||
case BUTTON_UP:
|
case BUTTON_UP:
|
||||||
#endif
|
#endif
|
||||||
if (editing.selecting)
|
if (editing.selecting)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue