summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine')
-rw-r--r--apps/gui/skin_engine/skin_display.c31
-rw-r--r--apps/gui/skin_engine/skin_engine.h3
-rw-r--r--apps/gui/skin_engine/wps_internals.h10
3 files changed, 39 insertions, 5 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 85cc65d410..e674c9becf 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -129,6 +129,35 @@ bool skin_update(struct gui_wps *gwps, unsigned int update_type)
129 return retval; 129 return retval;
130} 130}
131 131
132void skin_statusbar_changed(struct gui_wps *skin)
133{
134 if (!skin)
135 return;
136 struct wps_data *data = skin->data;
137 const struct screen *display = skin->display;
138
139 struct viewport *vp = &find_viewport(VP_DEFAULT_LABEL, data)->vp;
140 viewport_set_fullscreen(vp, display->screen_type);
141
142 if (data->wps_sb_tag)
143 { /* fix up the default viewport */
144 if (data->show_sb_on_wps)
145 {
146 bool bar_at_top =
147 statusbar_position(display->screen_type) != STATUSBAR_BOTTOM;
148
149 vp->y = bar_at_top?STATUSBAR_HEIGHT:0;
150 vp->height = display->lcdheight - STATUSBAR_HEIGHT;
151 }
152 else
153 {
154 vp->y = 0;
155 vp->height = display->lcdheight;
156 }
157 }
158
159
160}
132 161
133#ifdef HAVE_LCD_BITMAP 162#ifdef HAVE_LCD_BITMAP
134 163
@@ -1141,7 +1170,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode)
1141 1170
1142 if (refresh_mode & WPS_REFRESH_STATUSBAR) 1171 if (refresh_mode & WPS_REFRESH_STATUSBAR)
1143 { 1172 {
1144 gwps_draw_statusbars(); 1173 viewportmanager_set_statusbar(*gwps->statusbars);
1145 } 1174 }
1146 /* Restore the default viewport */ 1175 /* Restore the default viewport */
1147 display->set_viewport(NULL); 1176 display->set_viewport(NULL);
diff --git a/apps/gui/skin_engine/skin_engine.h b/apps/gui/skin_engine/skin_engine.h
index 3ec7b93a9d..c52f720d06 100644
--- a/apps/gui/skin_engine/skin_engine.h
+++ b/apps/gui/skin_engine/skin_engine.h
@@ -51,4 +51,7 @@ bool skin_data_load(struct wps_data *wps_data,
51 51
52/* initial setup of wps_data */ 52/* initial setup of wps_data */
53void skin_data_init(struct wps_data *wps_data); 53void skin_data_init(struct wps_data *wps_data);
54
55/* call this in statusbar toggle handlers if needed */
56void skin_statusbar_changed(struct gui_wps*);
54#endif 57#endif
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index 20a9dde9f9..fbd18b9f73 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -286,10 +286,6 @@ struct wps_data
286 unsigned int button_time_volume; 286 unsigned int button_time_volume;
287}; 287};
288 288
289
290/* Redraw statusbars if necessary */
291void gwps_draw_statusbars(void);
292
293/* Returns the index of the last subline's token in the token array. 289/* Returns the index of the last subline's token in the token array.
294 line - 0-based line number 290 line - 0-based line number
295 subline - 0-based subline number within the line 291 subline - 0-based subline number within the line
@@ -332,6 +328,12 @@ struct gui_wps
332 struct screen *display; 328 struct screen *display;
333 struct wps_data *data; 329 struct wps_data *data;
334 struct wps_state *state; 330 struct wps_state *state;
331
332 /* suitable for the viewportmanager, possibly only temporary here
333 * needs to be same for all screens! can't be split up for screens
334 * due to what viewportmanager_set_statusbar() accepts
335 * (FIXME?) */
336 int *statusbars;
335}; 337};
336 338
337/* gui_wps end */ 339/* gui_wps end */