summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZakk Roberts <midk@rockbox.org>2006-03-12 23:45:40 +0000
committerZakk Roberts <midk@rockbox.org>2006-03-12 23:45:40 +0000
commitb1b0e42ddd03a677523c67135302393fa9f8b19c (patch)
tree121e5e02f6b8dbc84c573e738ce031983fd8b58a
parent49480c8f0c8bbed99347620df4908ce6d2284800 (diff)
downloadrockbox-b1b0e42ddd03a677523c67135302393fa9f8b19c.tar.gz
rockbox-b1b0e42ddd03a677523c67135302393fa9f8b19c.zip
Redesigned F2/F3 quick screens to put each option and its value on its own, scrolling line - fixes the problems with long strings the old design had.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9017 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/quickscreen.c57
1 files changed, 23 insertions, 34 deletions
diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c
index 6aac24f81e..570907195b 100644
--- a/apps/gui/quickscreen.c
+++ b/apps/gui/quickscreen.c
@@ -20,6 +20,7 @@
20#include "quickscreen.h" 20#include "quickscreen.h"
21#ifdef HAS_QUICKSCREEN 21#ifdef HAS_QUICKSCREEN
22 22
23#include <stdio.h>
23#include "system.h" 24#include "system.h"
24#include "icons.h" 25#include "icons.h"
25#include "textarea.h" 26#include "textarea.h"
@@ -44,56 +45,44 @@ void gui_quickscreen_init(struct gui_quickscreen * qs,
44 45
45void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display) 46void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display)
46{ 47{
47 int w,h;
48 char buffer[30]; 48 char buffer[30];
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;
52 char line_text[40];
51#ifdef HAS_BUTTONBAR 53#ifdef HAS_BUTTONBAR
52 display->has_buttonbar=false; 54 display->has_buttonbar=false;
53#endif 55#endif
54 gui_textarea_clear(display); 56 gui_textarea_clear(display);
55 display->setfont(FONT_SYSFIXED); 57 display->setfont(FONT_SYSFIXED);
56 display->getstringsize((unsigned char *)"M", NULL, &h); 58 left_right_title=(unsigned char *)qs->left_right_title;
57 /* Displays the icons */ 59 /* Displays the icons */
58 display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 60 display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1, 8, 7, 8);
59 display->width/2 - 16, 61 display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], 1, 24, 7, 8);
60 display->height/2 - 4, 7, 8); 62 display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], 1, 40, 7, 8);
61 display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], 63
62 display->width/2 - 3, 64 /* Displays the first line of text */
63 display->height - h*3, 7, 8);
64 display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
65 display->width/2 + 8,
66 display->height/2 - 4, 7, 8);
67
68 /* Displays the left's text */
69 title=(unsigned char *)qs->left_option->title;
70 option=(unsigned char *)option_select_get_text(qs->left_option, buffer, 65 option=(unsigned char *)option_select_get_text(qs->left_option, buffer,
71 sizeof buffer); 66 sizeof buffer);
72 display->putsxy(0, display->height/2 - h*2, title); 67 title=(unsigned char *)qs->left_option->title;
73 display->putsxy(0, display->height/2 - h, 68 snprintf(line_text, sizeof(line_text), "%s %s", title, left_right_title);
74 (unsigned char *)qs->left_right_title); 69 display->puts_scroll(0, 0+!(global_settings.statusbar), line_text);
75 display->putsxy(0, display->height/2, option); 70 display->puts_scroll(3, 1+!(global_settings.statusbar), option);
76 71
77 /* Displays the bottom's text */ 72 /* Displays the second line of text */
78 title=(unsigned char *)qs->bottom_option->title;
79 option=(unsigned char *)option_select_get_text(qs->bottom_option, buffer, 73 option=(unsigned char *)option_select_get_text(qs->bottom_option, buffer,
80 sizeof buffer); 74 sizeof buffer);
81 display->getstringsize(title, &w, &h); 75 title=(unsigned char *)qs->bottom_option->title;
82 display->putsxy((display->width-w)/2, display->height - h*2, title); 76 display->puts_scroll(0, 2+!(global_settings.statusbar), title);
83 display->getstringsize(option, &w, &h); 77 display->puts_scroll(3, 3+!(global_settings.statusbar), option);
84 display->putsxy((display->width-w)/2, display->height - h, option);
85 78
86 /* Displays the right's text */ 79 /* Displays the third line of text */
87 title=(unsigned char *)qs->right_option->title;
88 option=(unsigned char *)option_select_get_text(qs->right_option, buffer, 80 option=(unsigned char *)option_select_get_text(qs->right_option, buffer,
89 sizeof buffer); 81 sizeof buffer);
90 display->getstringsize(title,&w,&h); 82 title=(unsigned char *)qs->right_option->title;
91 display->putsxy(display->width - w, display->height/2 - h*2, title); 83 snprintf(line_text, sizeof(line_text), "%s %s", title, left_right_title);
92 display->getstringsize((unsigned char *)qs->left_right_title, &w, &h); 84 display->puts_scroll(0, 4+!(global_settings.statusbar), line_text);
93 display->putsxy(display->width - w, display->height/2 - h, 85 display->puts_scroll(3, 5+!(global_settings.statusbar), option);
94 (unsigned char *)qs->left_right_title);
95 display->getstringsize(option,&w,&h);
96 display->putsxy(display->width - w, display->height/2, option);
97 86
98 gui_textarea_update(display); 87 gui_textarea_update(display);
99 display->setfont(FONT_UI); 88 display->setfont(FONT_UI);
@@ -108,7 +97,7 @@ void gui_syncquickscreen_draw(struct gui_quickscreen * qs)
108 97
109bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) 98bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
110{ 99{
111 100
112 switch(button) 101 switch(button)
113 { 102 {
114 case QUICKSCREEN_LEFT : 103 case QUICKSCREEN_LEFT :