diff options
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index faf03ec0f1..8f3d47a6ae 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -248,11 +248,8 @@ static int parse_image_display(struct skin_element *element, | |||
248 | id->label = label; | 248 | id->label = label; |
249 | id->offset = 0; | 249 | id->offset = 0; |
250 | id->token = NULL; | 250 | id->token = NULL; |
251 | img->using_preloaded_icons = false; | 251 | if (img->using_preloaded_icons) |
252 | if (!strcmp(img->bm.data, "__list_icons__")) | ||
253 | { | 252 | { |
254 | img->num_subimages = Icon_Last_Themeable; | ||
255 | img->using_preloaded_icons = true; | ||
256 | token->type = SKIN_TOKEN_IMAGE_DISPLAY_LISTICON; | 253 | token->type = SKIN_TOKEN_IMAGE_DISPLAY_LISTICON; |
257 | } | 254 | } |
258 | 255 | ||
@@ -317,6 +314,7 @@ static int parse_image_load(struct skin_element *element, | |||
317 | img->num_subimages = 1; | 314 | img->num_subimages = 1; |
318 | img->always_display = false; | 315 | img->always_display = false; |
319 | img->display = -1; | 316 | img->display = -1; |
317 | img->using_preloaded_icons = false; | ||
320 | 318 | ||
321 | /* save current viewport */ | 319 | /* save current viewport */ |
322 | img->vp = &curr_vp->vp; | 320 | img->vp = &curr_vp->vp; |
@@ -331,6 +329,12 @@ static int parse_image_load(struct skin_element *element, | |||
331 | if (img->num_subimages <= 0) | 329 | if (img->num_subimages <= 0) |
332 | return WPS_ERROR_INVALID_PARAM; | 330 | return WPS_ERROR_INVALID_PARAM; |
333 | } | 331 | } |
332 | |||
333 | if (!strcmp(img->bm.data, "__list_icons__")) | ||
334 | { | ||
335 | img->num_subimages = Icon_Last_Themeable; | ||
336 | img->using_preloaded_icons = true; | ||
337 | } | ||
334 | 338 | ||
335 | struct skin_token_list *item = | 339 | struct skin_token_list *item = |
336 | (struct skin_token_list *)new_skin_token_list_item(NULL, img); | 340 | (struct skin_token_list *)new_skin_token_list_item(NULL, img); |
@@ -1064,7 +1068,7 @@ static bool load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char | |||
1064 | fd = open(img_path, O_RDONLY); | 1068 | fd = open(img_path, O_RDONLY); |
1065 | if (fd < 0) | 1069 | if (fd < 0) |
1066 | return false; | 1070 | return false; |
1067 | size_t buf_size = read_bmp_file(img_path, bitmap, 0, | 1071 | size_t buf_size = read_bmp_fd(fd, bitmap, 0, |
1068 | format|FORMAT_RETURN_SIZE, NULL); | 1072 | format|FORMAT_RETURN_SIZE, NULL); |
1069 | char* imgbuf = (char*)skin_buffer_alloc(buf_size); | 1073 | char* imgbuf = (char*)skin_buffer_alloc(buf_size); |
1070 | if (!imgbuf) | 1074 | if (!imgbuf) |