add MwNborderWidth

This commit is contained in:
NishiOwO
2025-12-07 05:32:58 +09:00
parent 14cf131528
commit a0b3ecb697
5 changed files with 15 additions and 4 deletions

View File

@@ -30,6 +30,7 @@
#define MwNflat "Iflat"
#define MwNshowArrows "IshowArrows"
#define MwNpadding "Ipadding"
#define MwNborderWidth "IborderWidth"
#define MwNtitle "Stitle"
#define MwNtext "Stext"

View File

@@ -47,6 +47,7 @@
- MwNy
- MwNwidth
- MwNheight
- MwNborderWidth
Integer properties must be prefixed with I.
String properties must be prefixed with S.
@@ -79,6 +80,7 @@
<integer name="flat" />
<integer name="showArrows" />
<integer name="padding" />
<integer name="borderWidth" />
<string name="title" />
<string name="text" />

View File

@@ -374,9 +374,9 @@ void MwSetText(MwWidget handle, const char* key, const char* value) {
if(shgeti(handle->text, key) != -1) free(shget(handle->text, key));
if(value != NULL){
if(value != NULL) {
shput(handle->text, key, v);
}else{
} else {
shdel(handle->text, key);
}
}

View File

@@ -11,6 +11,10 @@ const char* MwDefaultDarkSubBackground = "#333";
const char* MwDefaultDarkSubForeground = "#ddd";
int MwDefaultBorderWidth(MwWidget handle) {
int bw = MwGetInteger(handle, MwNborderWidth);
if(bw != MwDEFAULT) return bw;
if(MwGetInteger(handle, MwNmodernLook)) {
return 1;
} else {

View File

@@ -131,8 +131,12 @@ void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert) {
} else {
int diff = get_color_diff(handle) / 3 * 2;
MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) / 2, -diff, (handle->parent == NULL || handle->parent->lowlevel == NULL) ? 1 : 0);
MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) / 2, diff, 0);
if(MwDefaultBorderWidth(handle) >= 2) {
MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) - 1, -diff, (handle->parent == NULL || handle->parent->lowlevel == NULL) ? 1 : 0);
MwDrawFrameEx(handle, rect, color, invert, 1, diff, 0);
} else {
MwDrawFrameEx(handle, rect, color, invert, 1, 0, 0);
}
}
}