From 3c336b5e954ccef8b075f96d38ee65319ebe6242 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Thu, 9 Apr 2026 03:44:29 +0900 Subject: [PATCH] fix listbox --- src/widget/listbox.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widget/listbox.c b/src/widget/listbox.c index a4511b5..b25528f 100644 --- a/src/widget/listbox.c +++ b/src/widget/listbox.c @@ -218,7 +218,7 @@ static void frame_draw(MwWidget handle) { st = get_first_entry(handle->parent, lb); area = r.height - MwDefaultBorderWidth(handle) * 2; - ent = area / (MwTextHeight(handle, NULL, "M") + Padding) + 2; + ent = area / (MwTextHeight(handle, Font, "M") + Padding) + 2; for(i = st; i < arrlen(lb->list) && i < st + ent; i++) { int selected = MwGetInteger(handle->parent, MwNvalue) == i ? 1 : 0; @@ -318,7 +318,7 @@ static void resize(MwWidget handle) { h -= y; - if(ih <= (h / (MwTextHeight(handle, NULL, "M") + Padding))) { + if(ih <= (h / (MwTextHeight(handle, Font, "M") + Padding))) { MwLLShow(lb->vscroll->lowlevel, 0); } else { MwLLShow(lb->vscroll->lowlevel, 1); @@ -342,7 +342,7 @@ static void resize(MwWidget handle) { h -= MwDefaultBorderWidth(handle) * 2; MwVaApply(lb->vscroll, - MwNareaShown, h / (MwTextHeight(handle, NULL, "M") + Padding), + MwNareaShown, h / (MwTextHeight(handle, Font, "M") + Padding), MwNmaxValue, ih, NULL); }