Updated quickscreens, now they look better than before while still retaining the ability to scroll - this is about as good as it gets until viewports are implemented. Also enabled the quickscreen for iPods.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9421 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Zakk Roberts 2006-04-02 10:41:16 +00:00
parent 12e528ccd9
commit 15b2eefd6b
6 changed files with 81 additions and 26 deletions

View file

@ -569,8 +569,9 @@ long gui_wps_show(void)
break; break;
#endif #endif
#if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) \ #if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) ||\
|| (CONFIG_KEYPAD == IRIVER_H300_PAD) (CONFIG_KEYPAD == IRIVER_H300_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) ||\
(CONFIG_KEYPAD == IPOD_4G_PAD)
/* play settings */ /* play settings */
case WPS_QUICK: case WPS_QUICK:
#ifdef WPS_RC_QUICK #ifdef WPS_RC_QUICK

View file

@ -194,6 +194,7 @@
#define WPS_BROWSE_PRE BUTTON_SELECT #define WPS_BROWSE_PRE BUTTON_SELECT
#define WPS_EXIT (BUTTON_PLAY | BUTTON_REPEAT) #define WPS_EXIT (BUTTON_PLAY | BUTTON_REPEAT)
#define WPS_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT) #define WPS_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
#define WPS_QUICK (BUTTON_MENU | BUTTON_REPEAT)
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD

View file

@ -45,44 +45,69 @@ void gui_quickscreen_init(struct gui_quickscreen * qs,
void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display) void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display)
{ {
char buffer[30]; char buffer[30], line_text[40];
const unsigned char *option; const unsigned char *option;
const unsigned char *title; const unsigned char *title;
const unsigned char *left_right_title; const unsigned char *left_right_title;
char line_text[40]; int w;
bool statusbar = global_settings.statusbar;
#ifdef HAS_BUTTONBAR #ifdef HAS_BUTTONBAR
display->has_buttonbar=false; display->has_buttonbar=false;
#endif #endif
gui_textarea_clear(display); gui_textarea_clear(display);
display->setfont(FONT_SYSFIXED); display->setfont(FONT_SYSFIXED);
left_right_title=(unsigned char *)qs->left_right_title; left_right_title=(unsigned char *)qs->left_right_title;
/* Displays the icons */ /* Displays the icons */
display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1, 8, 7, 8);
display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], 1, 24, 7, 8);
display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], 1, 40, 7, 8);
/* Displays the first line of text */ /* Displays the first line of text */
option=(unsigned char *)option_select_get_text(qs->left_option, buffer, option=(unsigned char *)option_select_get_text(qs->left_option, buffer,
sizeof buffer); sizeof buffer);
title=(unsigned char *)qs->left_option->title; title=(unsigned char *)qs->left_option->title;
snprintf(line_text, sizeof(line_text), "%s %s", title, left_right_title); snprintf(line_text, sizeof(line_text), "%s %s", title, left_right_title);
display->puts_scroll(0, 0+!(global_settings.statusbar), line_text); display->puts_scroll(2, !statusbar, line_text);
display->puts_scroll(3, 1+!(global_settings.statusbar), option); display->puts_scroll(2, 1+!statusbar, option);
display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1, 8, 7, 8);
/* Displays the second line of text */ /* Displays the second line of text */
option=(unsigned char *)option_select_get_text(qs->bottom_option, buffer,
sizeof buffer);
title=(unsigned char *)qs->bottom_option->title;
display->puts_scroll(0, 2+!(global_settings.statusbar), title);
display->puts_scroll(3, 3+!(global_settings.statusbar), option);
/* Displays the third line of text */
option=(unsigned char *)option_select_get_text(qs->right_option, buffer, option=(unsigned char *)option_select_get_text(qs->right_option, buffer,
sizeof buffer); sizeof buffer);
title=(unsigned char *)qs->right_option->title; title=(unsigned char *)qs->right_option->title;
snprintf(line_text, sizeof(line_text), "%s %s", title, left_right_title); snprintf(line_text, sizeof(line_text), "%s %s", title, left_right_title);
display->puts_scroll(0, 4+!(global_settings.statusbar), line_text); display->getstringsize(line_text, &w, NULL);
display->puts_scroll(3, 5+!(global_settings.statusbar), option); if(w > LCD_WIDTH-8)
{
display->puts_scroll(2, 2+!statusbar, line_text);
display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], 1, 24, 7, 8);
}
else
{
display->putsxy(LCD_WIDTH-w-12, 24, line_text);
display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], LCD_WIDTH-8, 24, 7, 8);
}
display->getstringsize(option, &w, NULL);
if(w > LCD_WIDTH)
display->puts_scroll(0, 3+!statusbar, option);
else
display->putsxy(LCD_WIDTH-w-12, 32, option);
/* Displays the third line of text */
option=(unsigned char *)option_select_get_text(qs->bottom_option, buffer,
sizeof buffer);
title=(unsigned char *)qs->bottom_option->title;
display->getstringsize(title, &w, NULL);
if(w > LCD_WIDTH)
display->puts_scroll(0, 4+!statusbar, line_text);
else
display->putsxy(LCD_WIDTH/2-w/2, 40, title);
display->getstringsize(option, &w, NULL);
if(w > LCD_WIDTH)
display->puts_scroll(0, 5+!statusbar, option);
else
display->putsxy(LCD_WIDTH/2-w/2, 48, option);
display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], LCD_WIDTH/2-4, 56, 7, 8);
gui_textarea_update(display); gui_textarea_update(display);
display->setfont(FONT_UI); display->setfont(FONT_UI);
@ -127,14 +152,18 @@ bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
option_select_next(qs->right_option); option_select_next(qs->right_option);
return(true); return(true);
#ifdef QUICKSCREEN_BOTTOM_INV
case QUICKSCREEN_BOTTOM_INV : case QUICKSCREEN_BOTTOM_INV :
case QUICKSCREEN_BOTTOM_INV | BUTTON_REPEAT : case QUICKSCREEN_BOTTOM_INV | BUTTON_REPEAT :
#endif
#ifdef QUICKSCREEN_RC_BOTTOM_INV #ifdef QUICKSCREEN_RC_BOTTOM_INV
case QUICKSCREEN_RC_BOTTOM_INV : case QUICKSCREEN_RC_BOTTOM_INV :
case QUICKSCREEN_RC_BOTTOM_INV | BUTTON_REPEAT : case QUICKSCREEN_RC_BOTTOM_INV | BUTTON_REPEAT :
#endif #endif
#if defined(QUICKSCREEN_RC_BOTTOM_INV) || defined(QUICKSCREEN_BOTTOM_INV)
option_select_prev(qs->bottom_option); option_select_prev(qs->bottom_option);
return(true); return(true);
#endif
} }
return(false); return(false);
} }

