mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-06 17:39:45 +00:00
make it macro
This commit is contained in:
@@ -25,6 +25,8 @@ static void draw(MwWidget handle) {
|
|||||||
MwLLFreeColor(base);
|
MwLLFreeColor(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define Margin ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNmargin) : 0)
|
||||||
|
|
||||||
static void layout(MwWidget handle) {
|
static void layout(MwWidget handle) {
|
||||||
int i;
|
int i;
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
@@ -39,7 +41,7 @@ static void layout(MwWidget handle) {
|
|||||||
if(n == MwDEFAULT) n = 1;
|
if(n == MwDEFAULT) n = 1;
|
||||||
|
|
||||||
if(s != MwDEFAULT) {
|
if(s != MwDEFAULT) {
|
||||||
sz -= s + ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNmargin) : 0);
|
sz -= s + Margin;
|
||||||
} else {
|
} else {
|
||||||
sum += n;
|
sum += n;
|
||||||
}
|
}
|
||||||
@@ -56,7 +58,7 @@ static void layout(MwWidget handle) {
|
|||||||
} else {
|
} else {
|
||||||
wsz = sz * n / sum;
|
wsz = sz * n / sum;
|
||||||
}
|
}
|
||||||
wsz -= ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNmargin) : 0);
|
wsz -= Margin;
|
||||||
|
|
||||||
MwVaApply(handle->children[i],
|
MwVaApply(handle->children[i],
|
||||||
horiz ? MwNx : MwNy, sk, /* this is what gets changed */
|
horiz ? MwNx : MwNy, sk, /* this is what gets changed */
|
||||||
@@ -64,7 +66,7 @@ static void layout(MwWidget handle) {
|
|||||||
horiz ? MwNwidth : MwNheight, wsz, /* this is what gets changed */
|
horiz ? MwNwidth : MwNheight, wsz, /* this is what gets changed */
|
||||||
horiz ? MwNheight : MwNwidth, fsz, /* fixed between widgets */
|
horiz ? MwNheight : MwNwidth, fsz, /* fixed between widgets */
|
||||||
NULL);
|
NULL);
|
||||||
sk += wsz + ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNmargin) : 0);
|
sk += wsz + Margin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user