diff options
Diffstat (limited to 'apps/gui/icon.c')
-rw-r--r-- | apps/gui/icon.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c index a473c82872..e57ad29f6d 100644 --- a/apps/gui/icon.c +++ b/apps/gui/icon.c | |||
@@ -122,10 +122,11 @@ void screen_put_iconxy(struct screen * display, | |||
122 | int xpos, int ypos, enum themable_icons icon) | 122 | int xpos, int ypos, enum themable_icons icon) |
123 | { | 123 | { |
124 | const void *data; | 124 | const void *data; |
125 | int screen = display->screen_type; | 125 | const int screen = display->screen_type; |
126 | int width = ICON_WIDTH(screen); | 126 | const int width = ICON_WIDTH(screen); |
127 | int height = ICON_HEIGHT(screen); | 127 | const int height = ICON_HEIGHT(screen); |
128 | int stride; | 128 | int stride; |
129 | const struct bitmap *iconset; | ||
129 | screen_bitmap_part_func *draw_func = NULL; | 130 | screen_bitmap_part_func *draw_func = NULL; |
130 | 131 | ||
131 | if (icon == Icon_NOICON) | 132 | if (icon == Icon_NOICON) |
@@ -135,24 +136,23 @@ void screen_put_iconxy(struct screen * display, | |||
135 | } | 136 | } |
136 | else if (icon >= Icon_Last_Themeable) | 137 | else if (icon >= Icon_Last_Themeable) |
137 | { | 138 | { |
139 | iconset = &viewer_iconset[screen]; | ||
138 | icon -= Icon_Last_Themeable; | 140 | icon -= Icon_Last_Themeable; |
139 | if (!viewer_icons_loaded[screen] || | 141 | if (!viewer_icons_loaded[screen] || |
140 | (global_status.viewer_icon_count*height | 142 | (global_status.viewer_icon_count * height > iconset->height) || |
141 | > viewer_iconset[screen].height) || | 143 | (icon * height > iconset->height)) |
142 | (icon * height > viewer_iconset[screen].height)) | ||
143 | { | 144 | { |
144 | screen_put_iconxy(display, xpos, ypos, Icon_Questionmark); | 145 | screen_put_iconxy(display, xpos, ypos, Icon_Questionmark); |
145 | return; | 146 | return; |
146 | } | 147 | } |
147 | data = viewer_iconset[screen].data; | 148 | data = iconset->data; |
148 | stride = STRIDE( display->screen_type, viewer_iconset[screen].width, | 149 | stride = STRIDE(display->screen_type, iconset->width, iconset->height); |
149 | viewer_iconset[screen].height); | ||
150 | } | 150 | } |
151 | else if (custom_icons_loaded[screen]) | 151 | else if (custom_icons_loaded[screen]) |
152 | { | 152 | { |
153 | data = user_iconset[screen].data; | 153 | iconset = &user_iconset[screen]; |
154 | stride = STRIDE( display->screen_type, user_iconset[screen].width, | 154 | data = iconset->data; |
155 | user_iconset[screen].height); | 155 | stride = STRIDE(display->screen_type, iconset->width, iconset->height); |
156 | } | 156 | } |
157 | else | 157 | else |
158 | { | 158 | { |
@@ -163,7 +163,10 @@ void screen_put_iconxy(struct screen * display, | |||
163 | /* add some left padding to the icons if they are on the edge */ | 163 | /* add some left padding to the icons if they are on the edge */ |
164 | if (xpos == 0) | 164 | if (xpos == 0) |
165 | xpos++; | 165 | xpos++; |
166 | 166 | ||
167 | if (lang_is_rtl()) | ||
168 | xpos = display->getwidth() - xpos - width; | ||
169 | |||
167 | #if (LCD_DEPTH == 16) || defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH == 16) | 170 | #if (LCD_DEPTH == 16) || defined(LCD_REMOTE_DEPTH) && (LCD_REMOTE_DEPTH == 16) |
168 | if (display->depth == 16) | 171 | if (display->depth == 16) |
169 | draw_func = display->transparent_bitmap_part; | 172 | draw_func = display->transparent_bitmap_part; |
@@ -171,8 +174,6 @@ void screen_put_iconxy(struct screen * display, | |||
171 | #endif | 174 | #endif |
172 | draw_func = display->bitmap_part; | 175 | draw_func = display->bitmap_part; |
173 | 176 | ||
174 | if (lang_is_rtl()) | ||
175 | xpos = display->getwidth() - xpos - width; | ||
176 | draw_func(data, 0, height * icon, stride, xpos, ypos, width, height); | 177 | draw_func(data, 0, height * icon, stride, xpos, ypos, width, height); |
177 | } | 178 | } |
178 | 179 | ||