mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-08 02:13:29 +00:00
improve submenu
This commit is contained in:
@@ -160,14 +160,14 @@ static void click(MwWidget handle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void mwSubMenuAppearImpl(MwWidget handle, MwMenu menu, MwPoint* point) {
|
static void mwSubMenuAppearImpl(MwWidget handle, MwMenu menu, MwPoint* point) {
|
||||||
int i, w = 0, h = 0;
|
int i, w = 0, h = 0;
|
||||||
|
MwRect rc;
|
||||||
|
MwPoint p = *point;
|
||||||
|
|
||||||
|
MwGetScreenSize(handle, &rc);
|
||||||
|
|
||||||
handle->internal = menu;
|
handle->internal = menu;
|
||||||
|
|
||||||
MwLLMakeToolWindow(handle->lowlevel);
|
|
||||||
MwLLDetach(handle->lowlevel, point);
|
|
||||||
MwLLEndStateChange(handle->lowlevel);
|
|
||||||
|
|
||||||
for(i = 0; i < arrlen(menu->sub); i++) {
|
for(i = 0; i < arrlen(menu->sub); i++) {
|
||||||
if(strcmp(menu->sub[i]->name, "----") == 0) {
|
if(strcmp(menu->sub[i]->name, "----") == 0) {
|
||||||
h += MwDefaultBorderWidth(handle) * 2 + 2;
|
h += MwDefaultBorderWidth(handle) * 2 + 2;
|
||||||
@@ -183,6 +183,16 @@ static void mwSubMenuAppearImpl(MwWidget handle, MwMenu menu, MwPoint* point) {
|
|||||||
w += 10 + 15;
|
w += 10 + 15;
|
||||||
h += 3;
|
h += 3;
|
||||||
|
|
||||||
|
MwLLMakeToolWindow(handle->lowlevel);
|
||||||
|
MwLLDetach(handle->lowlevel, &p);
|
||||||
|
|
||||||
|
if(MwGetInteger(handle, MwNy) + h > rc.height) {
|
||||||
|
MwVaApply(handle,
|
||||||
|
MwNy, rc.height - h,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
MwLLEndStateChange(handle->lowlevel);
|
||||||
|
|
||||||
MwVaApply(handle,
|
MwVaApply(handle,
|
||||||
MwNwidth, w,
|
MwNwidth, w,
|
||||||
MwNheight, h,
|
MwNheight, h,
|
||||||
|
|||||||
Reference in New Issue
Block a user