summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/icon.c20
-rw-r--r--apps/gui/usb_screen.c18
2 files changed, 14 insertions, 24 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index 5684ff057c..a9075b1b0f 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -44,19 +44,11 @@
44/* We dont actually do anything with these pointers, 44/* We dont actually do anything with these pointers,
45 but they need to be grouped like this to save code 45 but they need to be grouped like this to save code
46 so storing them as void* is ok. (stops compile warning) */ 46 so storing them as void* is ok. (stops compile warning) */
47static const struct bitmap inbuilt_iconset[NB_SCREENS] = 47static const struct bitmap *inbuilt_iconset[NB_SCREENS] =
48{ 48{
49 { 49 &bm_default_icons,
50 .width = BMPWIDTH_default_icons,
51 .height = BMPHEIGHT_default_icons,
52 .data = (unsigned char*)default_icons,
53 },
54#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1) 50#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
55 { 51 &bm_remote_default_icons,
56 .width = BMPWIDTH_remote_default_icons,
57 .height = BMPHEIGHT_remote_default_icons,
58 .data = (unsigned char*)remote_default_icons,
59 },
60#endif 52#endif
61}; 53};
62 54
@@ -74,11 +66,11 @@ struct iconset {
74} iconsets[Iconset_Count][NB_SCREENS]; 66} iconsets[Iconset_Count][NB_SCREENS];
75 67
76#define ICON_HEIGHT(screen) (!iconsets[Iconset_user][screen].loaded ? \ 68#define ICON_HEIGHT(screen) (!iconsets[Iconset_user][screen].loaded ? \
77 inbuilt_iconset[screen] : iconsets[Iconset_user][screen].bmp).height \ 69 (*(inbuilt_iconset[screen])) : iconsets[Iconset_user][screen].bmp).height \
78 / Icon_Last_Themeable 70 / Icon_Last_Themeable
79 71
80#define ICON_WIDTH(screen) (!iconsets[Iconset_user][screen].loaded ? \ 72#define ICON_WIDTH(screen) (!iconsets[Iconset_user][screen].loaded ? \
81 inbuilt_iconset[screen] : iconsets[Iconset_user][screen].bmp).width 73 (*(inbuilt_iconset[screen])) : iconsets[Iconset_user][screen].bmp).width
82 74
83/* x,y in letters, not pixles */ 75/* x,y in letters, not pixles */
84void screen_put_icon(struct screen * display, 76void screen_put_icon(struct screen * display,
@@ -140,7 +132,7 @@ void screen_put_iconxy(struct screen * display,
140 } 132 }
141 else 133 else
142 { 134 {
143 iconset = &inbuilt_iconset[screen]; 135 iconset = inbuilt_iconset[screen];
144 } 136 }
145 /* add some left padding to the icons if they are on the edge */ 137 /* add some left padding to the icons if they are on the edge */
146 if (xpos == 0) 138 if (xpos == 0)
diff --git a/apps/gui/usb_screen.c b/apps/gui/usb_screen.c
index 2b7d47209b..002f4557bb 100644
--- a/apps/gui/usb_screen.c
+++ b/apps/gui/usb_screen.c
@@ -184,6 +184,12 @@ static void usb_screen_fix_viewports(struct screen *screen,
184 184
185static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar) 185static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
186{ 186{
187 static const struct bitmap* logos[NB_SCREENS] = {
188 &bm_usblogo,
189#ifdef HAVE_RE
190 &bm_remote_usblogo,
191#endif
192 };
187 FOR_NB_SCREENS(i) 193 FOR_NB_SCREENS(i)
188 { 194 {
189 struct screen *screen = &screens[i]; 195 struct screen *screen = &screens[i];
@@ -200,17 +206,9 @@ static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
200 206
201#ifdef HAVE_LCD_BITMAP 207#ifdef HAVE_LCD_BITMAP
202 screen->set_viewport(logo); 208 screen->set_viewport(logo);
203#ifdef HAVE_REMOTE_LCD 209 screen->bmp(logos[i], 0, 0);
204 if (i == SCREEN_REMOTE) 210 if (i == SCREEN_MAIN)
205 {
206 screen->bitmap(remote_usblogo, 0, 0, logo->width,
207 logo->height);
208 }
209 else
210#endif
211 { 211 {
212 screen->transparent_bitmap(usblogo, 0, 0, logo->width,
213 logo->height);
214#ifdef USB_ENABLE_HID 212#ifdef USB_ENABLE_HID
215 if (usb_hid) 213 if (usb_hid)
216 { 214 {