diff options
Diffstat (limited to 'apps/gui/usb_screen.c')
-rw-r--r-- | apps/gui/usb_screen.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/apps/gui/usb_screen.c b/apps/gui/usb_screen.c index ac31708718..f74747fd5c 100644 --- a/apps/gui/usb_screen.c +++ b/apps/gui/usb_screen.c | |||
@@ -129,10 +129,10 @@ struct usb_screen_vps_t | |||
129 | }; | 129 | }; |
130 | 130 | ||
131 | #ifdef HAVE_LCD_BITMAP | 131 | #ifdef HAVE_LCD_BITMAP |
132 | static bool usb_screen_fix_viewports(struct screen *screen, | 132 | static void usb_screen_fix_viewports(struct screen *screen, |
133 | struct usb_screen_vps_t *usb_screen_vps) | 133 | struct usb_screen_vps_t *usb_screen_vps) |
134 | { | 134 | { |
135 | bool theme_needs_undo = false; | 135 | bool disable = true; |
136 | int logo_width, logo_height; | 136 | int logo_width, logo_height; |
137 | struct viewport *parent = &usb_screen_vps->parent; | 137 | struct viewport *parent = &usb_screen_vps->parent; |
138 | struct viewport *logo = &usb_screen_vps->logo; | 138 | struct viewport *logo = &usb_screen_vps->logo; |
@@ -151,11 +151,8 @@ static bool usb_screen_fix_viewports(struct screen *screen, | |||
151 | } | 151 | } |
152 | 152 | ||
153 | viewport_set_defaults(parent, screen->screen_type); | 153 | viewport_set_defaults(parent, screen->screen_type); |
154 | if (parent->width < logo_width || parent->height < logo_height) | 154 | disable = (parent->width < logo_width || parent->height < logo_height); |
155 | { | 155 | viewportmanager_theme_enable(screen->screen_type, !disable, parent); |
156 | theme_needs_undo = true; | ||
157 | viewportmanager_theme_enable(screen->screen_type, false, parent); | ||
158 | } | ||
159 | 156 | ||
160 | *logo = *parent; | 157 | *logo = *parent; |
161 | logo->x = parent->x + parent->width - logo_width; | 158 | logo->x = parent->x + parent->width - logo_width; |
@@ -179,18 +176,12 @@ static bool usb_screen_fix_viewports(struct screen *screen, | |||
179 | } | 176 | } |
180 | } | 177 | } |
181 | #endif | 178 | #endif |
182 | return theme_needs_undo; | ||
183 | } | 179 | } |
184 | #endif | 180 | #endif |
185 | 181 | ||
186 | static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar) | 182 | static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar) |
187 | { | 183 | { |
188 | int i; | 184 | int i; |
189 | lcd_clear_display(); | ||
190 | #ifdef HAVE_LCD_REMOTE | ||
191 | lcd_remote_clear_display(); | ||
192 | #endif | ||
193 | |||
194 | FOR_NB_SCREENS(i) | 185 | FOR_NB_SCREENS(i) |
195 | { | 186 | { |
196 | struct screen *screen = &screens[i]; | 187 | struct screen *screen = &screens[i]; |
@@ -202,11 +193,8 @@ static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar) | |||
202 | #endif | 193 | #endif |
203 | 194 | ||
204 | screen->set_viewport(parent); | 195 | screen->set_viewport(parent); |
205 | #if LCD_DEPTH > 1 | ||
206 | screen->backdrop_show(BACKDROP_MAIN); | ||
207 | #endif | ||
208 | screen->backlight_on(); | ||
209 | screen->clear_viewport(); | 196 | screen->clear_viewport(); |
197 | screen->backlight_on(); | ||
210 | 198 | ||
211 | #ifdef HAVE_LCD_BITMAP | 199 | #ifdef HAVE_LCD_BITMAP |
212 | screen->set_viewport(logo); | 200 | screen->set_viewport(logo); |
@@ -240,15 +228,14 @@ static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar) | |||
240 | status_set_usb(true); | 228 | status_set_usb(true); |
241 | #endif /* HAVE_LCD_BITMAP */ | 229 | #endif /* HAVE_LCD_BITMAP */ |
242 | 230 | ||
243 | screen->update_viewport(); | ||
244 | screen->set_viewport(NULL); | 231 | screen->set_viewport(NULL); |
232 | screen->update_viewport(); | ||
245 | } | 233 | } |
246 | } | 234 | } |
247 | 235 | ||
248 | void gui_usb_screen_run(void) | 236 | void gui_usb_screen_run(void) |
249 | { | 237 | { |
250 | int i; | 238 | int i; |
251 | bool screen_theme_needs_undo[NB_SCREENS]; | ||
252 | struct usb_screen_vps_t usb_screen_vps_ar[NB_SCREENS]; | 239 | struct usb_screen_vps_t usb_screen_vps_ar[NB_SCREENS]; |
253 | #if defined HAVE_TOUCHSCREEN | 240 | #if defined HAVE_TOUCHSCREEN |
254 | enum touchscreen_mode old_mode = touchscreen_get_mode(); | 241 | enum touchscreen_mode old_mode = touchscreen_get_mode(); |
@@ -273,7 +260,7 @@ void gui_usb_screen_run(void) | |||
273 | 260 | ||
274 | screen->set_viewport(NULL); | 261 | screen->set_viewport(NULL); |
275 | #ifdef HAVE_LCD_BITMAP | 262 | #ifdef HAVE_LCD_BITMAP |
276 | screen_theme_needs_undo[i] = usb_screen_fix_viewports(screen, &usb_screen_vps_ar[i]); | 263 | usb_screen_fix_viewports(screen, &usb_screen_vps_ar[i]); |
277 | #endif | 264 | #endif |
278 | } | 265 | } |
279 | 266 | ||
@@ -320,10 +307,7 @@ void gui_usb_screen_run(void) | |||
320 | FOR_NB_SCREENS(i) | 307 | FOR_NB_SCREENS(i) |
321 | { | 308 | { |
322 | screens[i].backlight_on(); | 309 | screens[i].backlight_on(); |
323 | if(screen_theme_needs_undo[i]) | 310 | viewportmanager_theme_undo(i, false); |
324 | { | ||
325 | viewportmanager_theme_undo(i, false); | ||
326 | } | ||
327 | } | 311 | } |
328 | 312 | ||
329 | } | 313 | } |