diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/bitmap/list-skinned.c | 6 | ||||
-rw-r--r-- | apps/gui/list.h | 1 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 5 |
3 files changed, 12 insertions, 0 deletions
diff --git a/apps/gui/bitmap/list-skinned.c b/apps/gui/bitmap/list-skinned.c index 5f53784ccc..208b2df681 100644 --- a/apps/gui/bitmap/list-skinned.c +++ b/apps/gui/bitmap/list-skinned.c @@ -82,6 +82,12 @@ static int offset_to_item(int offset, bool wrap) item = item % current_list->nb_items; return item; } + +int skinlist_get_item_number() +{ + return current_drawing_line; +} + const char* skinlist_get_item_text(int offset, bool wrap, char* buf, size_t buf_size) { int item = offset_to_item(offset, wrap); diff --git a/apps/gui/list.h b/apps/gui/list.h index 7c64987abb..d40cfe9966 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h @@ -190,6 +190,7 @@ bool skinlist_is_selected_item(void); void skinlist_set_cfg(enum screen_type screen, struct listitem_viewport_cfg *cfg); const char* skinlist_get_item_text(int offset, bool wrap, char* buf, size_t buf_size); +int skinlist_get_item_number(void); enum themable_icons skinlist_get_item_icon(int offset, bool wrap); bool skinlist_needs_scrollbar(enum screen_type screen); void skinlist_get_scrollbar(int* nb_item, int* first_shown, int* last_shown); diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index fa697b18e9..7bf588080d 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -932,6 +932,11 @@ const char *get_token_value(struct gui_wps *gwps, struct listitem *li = (struct listitem *)token->value.data; return skinlist_get_item_text(li->offset, li->wrap, buf, buf_size); } + case SKIN_TOKEN_LIST_ITEM_NUMBER: + if (intval) + *intval = skinlist_get_item_number(); + snprintf(buf, buf_size, "%d",skinlist_get_item_number()); + return buf; case SKIN_TOKEN_LIST_ITEM_IS_SELECTED: return skinlist_is_selected_item()?"s":""; case SKIN_TOKEN_LIST_ITEM_ICON: |