diff --git a/src/widget/button.c b/src/widget/button.c index 30b2980..a484eea 100644 --- a/src/widget/button.c +++ b/src/widget/button.c @@ -35,9 +35,7 @@ static void draw(MwWidget handle) { } else { MwDrawWidgetBack(handle, &r, base, handle->pressed, 1); } - if(bgpx != NULL) { - MwLLDrawPixmap(handle->lowlevel, &r, bgpx); - } + if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx); if(MwGetInteger(handle, MwNflat) && !handle->pressed) { r.x += MwDefaultBorderWidth(handle); r.y += MwDefaultBorderWidth(handle); diff --git a/src/widget/checkbox.c b/src/widget/checkbox.c index 2f6df54..0a117a4 100644 --- a/src/widget/checkbox.c +++ b/src/widget/checkbox.c @@ -9,8 +9,9 @@ static int create(MwWidget handle) { } static void draw(MwWidget handle) { - MwRect r; - MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); + MwRect r; + MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); + MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); r.x = 0; r.y = 0; @@ -18,6 +19,7 @@ static void draw(MwWidget handle) { r.height = MwGetInteger(handle, MwNheight); MwDrawWidgetBack(handle, &r, base, (handle->pressed || MwGetInteger(handle, MwNchecked)) ? 1 : 0, MwTRUE); + if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx); if(handle->pressed || MwGetInteger(handle, MwNchecked)) { /* TODO: write check mark */ } diff --git a/src/widget/entry.c b/src/widget/entry.c index e863760..b5ac1e0 100644 --- a/src/widget/entry.c +++ b/src/widget/entry.c @@ -25,6 +25,7 @@ static void draw(MwWidget handle) { MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwLLColor text = MwParseColor(handle, MwGetText(handle, MwNforeground)); const char* str = MwGetText(handle, MwNtext); + MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); if(str == NULL) str = ""; r.x = 0; @@ -33,6 +34,7 @@ static void draw(MwWidget handle) { r.height = MwGetInteger(handle, MwNheight); MwDrawWidgetBack(handle, &r, base, 1, 1); + if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx); if(str != NULL) { int w = MwTextWidth(handle, "M"); int h = MwTextHeight(handle, "M"); diff --git a/src/widget/frame.c b/src/widget/frame.c index b2f3ad0..38ff990 100644 --- a/src/widget/frame.c +++ b/src/widget/frame.c @@ -10,10 +10,11 @@ static int create(MwWidget handle) { } static void draw(MwWidget handle) { - MwRect fr; - MwRect rr; - MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); - int inverted; + MwRect fr; + MwRect rr; + MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); + int inverted; + MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); if(MwGetInteger(handle, MwNhasBorder)) { inverted = MwGetInteger(handle, MwNinverted); @@ -36,6 +37,7 @@ static void draw(MwWidget handle) { } MwDrawRect(handle, &rr, base); + if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &rr, bgpx); MwLLFreeColor(base); } diff --git a/src/widget/label.c b/src/widget/label.c index 4305662..f26edd0 100644 --- a/src/widget/label.c +++ b/src/widget/label.c @@ -14,7 +14,8 @@ static void draw(MwWidget handle) { MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); MwLLColor text = MwParseColor(handle, MwGetText(handle, MwNforeground)); int align; - const char* str = MwGetText(handle, MwNtext); + const char* str = MwGetText(handle, MwNtext); + MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); if(str == NULL) str = ""; @@ -24,6 +25,7 @@ static void draw(MwWidget handle) { r.height = MwGetInteger(handle, MwNheight); MwDrawRect(handle, &r, base); + if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx); align = MwGetInteger(handle, MwNalignment); if(align == MwALIGNMENT_CENTER) { diff --git a/src/widget/progressbar.c b/src/widget/progressbar.c index db57851..f3f99eb 100644 --- a/src/widget/progressbar.c +++ b/src/widget/progressbar.c @@ -12,10 +12,11 @@ static int create(MwWidget handle) { } static void draw(MwWidget handle) { - MwRect r; - MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); - MwLLColor fill = MwParseColor(handle, MwGetText(handle, MwNforeground)); - double w; + MwRect r; + MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); + MwLLColor fill = MwParseColor(handle, MwGetText(handle, MwNforeground)); + double w; + MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); r.x = 0; r.y = 0; @@ -26,6 +27,7 @@ static void draw(MwWidget handle) { MwDrawRect(handle, &r, base); w = MwGetInteger(handle, MwNvalue) - MwGetInteger(handle, MwNminValue); w = w / (MwGetInteger(handle, MwNmaxValue) - MwGetInteger(handle, MwNminValue)); + if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx); r.x += MwDefaultBorderWidth(handle); r.y += MwDefaultBorderWidth(handle); diff --git a/src/widget/radiobox.c b/src/widget/radiobox.c index 681949a..85c7871 100644 --- a/src/widget/radiobox.c +++ b/src/widget/radiobox.c @@ -11,8 +11,9 @@ static int create(MwWidget handle) { } static void draw(MwWidget handle) { - MwRect r; - MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); + MwRect r; + MwLLColor base = MwParseColor(handle, MwGetText(handle, MwNbackground)); + MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); r.x = 0; r.y = 0; @@ -20,6 +21,7 @@ static void draw(MwWidget handle) { r.height = MwGetInteger(handle, MwNheight); MwDrawRect(handle, &r, base); + if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx); MwDrawDiamond(handle, &r, base, (handle->pressed || MwGetInteger(handle, MwNchecked)) ? 1 : 0); MwLLFreeColor(base); diff --git a/src/widget/scrollbar.c b/src/widget/scrollbar.c index 6490b06..e00d0b5 100644 --- a/src/widget/scrollbar.c +++ b/src/widget/scrollbar.c @@ -65,7 +65,8 @@ static void draw(MwWidget handle) { MwLLColor dark = MwLightenColor(handle, base, -64, -64, -64); scrollbar_t* scr = handle->internal; int or ; - int uy, dy, ux, dx; + int uy, dy, ux, dx; + MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); r.x = 0; r.y = 0; @@ -79,6 +80,7 @@ static void draw(MwWidget handle) { dx = r.width - r.height; MwDrawWidgetBack(handle, &r, dark, 1, MwTRUE); + if(bgpx != NULL) MwLLDrawPixmap(handle->lowlevel, &r, bgpx); rt = r;