summaryrefslogtreecommitdiff
path: root/apps/gui/icon.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/icon.c')
-rw-r--r--apps/gui/icon.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index 6a5ff708d1..74af4a0d90 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -124,6 +124,7 @@ void screen_put_iconxy(struct screen * display,
124 int screen = display->screen_type; 124 int screen = display->screen_type;
125 int width = ICON_WIDTH(screen); 125 int width = ICON_WIDTH(screen);
126 int height = ICON_HEIGHT(screen); 126 int height = ICON_HEIGHT(screen);
127 int stride;
127 screen_bitmap_part_func *draw_func = NULL; 128 screen_bitmap_part_func *draw_func = NULL;
128 129
129 if (icon == Icon_NOICON) 130 if (icon == Icon_NOICON)
@@ -142,15 +143,20 @@ void screen_put_iconxy(struct screen * display,
142 screen_put_iconxy(display, xpos, ypos, Icon_Questionmark); 143 screen_put_iconxy(display, xpos, ypos, Icon_Questionmark);
143 return; 144 return;
144 } 145 }
145 data = viewer_iconset[screen].data; 146 data = viewer_iconset[screen].data;
147 stride = STRIDE( viewer_iconset[screen].width,
148 viewer_iconset[screen].height);
146 } 149 }
147 else if (custom_icons_loaded[screen]) 150 else if (custom_icons_loaded[screen])
148 { 151 {
149 data = user_iconset[screen].data; 152 data = user_iconset[screen].data;
153 stride = STRIDE( user_iconset[screen].width,
154 user_iconset[screen].height);
150 } 155 }
151 else 156 else
152 { 157 {
153 data = inbuilt_icons[screen]; 158 data = inbuilt_icons[screen];
159 stride = STRIDE(BMPWIDTH_default_icons, BMPHEIGHT_default_icons);
154 } 160 }
155 /* add some left padding to the icons if they are on the edge */ 161 /* add some left padding to the icons if they are on the edge */
156 if (xpos == 0) 162 if (xpos == 0)
@@ -158,12 +164,12 @@ void screen_put_iconxy(struct screen * display,
158 164
159#if (LCD_DEPTH == 16) || defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH == 16) 165#if (LCD_DEPTH == 16) || defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH == 16)
160 if (display->depth == 16) 166 if (display->depth == 16)
161 draw_func = display->transparent_bitmap_part; 167 draw_func = display->transparent_bitmap_part;
162 else 168 else
163#endif 169#endif
164 draw_func = display->bitmap_part; 170 draw_func = display->bitmap_part;
165 171
166 draw_func(data, 0, height * icon, width, xpos, ypos, width, height); 172 draw_func(data, 0, height * icon, stride, xpos, ypos, width, height);
167} 173}
168 174
169void screen_put_cursorxy(struct screen * display, int x, int y, bool on) 175void screen_put_cursorxy(struct screen * display, int x, int y, bool on)