summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2023-02-14 20:10:38 +0100
committerWilliam Wilgus <me.theuser@yahoo.com>2023-02-15 22:43:33 -0500
commite7a01ca4b2d4935af8d2b4c359fd0ee4aa85f2e2 (patch)
treee20c78b84c2fa0b454cf11404d332af8a882afe7
parentff98a54cd954360be7e0770cfc987ce33447aa10 (diff)
downloadrockbox-e7a01ca4b2d4935af8d2b4c359fd0ee4aa85f2e2.tar.gz
rockbox-e7a01ca4b2d4935af8d2b4c359fd0ee4aa85f2e2.zip
usb screen: honor HAVE_LCD_SPLIT
Clip+ displays the logo with the LCD split inbetween. Calculate the y offset to be directly after the split if possible. Thanks go to William Wilgus for fixing a similar issue and pointing me to macros I was looking for. Change-Id: I2183aec1149ce74ffb840716910d2051e4a284ed
-rw-r--r--apps/gui/usb_screen.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/gui/usb_screen.c b/apps/gui/usb_screen.c
index 31321ec005..fb59f820b6 100644
--- a/apps/gui/usb_screen.c
+++ b/apps/gui/usb_screen.c
@@ -41,6 +41,7 @@
#include "skin_engine/skin_engine.h"
#include "playlist.h"
#include "misc.h"
+#include "icons.h"
#include "bitmaps/usblogo.h"
@@ -155,7 +156,24 @@ static void usb_screen_fix_viewports(struct screen *screen,
*logo = *parent;
logo->x = parent->x + parent->width - logo_width;
+#ifdef HAVE_LCD_SPLIT
+ switch (statusbar_position(screen))
+ {
+ /* start beyond split */
+ case STATUSBAR_OFF:
+ logo->y = parent->y + LCD_SPLIT_POS;
+ break;
+ case STATUSBAR_TOP:
+ logo->y = parent->y + LCD_SPLIT_POS - STATUSBAR_HEIGHT;
+ break;
+ /* start at the top for maximum space */
+ default:
+ logo->y = parent->y;
+ break;
+ }
+#else
logo->y = parent->y + (parent->height - logo_height) / 2;
+#endif
logo->width = logo_width;
logo->height = logo_height;