View file

@ -19,7 +19,8 @@
#include "button.h" #include "button.h"
#include "config.h" #include "config.h"
#if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) ||\ #if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) ||\
(CONFIG_KEYPAD == IRIVER_H300_PAD) (CONFIG_KEYPAD == IRIVER_H300_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD) ||\
(CONFIG_KEYPAD == IPOD_3G_PAD)
#ifndef _GUI_QUICKSCREEN_H_ #ifndef _GUI_QUICKSCREEN_H_
#define _GUI_QUICKSCREEN_H_ #define _GUI_QUICKSCREEN_H_
@ -30,10 +31,17 @@
#include "screen_access.h" #include "screen_access.h"
#define QUICKSCREEN_LEFT BUTTON_LEFT #define QUICKSCREEN_LEFT BUTTON_LEFT
#define QUICKSCREEN_BOTTOM BUTTON_DOWN
#define QUICKSCREEN_BOTTOM_INV BUTTON_UP
#define QUICKSCREEN_RIGHT BUTTON_RIGHT #define QUICKSCREEN_RIGHT BUTTON_RIGHT
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) ||\
(CONFIG_KEYPAD == RECORDER_PAD)
#define QUICKSCREEN_BOTTOM BUTTON_DOWN
#define QUICKSCREEN_BOTTOM_INV BUTTON_UP
#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD)
#define QUICKSCREEN_BOTTOM BUTTON_PLAY
#define QUICKSCREEN_QUIT BUTTON_MENU
#define QUICKSCREEN_QUIT2 BUTTON_SELECT
#endif
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
#define QUICKSCREEN_QUIT BUTTON_MODE #define QUICKSCREEN_QUIT BUTTON_MODE

View file

@ -461,7 +461,8 @@ bool pitch_screen(void)
#endif #endif
#if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) ||\ #if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) ||\
(CONFIG_KEYPAD == IRIVER_H300_PAD) (CONFIG_KEYPAD == IRIVER_H300_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD) ||\
(CONFIG_KEYPAD == IPOD_3G_PAD)
#define bool_to_int(b)\ #define bool_to_int(b)\
b?1:0 b?1:0
#define int_to_bool(i)\ #define int_to_bool(i)\
@ -480,6 +481,12 @@ bool quick_screen_quick(int button_enter)
struct option_select left_option; struct option_select left_option;
struct option_select bottom_option; struct option_select bottom_option;
struct option_select right_option; struct option_select right_option;
int old_x_margin, old_y_margin;
old_x_margin = lcd_getxmargin();
old_y_margin = lcd_getymargin();
lcd_setmargins(0, 0);
static const struct opt_items left_items[] = { static const struct opt_items left_items[] = {
[0]={ STR(LANG_OFF) }, [0]={ STR(LANG_OFF) },
[1]={ STR(LANG_ON) } [1]={ STR(LANG_ON) }
@ -541,6 +548,7 @@ bool quick_screen_quick(int button_enter)
} }
settings_save(); settings_save();
} }
lcd_setmargins(old_x_margin, old_y_margin);
return(res); return(res);
} }
@ -563,6 +571,12 @@ bool quick_screen_f3(int button_enter)
struct option_select left_option; struct option_select left_option;
struct option_select bottom_option; struct option_select bottom_option;
struct option_select right_option; struct option_select right_option;
int old_x_margin, old_y_margin;
old_x_margin = lcd_getxmargin();
old_y_margin = lcd_getymargin();
lcd_setmargins(0, 0);
static const struct opt_items onoff_items[] = { static const struct opt_items onoff_items[] = {
[0]={ STR(LANG_OFF) }, [0]={ STR(LANG_OFF) },
[1]={ STR(LANG_ON) } [1]={ STR(LANG_ON) }
@ -594,6 +608,7 @@ bool quick_screen_f3(int button_enter)
res=gui_syncquickscreen_run(&qs, button_enter); res=gui_syncquickscreen_run(&qs, button_enter);
if(!res) if(!res)
settings_save(); settings_save();
lcd_setmargins(old_x_margin, old_y_margin);
return(res); return(res);
} }
#endif /* BUTTON_F3 */ #endif /* BUTTON_F3 */

View file

@ -129,6 +129,7 @@
#define TREE_WPS (BUTTON_PLAY | BUTTON_REL) #define TREE_WPS (BUTTON_PLAY | BUTTON_REL)
#define TREE_WPS_PRE BUTTON_PLAY #define TREE_WPS_PRE BUTTON_PLAY
#define TREE_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT) #define TREE_CONTEXT (BUTTON_SELECT | BUTTON_REPEAT)
#define TREE_QUICK (BUTTON_MENU | BUTTON_REPEAT)
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD