From e57f3fd910ec4b22cdb1923adee35e80a933e726 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Thu, 11 Dec 2025 00:50:50 +0900 Subject: [PATCH] update --- include/Mw/StringDefs.h | 1 + milsko.xml | 1 + src/widget/button.c | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/include/Mw/StringDefs.h b/include/Mw/StringDefs.h index 69a747a..de8b8bb 100644 --- a/include/Mw/StringDefs.h +++ b/include/Mw/StringDefs.h @@ -45,6 +45,7 @@ #define MwNsizeHints "VsizeHints" #define MwNfont "Vfont" #define MwNboldFont "VboldFont" +#define MwNbackgroundPixmap "VbackgroundPixmap" #define MwNactivateHandler "Cactivate" /* NULL/int* (MwListBox)/void* (MwTreeView) */ #define MwNresizeHandler "Cresize" /* NULL */ diff --git a/milsko.xml b/milsko.xml index 98e0d91..5e74580 100644 --- a/milsko.xml +++ b/milsko.xml @@ -48,6 +48,7 @@ - MwNwidth - MwNheight - MwNborderWidth + - MwNbackgroundPixmap Integer properties must be prefixed with I. String properties must be prefixed with S. diff --git a/src/widget/button.c b/src/widget/button.c index d2b790a..30b2980 100644 --- a/src/widget/button.c +++ b/src/widget/button.c @@ -17,6 +17,7 @@ static void draw(MwWidget handle) { MwLLColor text = MwParseColor(handle, MwGetText(handle, MwNforeground)); const char* str = MwGetText(handle, MwNtext); MwLLPixmap px = MwGetVoid(handle, MwNpixmap); + MwLLPixmap bgpx = MwGetVoid(handle, MwNbackgroundPixmap); if(str == NULL) str = ""; @@ -34,6 +35,9 @@ static void draw(MwWidget handle) { } else { MwDrawWidgetBack(handle, &r, base, handle->pressed, 1); } + if(bgpx != NULL) { + MwLLDrawPixmap(handle->lowlevel, &r, bgpx); + } if(MwGetInteger(handle, MwNflat) && !handle->pressed) { r.x += MwDefaultBorderWidth(handle); r.y += MwDefaultBorderWidth(handle);