summaryrefslogtreecommitdiff
path: root/apps/gui/quickscreen.c
diff options
context:
space:
mode:
authorZakk Roberts <midk@rockbox.org>2006-04-02 10:41:16 +0000
committerZakk Roberts <midk@rockbox.org>2006-04-02 10:41:16 +0000
commit15b2eefd6b7bbea7b253d2526b0cb445af348f5e (patch)
tree0c7be5194ec195a6ec0130d115325529961ad8c3 /apps/gui/quickscreen.c
parent12e528ccd9f8764e745a4b634cc1d4f798fe44d8 (diff)
downloadrockbox-15b2eefd6b7bbea7b253d2526b0cb445af348f5e.tar.gz
rockbox-15b2eefd6b7bbea7b253d2526b0cb445af348f5e.zip
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
Diffstat (limited to 'apps/gui/quickscreen.c')
-rw-r--r--apps/gui/quickscreen.c61
1 files changed, 45 insertions, 16 deletions
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index 570907195b..0cee6fd927 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -45,44 +45,69 @@ void gui_quickscreen_init(struct gui_quickscreen * qs,
45 45
46void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display) 46void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display)
47{ 47{
48 char buffer[30]; 48 char buffer[30], line_text[40];
49 const unsigned char *option; 49 const unsigned char *option;
50 const unsigned char *title; 50 const unsigned char *title;
51 const unsigned char *left_right_title; 51 const unsigned char *left_right_title;
52 char line_text[40]; 52 int w;
53 bool statusbar = global_settings.statusbar;
53#ifdef HAS_BUTTONBAR 54#ifdef HAS_BUTTONBAR
54 display->has_buttonbar=false; 55 display->has_buttonbar=false;
55#endif 56#endif
56 gui_textarea_clear(display); 57 gui_textarea_clear(display);
57 display->setfont(FONT_SYSFIXED); 58 display->setfont(FONT_SYSFIXED);
58 left_right_title=(unsigned char *)qs->left_right_title; 59 left_right_title=(unsigned char *)qs->left_right_title;
60
59 /* Displays the icons */ 61 /* Displays the icons */
60 display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1, 8, 7, 8);
61 display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], 1, 24, 7, 8);
62 display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], 1, 40, 7, 8);
63 62
64 /* Displays the first line of text */ 63 /* Displays the first line of text */
65 option=(unsigned char *)option_select_get_text(qs->left_option, buffer, 64 option=(unsigned char *)option_select_get_text(qs->left_option, buffer,
66 sizeof buffer); 65 sizeof buffer);
67 title=(unsigned char *)qs->left_option->title; 66 title=(unsigned char *)qs->left_option->title;
68 snprintf(line_text, sizeof(line_text), "%s %s", title, left_right_title); 67 snprintf(line_text, sizeof(line_text), "%s %s", title, left_right_title);
69 display->puts_scroll(0, 0+!(global_settings.statusbar), line_text); 68 display->puts_scroll(2, !statusbar, line_text);
70 display->puts_scroll(3, 1+!(global_settings.statusbar), option); 69 display->puts_scroll(2, 1+!statusbar, option);
70 display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1, 8, 7, 8);
71 71
72 /* Displays the second line of text */ 72 /* Displays the second line of text */
73 option=(unsigned char *)option_select_get_text(qs->bottom_option, buffer,
74 sizeof buffer);
75 title=(unsigned char *)qs->bottom_option->title;
76 display->puts_scroll(0, 2+!(global_settings.statusbar), title);
77 display->puts_scroll(3, 3+!(global_settings.statusbar), option);
78
79 /* Displays the third line of text */
80 option=(unsigned char *)option_select_get_text(qs->right_option, buffer, 73 option=(unsigned char *)option_select_get_text(qs->right_option, buffer,
81 sizeof buffer); 74 sizeof buffer);
82 title=(unsigned char *)qs->right_option->title; 75 title=(unsigned char *)qs->right_option->title;
83 snprintf(line_text, sizeof(line_text), "%s %s", title, left_right_title); 76 snprintf(line_text, sizeof(line_text), "%s %s", title, left_right_title);
84 display->puts_scroll(0, 4+!(global_settings.statusbar), line_text); 77 display->getstringsize(line_text, &w, NULL);
85 display->puts_scroll(3, 5+!(global_settings.statusbar), option); 78 if(w > LCD_WIDTH-8)
79 {
80 display->puts_scroll(2, 2+!statusbar, line_text);
81 display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], 1, 24, 7, 8);
82 }
83 else
84 {
85 display->putsxy(LCD_WIDTH-w-12, 24, line_text);
86 display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], LCD_WIDTH-8, 24, 7, 8);
87 }
88 display->getstringsize(option, &w, NULL);
89 if(w > LCD_WIDTH)
90 display->puts_scroll(0, 3+!statusbar, option);
91 else
92 display->putsxy(LCD_WIDTH-w-12, 32, option);
93
94 /* Displays the third line of text */
95 option=(unsigned char *)option_select_get_text(qs->bottom_option, buffer,
96 sizeof buffer);
97 title=(unsigned char *)qs->bottom_option->title;
98
99 display->getstringsize(title, &w, NULL);
100 if(w > LCD_WIDTH)
101 display->puts_scroll(0, 4+!statusbar, line_text);
102 else
103 display->putsxy(LCD_WIDTH/2-w/2, 40, title);
104
105 display->getstringsize(option, &w, NULL);
106 if(w > LCD_WIDTH)
107 display->puts_scroll(0, 5+!statusbar, option);
108 else
109 display->putsxy(LCD_WIDTH/2-w/2, 48, option);
110 display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], LCD_WIDTH/2-4, 56, 7, 8);
86 111
87 gui_textarea_update(display); 112 gui_textarea_update(display);
88 display->setfont(FONT_UI); 113 display->setfont(FONT_UI);
@@ -127,14 +152,18 @@ bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
127 option_select_next(qs->right_option); 152 option_select_next(qs->right_option);
128 return(true); 153 return(true);
129 154
155#ifdef QUICKSCREEN_BOTTOM_INV
130 case QUICKSCREEN_BOTTOM_INV : 156 case QUICKSCREEN_BOTTOM_INV :
131 case QUICKSCREEN_BOTTOM_INV | BUTTON_REPEAT : 157 case QUICKSCREEN_BOTTOM_INV | BUTTON_REPEAT :
158#endif
132#ifdef QUICKSCREEN_RC_BOTTOM_INV 159#ifdef QUICKSCREEN_RC_BOTTOM_INV
133 case QUICKSCREEN_RC_BOTTOM_INV : 160 case QUICKSCREEN_RC_BOTTOM_INV :
134 case QUICKSCREEN_RC_BOTTOM_INV | BUTTON_REPEAT : 161 case QUICKSCREEN_RC_BOTTOM_INV | BUTTON_REPEAT :
135#endif 162#endif
163#if defined(QUICKSCREEN_RC_BOTTOM_INV) || defined(QUICKSCREEN_BOTTOM_INV)
136 option_select_prev(qs->bottom_option); 164 option_select_prev(qs->bottom_option);
137 return(true); 165 return(true);
166#endif
138 } 167 }
139 return(false); 168 return(false);
140} 169}