summaryrefslogtreecommitdiff
path: root/apps/gui/gwps.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/gwps.c')
-rw-r--r--apps/gui/gwps.c69
1 files changed, 28 insertions, 41 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index 5426c937c0..31b1989786 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -77,19 +77,6 @@ static void gui_wps_set_disp(struct gui_wps *gui_wps, struct screen *display);
77/* connects a wps with a statusbar*/ 77/* connects a wps with a statusbar*/
78static void gui_wps_set_statusbar(struct gui_wps *gui_wps, struct gui_statusbar *statusbar); 78static void gui_wps_set_statusbar(struct gui_wps *gui_wps, struct gui_statusbar *statusbar);
79 79
80#ifdef HAVE_LCD_BITMAP
81static void gui_wps_set_margin(struct gui_wps *gwps)
82{
83 int offset = 0;
84 struct wps_data *data = gwps->data;
85 if(data->wps_sb_tag && data->show_sb_on_wps)
86 offset = STATUSBAR_HEIGHT;
87 else if ( global_settings.statusbar && !data->wps_sb_tag)
88 offset = STATUSBAR_HEIGHT;
89 gwps->display->setmargins(0, offset);
90}
91#endif
92
93static void prev_track(unsigned skip_thresh) 80static void prev_track(unsigned skip_thresh)
94{ 81{
95 if (!wps_state.id3 || (wps_state.id3->elapsed < skip_thresh*1000)) { 82 if (!wps_state.id3 || (wps_state.id3->elapsed < skip_thresh*1000)) {
@@ -152,10 +139,6 @@ long gui_wps_show(void)
152 status_set_audio(true); 139 status_set_audio(true);
153 status_set_param(false); 140 status_set_param(false);
154#else 141#else
155 FOR_NB_SCREENS(i)
156 {
157 gui_wps_set_margin(&gui_wps[i]);
158 }
159#if LCD_DEPTH > 1 142#if LCD_DEPTH > 1
160 show_wps_backdrop(); 143 show_wps_backdrop();
161#endif /* LCD_DEPTH > 1 */ 144#endif /* LCD_DEPTH > 1 */
@@ -299,12 +282,6 @@ long gui_wps_show(void)
299#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 282#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
300 show_remote_wps_backdrop(); 283 show_remote_wps_backdrop();
301#endif 284#endif
302#ifdef HAVE_LCD_BITMAP
303 FOR_NB_SCREENS(i)
304 {
305 gui_wps_set_margin(&gui_wps[i]);
306 }
307#endif
308 restore = true; 285 restore = true;
309 break; 286 break;
310 287
@@ -558,12 +535,6 @@ long gui_wps_show(void)
558#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 535#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
559 show_remote_wps_backdrop(); 536 show_remote_wps_backdrop();
560#endif 537#endif
561#ifdef HAVE_LCD_BITMAP
562 FOR_NB_SCREENS(i)
563 {
564 gui_wps_set_margin(&gui_wps[i]);
565 }
566#endif
567 restore = true; 538 restore = true;
568 break; 539 break;
569#endif /* HAVE_QUICKSCREEN */ 540#endif /* HAVE_QUICKSCREEN */
@@ -579,12 +550,6 @@ long gui_wps_show(void)
579#endif 550#endif
580 if (quick_screen_f3(BUTTON_F3)) 551 if (quick_screen_f3(BUTTON_F3))
581 return SYS_USB_CONNECTED; 552 return SYS_USB_CONNECTED;
582#ifdef HAVE_LCD_BITMAP
583 FOR_NB_SCREENS(i)
584 {
585 gui_wps_set_margin(&gui_wps[i]);
586 }
587#endif
588 restore = true; 553 restore = true;
589 break; 554 break;
590#endif /* BUTTON_F3 */ 555#endif /* BUTTON_F3 */
@@ -643,12 +608,6 @@ long gui_wps_show(void)
643#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 608#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
644 show_remote_wps_backdrop(); 609 show_remote_wps_backdrop();
645#endif 610#endif
646#ifdef HAVE_LCD_BITMAP
647 FOR_NB_SCREENS(i)
648 {
649 gui_wps_set_margin(&gui_wps[i]);
650 }
651#endif
652 restore = true; 611 restore = true;
653 break; 612 break;
654 613
@@ -812,7 +771,32 @@ void gui_sync_wps_screen_init(void)
812 FOR_NB_SCREENS(i) 771 FOR_NB_SCREENS(i)
813 gui_wps_set_disp(&gui_wps[i], &screens[i]); 772 gui_wps_set_disp(&gui_wps[i], &screens[i]);
814} 773}
774#ifdef HAVE_LCD_BITMAP
775static void statusbar_toggle_handler(void *data)
776{
777 (void)data;
778 int i;
779 bool draw = global_settings.statusbar;
815 780
781 FOR_NB_SCREENS(i)
782 {
783 struct wps_viewport *vp = &gui_wps[i].data->viewports[0];
784 if (gui_wps[i].data->wps_sb_tag)
785 draw = gui_wps[i].data->show_sb_on_wps;
786 if (!global_settings.statusbar && !draw)
787 {
788 vp->vp.y = 0;
789 vp->vp.height = screens[i].height;
790 }
791 else
792 {
793 vp->vp.y = STATUSBAR_HEIGHT;
794 vp->vp.height = screens[i].height - STATUSBAR_HEIGHT;
795 }
796 }
797}
798#endif
799
816void gui_sync_wps_init(void) 800void gui_sync_wps_init(void)
817{ 801{
818 int i; 802 int i;
@@ -826,6 +810,9 @@ void gui_sync_wps_init(void)
826 gui_wps_set_data(&gui_wps[i], &wps_datas[i]); 810 gui_wps_set_data(&gui_wps[i], &wps_datas[i]);
827 gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]); 811 gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]);
828 } 812 }
813#ifdef HAVE_LCD_BITMAP
814 add_event(STATUSBAR_TOGGLE_EVENT, false, statusbar_toggle_handler);
815#endif
829#if LCD_DEPTH > 1 816#if LCD_DEPTH > 1
830 unload_wps_backdrop(); 817 unload_wps_backdrop();
831#endif 818#endif