git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@782 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-11-22 16:34:00 +00:00
parent 2ea1e48258
commit 977d027bb0
2 changed files with 15 additions and 15 deletions

View File

@@ -281,7 +281,7 @@ static void resize(MwWidget handle) {
int w = MwGetInteger(handle, MwNwidth);
int h = MwGetInteger(handle, MwNheight);
int ih, y;
int aw;
int m = 0;
y = MwGetInteger(handle, MwNhasHeading) ? (MwTextHeight(handle, "M") + MwDefaultBorderWidth(handle) * 2) : 0;
@@ -297,9 +297,20 @@ static void resize(MwWidget handle) {
NULL);
}
ih = arrlen(lb->list);
if(ih == 0) ih = 1;
h -= y;
if(ih <= (h / MwTextHeight(handle, "M"))) {
MwLLShow(lb->vscroll->lowlevel, 0);
} else {
MwLLShow(lb->vscroll->lowlevel, 1);
m = 16;
}
if(lb->frame == NULL) {
lb->frame = MwVaCreateWidget(MwFrameClass, "frame", handle, 0, y, w - 16, h, NULL);
lb->frame = MwVaCreateWidget(MwFrameClass, "frame", handle, 0, y, w - m, h, NULL);
lb->frame->draw_inject = frame_draw;
MwAddUserHandler(lb->frame, MwNmouseDownHandler, frame_mouse_down, NULL);
MwAddUserHandler(lb->frame, MwNmouseUpHandler, frame_mouse_up, NULL);
@@ -308,27 +319,16 @@ static void resize(MwWidget handle) {
MwVaApply(lb->frame,
MwNx, 0,
MwNy, y,
MwNwidth, w - 16,
MwNwidth, w - m,
MwNheight, h,
NULL);
}
aw = w;
h -= MwDefaultBorderWidth(handle) * 2;
ih = arrlen(lb->list);
if(ih == 0) ih = 1;
MwVaApply(lb->vscroll,
MwNareaShown, h / MwTextHeight(handle, "M"),
MwNmaxValue, ih,
NULL);
if(ih <= (h / MwTextHeight(handle, "M"))) {
MwLLShow(lb->vscroll->lowlevel, 0);
MwSetInteger(lb->frame, MwNwidth, aw);
} else {
MwLLShow(lb->vscroll->lowlevel, 1);
}
}
static int create(MwWidget handle) {

View File

@@ -269,9 +269,9 @@ static void resize(MwWidget handle) {
if(ih <= (h / (LinePadding + MwTextHeight(handle, "M")))) {
MwLLShow(tv->vscroll->lowlevel, 0);
m = 16;
} else {
MwLLShow(tv->vscroll->lowlevel, 1);
m = 16;
}
if(tv->frame == NULL) {