mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-08 02:13:29 +00:00
add MwNborderWidth
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#define MwNflat "Iflat"
|
||||
#define MwNshowArrows "IshowArrows"
|
||||
#define MwNpadding "Ipadding"
|
||||
#define MwNborderWidth "IborderWidth"
|
||||
|
||||
#define MwNtitle "Stitle"
|
||||
#define MwNtext "Stext"
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user