summaryrefslogtreecommitdiffstats
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.tar.bz2
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)
vp = list_text[screen];
vp.width = SCROLLBAR_WIDTH;
list_text[screen].width -= SCROLLBAR_WIDTH;
- if(!global_settings.scrollbar_position) /* left */
+ if(global_settings.scrollbar == SCROLLBAR_LEFT)
list_text[screen].x += SCROLLBAR_WIDTH;
vp.height = line_height *
viewport_get_nb_lines(&list_text[screen]);
vp.x = parent->x;
- if(global_settings.scrollbar_position) /* right */
+ if(global_settings.scrollbar == SCROLLBAR_RIGHT) /* right */
vp.x += list_text[screen].width;
display->set_viewport(&vp);
gui_scrollbar_draw(display, 0, 0, SCROLLBAR_WIDTH-1,
@@ -147,7 +147,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
else if (show_title)
{
/* shift everything right a bit... */
- if(!global_settings.scrollbar_position) /* left */
+ if(global_settings.scrollbar == SCROLLBAR_LEFT)
{
list_text[screen].width -= SCROLLBAR_WIDTH;
list_text[screen].x += SCROLLBAR_WIDTH;
@@ -341,13 +341,13 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list)
return ACTION_NONE;
}
/* Scroll bar */
- else if(!global_settings.scrollbar_position) /* left */
+ else if(global_settings.scrollbar == SCROLLBAR_LEFT)
return gui_synclist_touchscreen_scrollbar(gui_list, y);
}
else
{
if(x>list_text[screen].x+list_text[screen].width &&
- global_settings.scrollbar_position) /* right*/
+ global_settings.scrollbar == SCROLLBAR_RIGHT)
return gui_synclist_touchscreen_scrollbar(gui_list, y);
/* |--------------------------------------------------------|
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)
}
MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL);
MENUITEM_SETTING(scrollbar_width, &global_settings.scrollbar_width, NULL);
-MENUITEM_SETTING(scrollbar_position, &global_settings.scrollbar_position, NULL);
MENUITEM_SETTING(statusbar, &global_settings.statusbar, statusbar_callback);
#ifdef HAVE_REMOTE_LCD
MENUITEM_SETTING(remote_statusbar, &global_settings.remote_statusbar, statusbar_callback);
@@ -332,7 +331,7 @@ MENUITEM_SETTING(buttonbar, &global_settings.buttonbar, NULL);
MENUITEM_SETTING(volume_type, &global_settings.volume_type, NULL);
MENUITEM_SETTING(battery_display, &global_settings.battery_display, NULL);
MAKE_MENU(bars_menu, ID2P(LANG_BARS_MENU), 0, Icon_NOICON,
- &scrollbar_item, &scrollbar_width, &scrollbar_position, &statusbar,
+ &scrollbar_item, &scrollbar_width, &statusbar,
#ifdef HAVE_REMOTE_LCD
&remote_statusbar,
#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);
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
-#define PLUGIN_API_VERSION 168
+#define PLUGIN_API_VERSION 169
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */
-#define PLUGIN_MIN_API_VERSION 167
+#define PLUGIN_MIN_API_VERSION 169
/* plugin return codes */
enum 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 };
/* statusbar visibility/position */
enum { STATUSBAR_OFF = 0, STATUSBAR_TOP, STATUSBAR_BOTTOM };
+/* scrollbar visibility/position */
+enum { SCROLLBAR_OFF = 0, SCROLLBAR_LEFT, SCROLLBAR_RIGHT };
+
/* Alarm settings */
#ifdef HAVE_RTC_ALARM
enum { ALARM_START_WPS = 0,
@@ -560,7 +563,11 @@ struct user_settings
bool buttonbar; /* 0=hide, 1=show */
#endif
- bool scrollbar; /* 0=hide, 1=show */
+#ifdef HAVE_LCD_BITMAP
+ int scrollbar; /* SCROLLBAR_* enum values */
+ int scrollbar_width;
+#endif
+
/* goto current song when exiting WPS */
bool browse_current; /* 1=goto current song,
0=goto previous location */
@@ -768,8 +775,6 @@ struct user_settings
#ifdef HAVE_REMOTE_LCD
unsigned char remote_ui_vp_config[64]; /* viewport string for the remote lists */
#endif
- int scrollbar_width;
- bool scrollbar_position; /* false=left true=right */
#endif
#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[] = {
gui_statusbar_changed, 3, ID2P(LANG_OFF), ID2P(LANG_STATUSBAR_TOP),
ID2P(LANG_STATUSBAR_BOTTOM)),
#endif
- OFFON_SETTING(0,scrollbar, LANG_SCROLL_BAR, true, "scrollbar", NULL),
+ CHOICE_SETTING(F_TEMPVAR, scrollbar,
+ LANG_SCROLL_BAR, SCROLLBAR_LEFT, "scrollbar","off,left,right",
+ NULL, 3, ID2P(LANG_OFF), ID2P(LANG_LEFT), ID2P(LANG_RIGHT)),
INT_SETTING(0, scrollbar_width, LANG_SCROLLBAR_WIDTH, 6, "scrollbar width",
UNIT_INT, 3, LCD_WIDTH/10, 1, NULL, NULL, NULL),
- BOOL_SETTING(F_TEMPVAR, scrollbar_position, LANG_SCROLLBAR_POSITION, false,
- "scrollbar pos", "left,right", LANG_RIGHT, LANG_LEFT, NULL),
#if CONFIG_KEYPAD == RECORDER_PAD
OFFON_SETTING(0,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL),
#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 @@
\opt{remote}{
remote statusbar & off, top, bottom & N/A\\
}
- scrollbar & on, off & N/A\\
- scrollbar pos & left, right & N/A\\
+ scrollbar & off, left, right & N/A\\
scrollbar width & 3 to LCD width / 10 (\fixme{devise a way
to get ranges from config-*.h})& pixels\\
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 @@
\item[Status/Scrollbar:]
Settings related to on screen status display and the scrollbar.
\begin{description}
- \item[Scroll Bar:] Enables or disables the vertical scroll bar.
+ \item[Scroll Bar:] Allows you to choose where the vertical scroll bar
+ should appear.
\item[Scroll Bar Width:] Allows you to choose the width of the
scroll bar (in pixels). Default value is 6.
- \item[Scroll Bar Position:] Allows you to choose where the scroll bar
- should appear.
\item[Status Bar:] Allows you to choose where to display the
statusbar\opt{remote}{ on the main display}.
\opt{remote}{