background pixmap

This commit is contained in:
Nishi 2025-12-11 01:37:13 +09:00
commit 363897df74
Signed by: nishi
GPG key ID: 27EF69B208EB9343
8 changed files with 29 additions and 17 deletions

View file

@ -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");