From 68322187ffe4b6fe62f93bf56627cf9db939e2f0 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Fri, 21 Nov 2025 19:43:32 +0000 Subject: [PATCH] improvement git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@771 b9cfdab3-6d41-4d17-bbe4-086880011989 --- examples/basic/listbox.c | 2 +- src/widget/listbox.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/basic/listbox.c b/examples/basic/listbox.c index 80b6f2a..c0239a4 100644 --- a/examples/basic/listbox.c +++ b/examples/basic/listbox.c @@ -40,7 +40,7 @@ int main() { px = MwLoadIcon(lb, MwIconInfo); - MwSetInteger(lb, MwNleftPadding, 16); + MwSetInteger(lb, MwNleftPadding, 20); packet = MwListBoxCreatePacket(); index = MwListBoxPacketInsert(packet, -1); diff --git a/src/widget/listbox.c b/src/widget/listbox.c index 097e6a8..25220ea 100644 --- a/src/widget/listbox.c +++ b/src/widget/listbox.c @@ -222,9 +222,9 @@ static void frame_draw(MwWidget handle) { if(selected) { MwRect r2; - r2.x = 0; + r2.x = MwGetInteger(handle->parent, MwNleftPadding); r2.y = p.y; - r2.width = r.width; + r2.width = r.width - r2.x; r2.height = MwTextHeight(handle, "M"); MwDrawRect(handle, &r2, text2); handle->bgcolor = text2; @@ -239,7 +239,7 @@ static void frame_draw(MwWidget handle) { MwLLDrawPixmap(handle->lowlevel, &r2, lb->list[i].pixmap); } p.y += MwTextHeight(handle, "M") / 2; - p.x = MwGetInteger(handle->parent, MwNleftPadding) - MwDefaultBorderWidth(handle); + p.x = MwGetInteger(handle->parent, MwNleftPadding); for(j = 0; j < arrlen(lb->list[i].name); j++) { char* t = lb->list[i].name[j];