more proper term

This commit is contained in:
NishiOwO
2025-12-15 15:41:19 +09:00
parent 02c21233ae
commit 3e4001e4f1
4 changed files with 11 additions and 11 deletions

View File

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

View File

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

View File

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

View File

@@ -6,7 +6,7 @@ static int create(MwWidget handle) {
MwSetDefault(handle); MwSetDefault(handle);
MwSetInteger(handle, MwNorientation, MwHORIZONTAL); MwSetInteger(handle, MwNorientation, MwHORIZONTAL);
MwSetInteger(handle, MwNspacing, 0); MwSetInteger(handle, MwNmargin, 0);
MwSetInteger(handle, MwNpadding, 0); MwSetInteger(handle, MwNpadding, 0);
return 0; return 0;
@@ -39,7 +39,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, MwNspacing) : 0); sz -= s + ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNmargin) : 0);
} else { } else {
sum += n; sum += n;
} }
@@ -56,7 +56,7 @@ static void layout(MwWidget handle) {
} else { } else {
wsz = sz * n / sum; wsz = sz * n / sum;
} }
wsz -= ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNspacing) : 0); wsz -= ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNmargin) : 0);
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 +64,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, MwNspacing) : 0); sk += wsz + ((i != (arrlen(handle->children) - 1)) ? MwGetInteger(handle, MwNmargin) : 0);
} }
} }