forked from len0rd/rockbox
Slightly change parts of the previous commit to reuse existing code, and enforce enum statusbar_values instead of just int,
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22485 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
19f44a61cf
commit
5850207d33
4 changed files with 6 additions and 18 deletions
|
|
@ -827,13 +827,7 @@ void gui_statusbar_changed( enum screen_type screen,
|
||||||
enum statusbar_values old)
|
enum statusbar_values old)
|
||||||
{
|
{
|
||||||
/* clear and update the statusbar area to remove old parts */
|
/* clear and update the statusbar area to remove old parts */
|
||||||
enum statusbar_values bar;
|
enum statusbar_values bar = statusbar_position(screen);
|
||||||
#ifdef HAVE_REMOTE_LCD
|
|
||||||
if (screen == SCREEN_REMOTE)
|
|
||||||
bar = global_settings.remote_statusbar;
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
bar = global_settings.statusbar;
|
|
||||||
|
|
||||||
struct screen *display = &screens[screen];
|
struct screen *display = &screens[screen];
|
||||||
struct viewport vp;
|
struct viewport vp;
|
||||||
|
|
@ -850,7 +844,7 @@ void gui_statusbar_changed( enum screen_type screen,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
int statusbar_position(int screen)
|
enum statusbar_values statusbar_position(int screen)
|
||||||
{
|
{
|
||||||
if (screen == SCREEN_REMOTE)
|
if (screen == SCREEN_REMOTE)
|
||||||
return global_settings.remote_statusbar;
|
return global_settings.remote_statusbar;
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ void gui_statusbar_changed(enum screen_type screen,
|
||||||
#if !defined(HAVE_REMOTE_LCD) || defined(__PCTOOL__)
|
#if !defined(HAVE_REMOTE_LCD) || defined(__PCTOOL__)
|
||||||
#define statusbar_position(a) (global_settings.statusbar)
|
#define statusbar_position(a) (global_settings.statusbar)
|
||||||
#else
|
#else
|
||||||
int statusbar_position(int screen);
|
enum statusbar_values statusbar_position(int screen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /*_GUI_STATUSBAR_H_*/
|
#endif /*_GUI_STATUSBAR_H_*/
|
||||||
|
|
|
||||||
|
|
@ -319,13 +319,7 @@ static int statusbar_callback_ex(int action,const struct menu_item_ex *this_item
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case ACTION_ENTER_MENUITEM:
|
case ACTION_ENTER_MENUITEM:
|
||||||
#ifdef HAVE_REMOTE_LCD
|
old_bar[screen] = statusbar_position(screen);
|
||||||
if (screen == SCREEN_REMOTE)
|
|
||||||
old_bar[screen] = global_settings.remote_statusbar;
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
old_bar[screen] = global_settings.statusbar;
|
|
||||||
break;
|
|
||||||
case ACTION_EXIT_MENUITEM:
|
case ACTION_EXIT_MENUITEM:
|
||||||
gui_statusbar_changed(screen, old_bar[screen]);
|
gui_statusbar_changed(screen, old_bar[screen]);
|
||||||
send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL);
|
send_event(GUI_EVENT_STATUSBAR_TOGGLE, NULL);
|
||||||
|
|
|
||||||
|
|
@ -552,9 +552,9 @@ struct user_settings
|
||||||
int volume_type; /* how volume is displayed: 0=graphic, 1=percent */
|
int volume_type; /* how volume is displayed: 0=graphic, 1=percent */
|
||||||
int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
|
int battery_display; /* how battery is displayed: 0=graphic, 1=percent */
|
||||||
bool show_icons; /* 0=hide 1=show */
|
bool show_icons; /* 0=hide 1=show */
|
||||||
int statusbar; /* STATUSBAR_* enum values */
|
enum statusbar_values statusbar; /* STATUSBAR_* enum values */
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
int remote_statusbar;
|
enum statusbar_values remote_statusbar;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_KEYPAD == RECORDER_PAD
|
#if CONFIG_KEYPAD == RECORDER_PAD
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue