summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Levin <al.le@rockbox.org>2009-08-19 12:36:40 +0000
committerAlexander Levin <al.le@rockbox.org>2009-08-19 12:36:40 +0000
commit07d0bfd1016f589ddfd5307775ddda3437d04c6f (patch)
treef10ddef1b9d2b213ace5796936f3e0aace43552e
parent3943ab07502b51604a5813088ace8ae6e00cb764 (diff)
downloadrockbox-07d0bfd1016f589ddfd5307775ddda3437d04c6f.tar.gz
rockbox-07d0bfd1016f589ddfd5307775ddda3437d04c6f.zip
Combine the settings for scrollbar on/off and its position into one with three possible values
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22425 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/bitmap/list.c10
-rw-r--r--apps/menus/display_menu.c3
-rw-r--r--apps/plugin.h4
-rw-r--r--apps/settings.h11
-rw-r--r--apps/settings_list.c6
-rw-r--r--manual/appendix/config_file_options.tex3
-rw-r--r--manual/configure_rockbox/display_options.tex5
7 files changed, 22 insertions, 20 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index bc7bb876c9..4e3fae804a 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -130,12 +130,12 @@ void list_draw(struct screen *display, struct gui_synclist *list)
130 vp = list_text[screen]; 130 vp = list_text[screen];
131 vp.width = SCROLLBAR_WIDTH; 131 vp.width = SCROLLBAR_WIDTH;
132 list_text[screen].width -= SCROLLBAR_WIDTH; 132 list_text[screen].width -= SCROLLBAR_WIDTH;
133 if(!global_settings.scrollbar_position) /* left */ 133 if(global_settings.scrollbar == SCROLLBAR_LEFT)
134 list_text[screen].x += SCROLLBAR_WIDTH; 134 list_text[screen].x += SCROLLBAR_WIDTH;
135 vp.height = line_height * 135 vp.height = line_height *
136 viewport_get_nb_lines(&list_text[screen]); 136 viewport_get_nb_lines(&list_text[screen]);
137 vp.x = parent->x; 137 vp.x = parent->x;
138 if(global_settings.scrollbar_position) /* right */ 138 if(global_settings.scrollbar == SCROLLBAR_RIGHT) /* right */
139 vp.x += list_text[screen].width; 139 vp.x += list_text[screen].width;
140 display->set_viewport(&vp); 140 display->set_viewport(&vp);
141 gui_scrollbar_draw(display, 0, 0, SCROLLBAR_WIDTH-1, 141 gui_scrollbar_draw(display, 0, 0, SCROLLBAR_WIDTH-1,
@@ -147,7 +147,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
147 else if (show_title) 147 else if (show_title)
148 { 148 {
149 /* shift everything right a bit... */ 149 /* shift everything right a bit... */
150 if(!global_settings.scrollbar_position) /* left */ 150 if(global_settings.scrollbar == SCROLLBAR_LEFT)
151 { 151 {
152 list_text[screen].width -= SCROLLBAR_WIDTH; 152 list_text[screen].width -= SCROLLBAR_WIDTH;
153 list_text[screen].x += SCROLLBAR_WIDTH; 153 list_text[screen].x += SCROLLBAR_WIDTH;
@@ -341,13 +341,13 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list)
341 return ACTION_NONE; 341 return ACTION_NONE;
342 } 342 }
343 /* Scroll bar */ 343 /* Scroll bar */
344 else if(!global_settings.scrollbar_position) /* left */ 344 else if(global_settings.scrollbar == SCROLLBAR_LEFT)
345 return gui_synclist_touchscreen_scrollbar(gui_list, y); 345 return gui_synclist_touchscreen_scrollbar(gui_list, y);
346 } 346 }
347 else 347 else
348 { 348 {
349 if(x>list_text[screen].x+list_text[screen].width && 349 if(x>list_text[screen].x+list_text[screen].width &&
350 global_settings.scrollbar_position) /* right*/ 350 global_settings.scrollbar == SCROLLBAR_RIGHT)
351 return gui_synclist_touchscreen_scrollbar(gui_list, y); 351 return gui_synclist_touchscreen_scrollbar(gui_list, y);
352 352
353 /* |--------------------------------------------------------| 353 /* |--------------------------------------------------------|
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
index a98a3d51b0..24e36e5fca 100644
--- a/apps/menus/display_menu.c
+++ b/apps/menus/display_menu.c
@@ -321,7 +321,6 @@ static int statusbar_callback(int action,const struct menu_item_ex *this_item)
321} 321}
322MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL); 322MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL);
323MENUITEM_SETTING(scrollbar_width, &global_settings.scrollbar_width, NULL); 323MENUITEM_SETTING(scrollbar_width, &global_settings.scrollbar_width, NULL);
324MENUITEM_SETTING(scrollbar_position, &global_settings.scrollbar_position, NULL);
325MENUITEM_SETTING(statusbar, &global_settings.statusbar, statusbar_callback); 324MENUITEM_SETTING(statusbar, &global_settings.statusbar, statusbar_callback);
326#ifdef HAVE_REMOTE_LCD 325#ifdef HAVE_REMOTE_LCD
327MENUITEM_SETTING(remote_statusbar, &global_settings.remote_statusbar, statusbar_callback); 326MENUITEM_SETTING(remote_statusbar, &global_settings.remote_statusbar, statusbar_callback);
@@ -332,7 +331,7 @@ MENUITEM_SETTING(buttonbar, &global_settings.buttonbar, NULL);
332MENUITEM_SETTING(volume_type, &global_settings.volume_type, NULL); 331MENUITEM_SETTING(volume_type, &global_settings.volume_type, NULL);
333MENUITEM_SETTING(battery_display, &global_settings.battery_display, NULL); 332MENUITEM_SETTING(battery_display, &global_settings.battery_display, NULL);
334MAKE_MENU(bars_menu, ID2P(LANG_BARS_MENU), 0, Icon_NOICON, 333MAKE_MENU(bars_menu, ID2P(LANG_BARS_MENU), 0, Icon_NOICON,
335 &scrollbar_item, &scrollbar_width, &scrollbar_position, &statusbar, 334 &scrollbar_item, &scrollbar_width, &statusbar,
336#ifdef HAVE_REMOTE_LCD 335#ifdef HAVE_REMOTE_LCD
337 &remote_statusbar, 336 &remote_statusbar,
338#endif 337#endif
diff --git a/apps/plugin.h b/apps/plugin.h
index b873cbf6ef..4df4ba9065 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -133,12 +133,12 @@ void* plugin_get_buffer(size_t *buffer_size);
133#define PLUGIN_MAGIC 0x526F634B /* RocK */ 133#define PLUGIN_MAGIC 0x526F634B /* RocK */
134 134
135/* increase this every time the api struct changes */ 135/* increase this every time the api struct changes */
136#define PLUGIN_API_VERSION 168 136#define PLUGIN_API_VERSION 169
137 137
138/* update this to latest version if a change to the api struct breaks 138/* update this to latest version if a change to the api struct breaks
139 backwards compatibility (and please take the opportunity to sort in any 139 backwards compatibility (and please take the opportunity to sort in any
140 new function which are "waiting" at the end of the function table) */ 140 new function which are "waiting" at the end of the function table) */
141#define PLUGIN_MIN_API_VERSION 167 141#define PLUGIN_MIN_API_VERSION 169
142 142
143/* plugin return codes */ 143/* plugin return codes */
144enum plugin_status { 144enum plugin_status {
diff --git a/apps/settings.h b/apps/settings.h
index 9ba3c182c3..c45e3b3110 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -159,6 +159,9 @@ enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL };
159/* statusbar visibility/position */ 159/* statusbar visibility/position */
160enum { STATUSBAR_OFF = 0, STATUSBAR_TOP, STATUSBAR_BOTTOM }; 160enum { STATUSBAR_OFF = 0, STATUSBAR_TOP, STATUSBAR_BOTTOM };
161 161
162/* scrollbar visibility/position */
163enum { SCROLLBAR_OFF = 0, SCROLLBAR_LEFT, SCROLLBAR_RIGHT };
164
162/* Alarm settings */ 165/* Alarm settings */
163#ifdef HAVE_RTC_ALARM 166#ifdef HAVE_RTC_ALARM
164enum { ALARM_START_WPS = 0, 167enum { ALARM_START_WPS = 0,
@@ -560,7 +563,11 @@ struct user_settings
560 bool buttonbar; /* 0=hide, 1=show */ 563 bool buttonbar; /* 0=hide, 1=show */
561#endif 564#endif
562 565
563 bool scrollbar; /* 0=hide, 1=show */ 566#ifdef HAVE_LCD_BITMAP
567 int scrollbar; /* SCROLLBAR_* enum values */
568 int scrollbar_width;
569#endif
570
564 /* goto current song when exiting WPS */ 571 /* goto current song when exiting WPS */
565 bool browse_current; /* 1=goto current song, 572 bool browse_current; /* 1=goto current song,
566 0=goto previous location */ 573 0=goto previous location */
@@ -768,8 +775,6 @@ struct user_settings
768#ifdef HAVE_REMOTE_LCD 775#ifdef HAVE_REMOTE_LCD
769 unsigned char remote_ui_vp_config[64]; /* viewport string for the remote lists */ 776 unsigned char remote_ui_vp_config[64]; /* viewport string for the remote lists */
770#endif 777#endif
771 int scrollbar_width;
772 bool scrollbar_position; /* false=left true=right */
773#endif 778#endif
774 779
775#if CONFIG_CODEC == SWCODEC 780#if CONFIG_CODEC == SWCODEC
diff --git a/apps/settings_list.c b/apps/settings_list.c
index b43e9ce4ed..a9cfd79952 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -609,11 +609,11 @@ const struct settings_list settings[] = {
609 gui_statusbar_changed, 3, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP), 609 gui_statusbar_changed, 3, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
610 ID2P(LANG_STATUSBAR_BOTTOM)), 610 ID2P(LANG_STATUSBAR_BOTTOM)),
611#endif 611#endif
612 OFFON_SETTING(0,scrollbar, LANG_SCROLL_BAR, true, "scrollbar", NULL), 612 CHOICE_SETTING(F_TEMPVAR, scrollbar,
613 LANG_SCROLL_BAR, SCROLLBAR_LEFT, "scrollbar","off,left,right",
614 NULL, 3, ID2P(LANG_OFF), ID2P(LANG_LEFT), ID2P(LANG_RIGHT)),
613 INT_SETTING(0, scrollbar_width, LANG_SCROLLBAR_WIDTH, 6, "scrollbar width", 615 INT_SETTING(0, scrollbar_width, LANG_SCROLLBAR_WIDTH, 6, "scrollbar width",
614 UNIT_INT, 3, LCD_WIDTH/10, 1, NULL, NULL, NULL), 616 UNIT_INT, 3, LCD_WIDTH/10, 1, NULL, NULL, NULL),
615 BOOL_SETTING(F_TEMPVAR, scrollbar_position, LANG_SCROLLBAR_POSITION, false,
616 "scrollbar pos", "left,right", LANG_RIGHT, LANG_LEFT, NULL),
617#if CONFIG_KEYPAD == RECORDER_PAD 617#if CONFIG_KEYPAD == RECORDER_PAD
618 OFFON_SETTING(0,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL), 618 OFFON_SETTING(0,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL),
619#endif 619#endif
diff --git a/manual/appendix/config_file_options.tex b/manual/appendix/config_file_options.tex
index 4e4ae3ff58..3ac20bb203 100644
--- a/manual/appendix/config_file_options.tex
+++ b/manual/appendix/config_file_options.tex
@@ -234,8 +234,7 @@
234 \opt{remote}{ 234 \opt{remote}{
235 remote statusbar & off, top, bottom & N/A\\ 235 remote statusbar & off, top, bottom & N/A\\
236 } 236 }
237 scrollbar & on, off & N/A\\ 237 scrollbar & off, left, right & N/A\\
238 scrollbar pos & left, right & N/A\\
239 scrollbar width & 3 to LCD width / 10 (\fixme{devise a way 238 scrollbar width & 3 to LCD width / 10 (\fixme{devise a way
240 to get ranges from config-*.h})& pixels\\ 239 to get ranges from config-*.h})& pixels\\
241 volume display 240 volume display
diff --git a/manual/configure_rockbox/display_options.tex b/manual/configure_rockbox/display_options.tex
index 300dbcd6fc..7468025ee2 100644
--- a/manual/configure_rockbox/display_options.tex
+++ b/manual/configure_rockbox/display_options.tex
@@ -196,11 +196,10 @@
196 \item[Status/Scrollbar:] 196 \item[Status/Scrollbar:]
197 Settings related to on screen status display and the scrollbar. 197 Settings related to on screen status display and the scrollbar.
198 \begin{description} 198 \begin{description}
199 \item[Scroll Bar:] Enables or disables the vertical scroll bar. 199 \item[Scroll Bar:] Allows you to choose where the vertical scroll bar
200 should appear.
200 \item[Scroll Bar Width:] Allows you to choose the width of the 201 \item[Scroll Bar Width:] Allows you to choose the width of the
201 scroll bar (in pixels). Default value is 6. 202 scroll bar (in pixels). Default value is 6.
202 \item[Scroll Bar Position:] Allows you to choose where the scroll bar
203 should appear.
204 \item[Status Bar:] Allows you to choose where to display the 203 \item[Status Bar:] Allows you to choose where to display the
205 statusbar\opt{remote}{ on the main display}. 204 statusbar\opt{remote}{ on the main display}.
206 \opt{remote}{ 205 \opt{remote}{