use more proper term

This commit is contained in:
NishiOwO
2025-12-15 15:27:04 +09:00
parent a5cd1974e4
commit 02c21233ae
4 changed files with 18 additions and 17 deletions

View File

@@ -26,20 +26,21 @@ int main() {
box = MwVaCreateWidget(MwBoxClass, "box", window, 0, 0, 0, 0,
MwNpadding, 10,
MwNspacing, 10,
NULL);
box2 = MwVaCreateWidget(MwBoxClass, "box2", box, 0, 0, 0, 0,
MwNpadding, 10,
MwNspacing, 10,
MwNorientation, MwVERTICAL,
NULL);
box3 = MwVaCreateWidget(MwBoxClass, "box3", box, 0, 0, 0, 0,
MwNpadding, 10,
MwNspacing, 10,
MwNorientation, MwVERTICAL,
NULL);
box4 = MwVaCreateWidget(MwBoxClass, "box4", box, 0, 0, 0, 0,
MwNpadding, 10,
MwNspacing, 10,
MwNorientation, MwVERTICAL,
MwNfixedSize, 40,
NULL);

View File

@@ -34,7 +34,7 @@
#define MwNfillArea "IfillArea"
#define MwNratio "Iratio"
#define MwNfixedSize "IfixedSize"
#define MwNouterPadding "IouterPadding"
#define MwNspacing "Ispacing"
#define MwNtitle "Stitle"
#define MwNtext "Stext"

View File

@@ -86,7 +86,7 @@
<integer name="borderWidth" />
<integer name="ratio" />
<integer name="fixedSize" />
<integer name="outerPadding" />
<integer name="spacing" />
<string name="title" />
<string name="text" />
@@ -491,8 +491,8 @@
<widget name="Box">
<properties>
<property name="orientation" />
<property name="spacing" />
<property name="padding" />
<property name="outerPadding" />
</properties>
</widget>
<widget name="Button">

View File

@@ -6,8 +6,8 @@ static int create(MwWidget handle) {
MwSetDefault(handle);
MwSetInteger(handle, MwNorientation, MwHORIZONTAL);
MwSetInteger(handle, MwNspacing, 0);
MwSetInteger(handle, MwNpadding, 0);
MwSetInteger(handle, MwNouterPadding, 0);
return 0;
}
@@ -29,9 +29,9 @@ static void layout(MwWidget handle) {
int i;
int sum = 0;
int horiz = MwGetInteger(handle, MwNorientation) == MwHORIZONTAL ? 1 : 0;
int sz = MwGetInteger(handle, horiz ? MwNwidth : MwNheight) - MwGetInteger(handle, MwNouterPadding) * 2;
int fsz = MwGetInteger(handle, horiz ? MwNheight : MwNwidth) - MwGetInteger(handle, MwNouterPadding) * 2;
int sk = MwGetInteger(handle, MwNouterPadding);
int sz = MwGetInteger(handle, horiz ? MwNwidth : MwNheight) - MwGetInteger(handle, MwNpadding) * 2;
int fsz = MwGetInteger(handle, horiz ? MwNheight : MwNwidth) - MwGetInteger(handle, MwNpadding) * 2;
int sk = MwGetInteger(handle, MwNpadding);
for(i = 0; i < arrlen(handle->children); i++) {
int n = MwGetInteger(handle->children[i], MwNratio);
@@ -39,7 +39,7 @@ static void layout(MwWidget handle) {
if(n == MwDEFAULT) n = 1;
if(s != MwDEFAULT) {
sz -= s + ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNpadding) : 0);
sz -= s + ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNspacing) : 0);
} else {
sum += n;
}
@@ -56,15 +56,15 @@ static void layout(MwWidget handle) {
} else {
wsz = sz * n / sum;
}
wsz -= ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNpadding) : 0);
wsz -= ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNspacing) : 0);
MwVaApply(handle->children[i],
horiz ? MwNx : MwNy, sk, /* this is what gets changed */
horiz ? MwNy : MwNx, MwGetInteger(handle, MwNouterPadding), /* fixed between widgets */
horiz ? MwNwidth : MwNheight, wsz, /* this is what gets changed */
horiz ? MwNheight : MwNwidth, fsz, /* fixed between widgets */
horiz ? MwNx : MwNy, sk, /* this is what gets changed */
horiz ? MwNy : MwNx, MwGetInteger(handle, MwNpadding), /* fixed between widgets */
horiz ? MwNwidth : MwNheight, wsz, /* this is what gets changed */
horiz ? MwNheight : MwNwidth, fsz, /* fixed between widgets */
NULL);
sk += wsz + ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNpadding) : 0);
sk += wsz + ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNspacing) : 0);
}
}