From 19f52488b882e883aff3d82e3315a22de4f493fe Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Fri, 19 Dec 2025 03:57:40 +0900 Subject: [PATCH 1/2] fancy things --- milsko.xml | 1 + src/core.c | 2 +- src/widget/image.c | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/milsko.xml b/milsko.xml index f7f5bae..758eb1f 100644 --- a/milsko.xml +++ b/milsko.xml @@ -526,6 +526,7 @@ + diff --git a/src/core.c b/src/core.c index 4afafb7..0ae8d4a 100644 --- a/src/core.c +++ b/src/core.c @@ -693,7 +693,7 @@ static void force_render_all(MwWidget handle) { for(i = 0; i < arrlen(handle->children); i++) { force_render_all(handle->children[i]); } - MwForceRender(handle); + if(handle->lowlevel != NULL) MwForceRender(handle); } void MwToggleDarkTheme(MwWidget handle, int toggle) { diff --git a/src/widget/image.c b/src/widget/image.c index 487521d..4995568 100644 --- a/src/widget/image.c +++ b/src/widget/image.c @@ -5,6 +5,7 @@ static int create(MwWidget handle) { MwSetInteger(handle, MwNhasBorder, 0); MwSetInteger(handle, MwNinverted, 1); + MwSetInteger(handle, MwNfillArea, 1); return 0; } @@ -23,6 +24,13 @@ static void draw(MwWidget handle) { MwDrawRect(handle, &r, base); if(px != NULL) { + if(!MwGetInteger(handle, MwNfillArea)) { + r.x = (r.width - px->common.width) / 2; + r.y = (r.height - px->common.height) / 2; + r.width = px->common.width; + r.height = px->common.height; + } + MwLLDrawPixmap(handle->lowlevel, &r, px); } From bfa0a5811ec066be64f756e88f8ba1ee4553e5a7 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Fri, 19 Dec 2025 04:38:29 +0900 Subject: [PATCH 2/2] fix --- src/widget/box.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/widget/box.c b/src/widget/box.c index e2808c4..c363e0e 100644 --- a/src/widget/box.c +++ b/src/widget/box.c @@ -58,7 +58,6 @@ static void layout(MwWidget handle) { } else { wsz = sz * n / sum; } - wsz -= Margin; MwVaApply(handle->children[i], horiz ? MwNx : MwNy, sk, /* this is what gets changed */