summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-01-12 15:11:46 +0100
committerThomas Martitz <kugel@rockbox.org>2014-01-12 15:22:29 +0100
commit3ae73433ab826c7a4f3c49b4d0a86fd9dc29a9cc (patch)
treefe285fbee6684aa0337723ac4af9280e13d8f3c9 /apps/gui/skin_engine
parent6e882b43b6242e102f4514904c57abb68ad69efe (diff)
downloadrockbox-3ae73433ab826c7a4f3c49b4d0a86fd9dc29a9cc.zip
rockbox-3ae73433ab826c7a4f3c49b4d0a86fd9dc29a9cc.tar.gz
rockbox-3ae73433ab826c7a4f3c49b4d0a86fd9dc29a9cc.tar.bz2
rockbox-3ae73433ab826c7a4f3c49b4d0a86fd9dc29a9cc.tar.xz
skin_engine: New param "noborder" for the bar tags.
By specifying this param the bar will not have a border/box. Instead the inner part that fills up is maximized on the bar area. Note that this only affects bars using foreground and background colors, not those constructed with images. Change-Id: Ib8dd49ecbaf9e16b96de840f5f365871b73d4fa4
Diffstat (limited to 'apps/gui/skin_engine')
-rwxr-xr-xapps/gui/skin_engine/skin_display.c5
-rw-r--r--apps/gui/skin_engine/skin_parser.c8
-rw-r--r--apps/gui/skin_engine/wps_internals.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 82eaa1f..137bced 100755
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -202,6 +202,11 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
flags |= INNER_NOFILL;
}
+ if (pb->noborder)
+ {
+ flags |= BORDER_NOFILL;
+ }
+
if (SKINOFFSETTOPTR(get_skin_buffer(gwps->data), pb->slider))
{
struct gui_img *img = SKINOFFSETTOPTR(get_skin_buffer(gwps->data), pb->slider);
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 1de1047..06b37d8 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -901,6 +901,7 @@ static int parse_progressbar_tag(struct skin_element* element,
pb->vp = PTRTOSKINOFFSET(skin_buffer, vp);
pb->follow_lang_direction = follow_lang_direction > 0;
pb->nofill = false;
+ pb->noborder = false;
pb->nobar = false;
pb->image = PTRTOSKINOFFSET(skin_buffer, NULL);
pb->slider = PTRTOSKINOFFSET(skin_buffer, NULL);
@@ -978,6 +979,8 @@ static int parse_progressbar_tag(struct skin_element* element,
pb->invert_fill_direction = true;
else if (!strcmp(text, "nofill"))
pb->nofill = true;
+ else if (!strcmp(text, "noborder"))
+ pb->noborder = true;
else if (!strcmp(text, "nobar"))
pb->nobar = true;
else if (!strcmp(text, "slider"))
@@ -1051,6 +1054,11 @@ static int parse_progressbar_tag(struct skin_element* element,
if (image_filename)
{
+ /* noborder is incompatible together with image. There is no border
+ * anyway. */
+ if (pb->noborder)
+ return WPS_ERROR_INVALID_PARAM;
+
pb->image = PTRTOSKINOFFSET(skin_buffer,
skin_find_item(image_filename, SKIN_FIND_IMAGE, wps_data));
if (!SKINOFFSETTOPTR(skin_buffer, pb->image)) /* load later */
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index 3396695..e7996b0 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -120,6 +120,7 @@ struct progressbar {
bool invert_fill_direction;
bool nofill;
+ bool noborder;
bool nobar;
OFFSETTYPE(struct gui_img *) slider;
bool horizontal;