give up on rounded borders
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
IoI_xD 2026-04-14 13:34:49 -07:00
commit f22f45d5bf
15 changed files with 92 additions and 233 deletions

View file

@ -53,7 +53,7 @@ MWDECL void MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color);
* @param rect Rectangle area
* @param color Color
*/
MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int rounded);
MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color);
/*!
* @brief Draws a frame
@ -63,7 +63,7 @@ MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int
* @param invert Invert the 3D border color or not
* @warning `rect` gets changed to the area of rectangle inside
*/
MWDECL void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int rounded);
MWDECL void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert);
/*!
* @brief Does the DrawFrame/DrawRect combo used for drawing widget.
@ -96,7 +96,7 @@ MWDECL void MwDrawTriangle(MwWidget handle, MwRect* rect, MwLLColor color, int i
* @param rounded Rounded or not
* @warning `rect` gets changed to the area of rectangle inside
*/
MWDECL void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same, int rounded);
MWDECL void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same);
/*!
* @brief Creates a pixmap from image

View file

@ -606,7 +606,6 @@ int MwGetInteger(MwWidget handle, const char* key) {
#else
if(strcmp(key, MwNmodernLook) == 0) return inherit_integer(handle, key, 1);
#endif
if(strcmp(key, MwNisRounded) == 0) return inherit_integer(handle, key, 1);
if(strcmp(key, MwNdarkTheme) == 0) return inherit_integer(handle, key, 0);
if(strcmp(key, MwNuseMonospace) == 0) return inherit_integer(handle, key, 0);
}

View file

@ -11,10 +11,6 @@
#include "../external/stb_ds.h"
#define DEFAULT_ROUNDNESS 5
#define MAX_ROUNDNESS 30
#define BORDER_SMOOTHNESS 50
static int get_color_diff(MwWidget handle) {
if(MwGetInteger(handle, MwNmodernLook)) {
return 40;
@ -106,7 +102,7 @@ void MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color) {
MwLLPolygon(handle->lowlevel, p, 4, color);
}
void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int rounded) {
void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color) {
MwLLPixmap pixmap;
int y, i;
double darken = 0.;
@ -115,17 +111,18 @@ void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int rounde
unsigned long sz = 1 * rect->height * 4;
unsigned char* data = malloc(sz);
MwRect r = *rect;
int roundness = MwGetInteger(handle, MwNroundness);
double div;
if(rect->width <= 0 || rect->height <= 0) {
free(data);
return;
}
if(roundness == MwDEFAULT) roundness = DEFAULT_ROUNDNESS;
if(roundness >= MAX_ROUNDNESS) roundness = MAX_ROUNDNESS;
div = (roundness <= 10) ? 7. : 10.;
memset(data, 0, sz);
r.x += 1;
r.y += 1;
r.width -= 2;
r.height -= 2;
for(y = 0; y < rect->height; y++) {
MwLLColor col = MwLightenColor(handle, color, -darken, -darken, -darken);
int idx = y * 4;
@ -138,42 +135,18 @@ void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int rounde
}
pixmap = MwLLCreatePixmap(handle->lowlevel, data, 1, rect->height);
if(rounded && rect->height >= (roundness * 2) && rect->width >= (roundness * 2) && roundness > 0) {
for(i = 0; i < roundness; i++) {
int x = (roundness + 2);
int y = rect->y + (roundness + 2);
double point = ((i + (M_PI * 4)) / div);
r.x = (roundness + 4) - (sin(point) * roundness);
r.y = y + (cos(point) * roundness) + 1;
r.width = roundness;
r.height = (rect->height - ((r.y - rect->y) * 2) - 1);
MwLLDrawPixmap(handle->lowlevel, &r, pixmap);
r.width = x + (sin(point + 1) * roundness);
r.x = ((rect->width - (roundness + 1)) + (sin(point) * roundness)) - r.width;
MwLLDrawPixmap(handle->lowlevel, &r, pixmap);
}
r = *rect;
r.x += roundness;
r.y += 3;
r.width -= (roundness * 2) + 1;
r.height -= 6;
MwLLDrawPixmap(handle->lowlevel, &r, pixmap);
} else {
MwLLDrawPixmap(handle->lowlevel, &r, pixmap);
}
MwLLDrawPixmap(handle->lowlevel, &r, pixmap);
MwLLDestroyPixmap(pixmap);
free(data);
}
void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int rounded) {
void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert) {
int inv;
if((inv = MwGetInteger(handle, MwNforceInverted)) != MwDEFAULT && inv) invert = 1;
if(MwGetInteger(handle, MwNmodernLook)) {
MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle), 0, 0, rounded);
MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle), 0, 0);
} else {
int diff = get_color_diff(handle) / 3 * 2;
@ -181,18 +154,17 @@ void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int
int i;
int st = invert ? 1 : 0;
for(i = st; i < st + 2; i++) {
if((i % 2) == 0) MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) - 1, -diff, (handle->parent == NULL || handle->parent->lowlevel == NULL) ? 1 : 0, 0);
if((i % 2) == 1) MwDrawFrameEx(handle, rect, color, invert, 1, diff, 0, 0);
if((i % 2) == 0) MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle) - 1, -diff, (handle->parent == NULL || handle->parent->lowlevel == NULL) ? 1 : 0);
if((i % 2) == 1) MwDrawFrameEx(handle, rect, color, invert, 1, diff, 0);
}
} else {
MwDrawFrameEx(handle, rect, color, invert, 1, 0, 0, 0);
MwDrawFrameEx(handle, rect, color, invert, 1, 0, 0);
}
}
}
void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border) {
MwLLColor col;
MwBool rounded = MwGetInteger(handle, MwNroundness) != MwDEFAULT && MwGetInteger(handle, MwNisRounded) != 0;
if(rect->width <= 0 || rect->height <= 0) return;
@ -206,11 +178,11 @@ void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert
}
}
MwDrawFrame(handle, rect, color, invert, rounded);
MwDrawFrame(handle, rect, color, invert);
}
col = invert ? MwLightenColor(handle, color, -8, -8, -8) : color;
if(MwGetInteger(handle, MwNmodernLook)) {
MwDrawRectFading(handle, rect, col, rounded);
MwDrawRectFading(handle, rect, col);
} else {
MwDrawRect(handle, rect, col);
}
@ -284,55 +256,47 @@ void MwDrawDiamond(MwWidget handle, MwRect* rect, MwLLColor color, int invert) {
MwLLFreeColor(darker);
}
static void MwDrawFrameEx_simple(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same, int rounded) {
static void MwDrawFrameEx_simple(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same) {
MwPoint p[7];
int ColorDiff = get_color_diff(handle);
MwLLColor darker = MwLightenColor(handle, color, -ColorDiff * 3 / 2 + diff, -ColorDiff * 3 / 2 + diff, -ColorDiff * 3 / 2 + diff);
MwLLColor lighter = same ? MwLightenColor(handle, darker, 0, 0, 0) : MwLightenColor(handle, color, ColorDiff - diff, ColorDiff - diff, ColorDiff - diff);
int roundness = MwGetInteger(handle, MwNroundness);
p[0].x = rect->x;
p[0].y = rect->y;
if(roundness == MwDEFAULT) roundness = DEFAULT_ROUNDNESS;
if(roundness >= MAX_ROUNDNESS) roundness = MAX_ROUNDNESS;
if(!(rounded && rect->height >= (roundness * 2) && rect->width >= (roundness * 2) && roundness > 0)) {
p[0].x = rect->x;
p[0].y = rect->y;
p[1].x = rect->x + rect->width;
p[1].y = rect->y;
p[1].x = rect->x + rect->width;
p[1].y = rect->y;
p[2].x = rect->x + rect->width - border;
p[2].y = rect->y + border;
p[3].x = rect->x + border;
p[3].y = rect->y + border;
p[2].x = rect->x + rect->width - border;
p[2].y = rect->y + border;
p[3].x = rect->x + border;
p[3].y = rect->y + border;
p[4].x = rect->x + border;
p[4].y = rect->y + rect->height - border;
p[4].x = rect->x + border;
p[4].y = rect->y + rect->height - border;
p[5].x = rect->x;
p[5].y = rect->y + rect->height;
}
p[5].x = rect->x;
p[5].y = rect->y + rect->height;
MwLLPolygon(handle->lowlevel, p, 6, invert ? darker : lighter);
if(!(rounded && rect->height >= (roundness * 2) && rect->width >= (roundness * 2) && roundness > 0)) {
p[0].x = rect->x + rect->width;
p[0].y = rect->y;
p[0].x = rect->x + rect->width;
p[0].y = rect->y;
p[1].x = rect->x + rect->width - border;
p[1].y = rect->y + border;
p[1].x = rect->x + rect->width - border;
p[1].y = rect->y + border;
p[2].x = rect->x + rect->width - border;
p[2].y = rect->y + rect->height - border;
p[2].x = rect->x + rect->width - border;
p[2].y = rect->y + rect->height - border;
p[3].x = rect->x + border;
p[3].y = rect->y + rect->height - border;
p[3].x = rect->x + border;
p[3].y = rect->y + rect->height - border;
p[4].x = rect->x;
p[4].y = rect->y + rect->height;
p[4].x = rect->x;
p[4].y = rect->y + rect->height;
p[5].x = rect->x + rect->width;
p[5].y = rect->y + rect->height;
MwLLPolygon(handle->lowlevel, p, 6, invert ? lighter : darker);
}
p[5].x = rect->x + rect->width;
p[5].y = rect->y + rect->height;
MwLLPolygon(handle->lowlevel, p, 6, invert ? lighter : darker);
MwLLFreeColor(lighter);
MwLLFreeColor(darker);
@ -343,168 +307,64 @@ static void MwDrawFrameEx_simple(MwWidget handle, MwRect* rect, MwLLColor color,
rect->height -= border * 2;
}
static void frame_border_complex(MwWidget handle, MwRect* rect, MwLLColor lighter, MwLLColor darker, int invert, int border, int diff, int same, int rounded) {
static void frame_border_complex(MwWidget handle, MwRect* rect, MwLLColor lighter, MwLLColor darker, int invert, int border, int diff, int same) {
MwPoint p[7];
int roundness = MwGetInteger(handle, MwNroundness);
int i;
(void)diff;
(void)same;
if(roundness == MwDEFAULT) roundness = DEFAULT_ROUNDNESS;
if(roundness >= MAX_ROUNDNESS) roundness = MAX_ROUNDNESS;
if(rounded && rect->height >= (roundness * 4) && rect->width >= (roundness * 4) && roundness > 0) {
/* top left edge */
for(i = 0; i < BORDER_SMOOTHNESS; i += 2) {
MwPoint line[2];
double point = ((i + (M_PI * (BORDER_SMOOTHNESS / 2.))) / (BORDER_SMOOTHNESS));
int x = rect->x + (roundness + 2);
int y = rect->y + (roundness + 2);
p[0].x = rect->x;
p[0].y = rect->y;
line[0].x = x - (sin(point) * roundness);
line[0].y = y + (cos(point) * roundness);
line[1].x = x - (sin(point + 1) * roundness);
line[1].y = y + (cos(point + 1) * roundness);
MwLLLine(handle->lowlevel, line, invert ? lighter : darker);
}
p[1].x = rect->x + rect->width;
p[1].y = rect->y;
p[0].x = rect->x + roundness;
p[0].y = rect->y + border;
p[2].x = rect->x + rect->width - border;
p[2].y = rect->y + border;
p[3].x = rect->x + border;
p[3].y = rect->y + border;
p[1].x = rect->x + rect->width - border - roundness;
p[1].y = rect->y + border;
p[4].x = rect->x + border;
p[4].y = rect->y + rect->height - border;
p[2].x = rect->x + rect->width - border - roundness;
p[2].y = rect->y + border + roundness;
p[3].x = rect->x + border;
p[3].y = rect->y + border + roundness;
p[4].x = rect->x + border;
p[4].y = (rect->y + border) + rect->height - roundness;
p[5].x = rect->x + roundness;
p[5].y = (rect->y + border) + rect->height - roundness;
MwLLPolygon(handle->lowlevel, p, 6, invert ? lighter : darker);
/* top right edge */
for(i = 0; i < BORDER_SMOOTHNESS; i += 2) {
MwPoint line[2];
double point = ((i + (M_PI * (BORDER_SMOOTHNESS / 2.))) / (BORDER_SMOOTHNESS));
int x = (rect->x + rect->width) - (roundness + 2);
int y = rect->y + (roundness + 2);
double placeholder = (sin(point) * roundness);
line[0].x = x + placeholder;
line[0].y = y + (cos(point) * roundness);
line[1].x = x + (sin(point + 1) * roundness);
line[1].y = y + (cos(point + 1) * roundness);
MwLLLine(handle->lowlevel, line, invert ? lighter : darker);
}
} else {
p[0].x = rect->x;
p[0].y = rect->y;
p[1].x = rect->x + rect->width;
p[1].y = rect->y;
p[2].x = rect->x + rect->width - border;
p[2].y = rect->y + border;
p[3].x = rect->x + border;
p[3].y = rect->y + border;
p[4].x = rect->x + border;
p[4].y = rect->y + rect->height - border;
p[5].x = rect->x;
p[5].y = rect->y + rect->height;
}
p[5].x = rect->x;
p[5].y = rect->y + rect->height;
MwLLPolygon(handle->lowlevel, p, 6, invert ? lighter : darker);
if(rounded && rect->height >= (roundness * 4) && rect->width >= (roundness * 4) && roundness > 0) {
/* bottom left edge */
for(i = 0; i < BORDER_SMOOTHNESS; i += 2) {
MwPoint line[2];
double point = ((i + (M_PI * (BORDER_SMOOTHNESS / 2.))) / (BORDER_SMOOTHNESS));
int x = rect->x + (roundness + 2);
int y = (rect->y + rect->height) - (roundness + 2);
p[0].x = rect->x + rect->width;
p[0].y = rect->y;
line[0].x = x - (sin(point) * roundness);
line[0].y = y - (cos(point) * roundness);
line[1].x = x - (sin(point + 1) * roundness);
line[1].y = y - (cos(point + 1) * roundness);
MwLLLine(handle->lowlevel, line, invert ? lighter : darker);
}
p[0].x = rect->x + roundness;
p[0].y = rect->y + border + roundness;
p[1].x = rect->x + rect->width - border;
p[1].y = rect->y + border;
p[1].x = rect->x + rect->width - border;
p[1].y = rect->y + border + roundness;
p[2].x = rect->x + rect->width - border;
p[2].y = rect->y + rect->height - border;
p[2].x = rect->x + rect->width - border;
p[2].y = rect->y + rect->height - border - roundness;
p[3].x = rect->x + border;
p[3].y = rect->y + rect->height - border;
p[3].x = rect->x + rect->width - border - roundness;
p[3].y = rect->y + rect->height - border;
p[4].x = rect->x;
p[4].y = rect->y + rect->height;
p[4].x = rect->x + border + roundness;
p[4].y = rect->y + rect->height - border;
p[5].x = rect->x + roundness;
p[5].y = rect->y + rect->height - roundness;
p[6].x = rect->x + rect->width - border - roundness;
p[6].y = rect->y + rect->height - roundness;
MwLLPolygon(handle->lowlevel, p, 7, invert ? lighter : darker);
/* bottom right edge */
for(i = 0; i < BORDER_SMOOTHNESS; i += 2) {
MwPoint line[2];
double point = ((i + (M_PI * (BORDER_SMOOTHNESS / 2.))) / (BORDER_SMOOTHNESS));
int x = (rect->x + rect->width) - (roundness + 2);
int y = (rect->y + rect->height) - (roundness + 2);
line[0].x = x + (sin(point) * roundness);
line[0].y = y - (cos(point) * roundness);
line[1].x = x + (sin(point + 1) * roundness);
line[1].y = y - (cos(point + 1) * roundness);
MwLLLine(handle->lowlevel, line, invert ? lighter : darker);
}
} else {
p[0].x = rect->x + rect->width;
p[0].y = rect->y;
p[1].x = rect->x + rect->width - border;
p[1].y = rect->y + border;
p[2].x = rect->x + rect->width - border;
p[2].y = rect->y + rect->height - border;
p[3].x = rect->x + border;
p[3].y = rect->y + rect->height - border;
p[4].x = rect->x;
p[4].y = rect->y + rect->height;
p[5].x = rect->x + rect->width;
p[5].y = rect->y + rect->height;
MwLLPolygon(handle->lowlevel, p, 6, invert ? lighter : darker);
}
p[5].x = rect->x + rect->width;
p[5].y = rect->y + rect->height;
MwLLPolygon(handle->lowlevel, p, 6, invert ? lighter : darker);
}
static void MwDrawFrameEx_complex(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same, int rounded) {
static void MwDrawFrameEx_complex(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same) {
int ColorDiff = get_color_diff(handle);
MwLLColor darker = MwLightenColor(handle, color, -ColorDiff * 3 / 2 + diff, -ColorDiff * 3 / 2 + diff, -ColorDiff * 3 / 2 + diff);
MwLLColor lighter = same ? MwLightenColor(handle, darker, 0, 0, 0) : MwLightenColor(handle, color, (ColorDiff / 2) - diff, (ColorDiff / 2) - diff, (ColorDiff / 2) - diff);
MwRect r = *rect;
frame_border_complex(handle, rect, lighter, darker, invert, border, diff, same, rounded);
frame_border_complex(handle, rect, lighter, darker, invert, border, diff, same);
r.x += 1;
r.y += 1;
r.width -= 2;
r.height -= 2;
frame_border_complex(handle, &r, lighter, darker, !invert, border, diff, same, rounded);
frame_border_complex(handle, &r, lighter, darker, !invert, border, diff, same);
MwLLFreeColor(lighter);
MwLLFreeColor(darker);
@ -515,11 +375,11 @@ static void MwDrawFrameEx_complex(MwWidget handle, MwRect* rect, MwLLColor color
rect->height -= border * 2;
}
void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same, int rounded) {
void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same) {
if(MwGetInteger(handle, MwNmodernLook)) {
MwDrawFrameEx_complex(handle, rect, color, invert, border, diff, same, rounded);
MwDrawFrameEx_complex(handle, rect, color, invert, border, diff, same);
} else {
MwDrawFrameEx_simple(handle, rect, color, invert, border, diff, same, rounded);
MwDrawFrameEx_simple(handle, rect, color, invert, border, diff, same);
}
}

View file

@ -86,7 +86,7 @@ static void draw(MwWidget handle) {
r.height = MwGetInteger(handle, MwNheight);
if(MwGetInteger(handle, MwNhasBorder)) {
MwDrawFrame(handle, &r, base, MwGetInteger(handle, MwNinverted), 0);
MwDrawFrame(handle, &r, base, MwGetInteger(handle, MwNinverted));
}
MwDrawRect(handle, &r, base);

View file

@ -72,7 +72,7 @@ static void draw(MwWidget handle) {
r.y += r.height;
r.height = MwDefaultBorderWidth(handle) * 2;
MwDrawFrame(handle, &r, base, 0, 0);
MwDrawFrame(handle, &r, base, 0);
MwLLFreeColor(text);
MwLLFreeColor(base);

View file

@ -49,7 +49,7 @@ static void draw(MwWidget handle) {
int attr;
MwRect currc;
p.x = (r.width - (r.width / w * w)) / 2 + (MwGetInteger(handle, MwNisRounded) ? MwGetInteger(handle, MwNroundness) : 0);
p.x = (r.width - (r.width / w * w)) / 2;
p.y = r.height / 2;
len = (r.width - p.x * 2) / w;

View file

@ -22,7 +22,7 @@ static void draw(MwWidget handle) {
fr.y = 0;
fr.width = MwGetInteger(handle, MwNwidth);
fr.height = MwGetInteger(handle, MwNheight);
MwDrawFrame(handle, &fr, base, inverted, 0);
MwDrawFrame(handle, &fr, base, inverted);
rr.x = MwDefaultBorderWidth(handle);
rr.y = MwDefaultBorderWidth(handle);

View file

@ -20,7 +20,7 @@ static void draw(MwWidget handle) {
r.width = MwGetInteger(handle, MwNwidth);
r.height = MwGetInteger(handle, MwNheight);
if(MwGetInteger(handle, MwNhasBorder)) MwDrawFrame(handle, &r, base, MwGetInteger(handle, MwNinverted), 0);
if(MwGetInteger(handle, MwNhasBorder)) MwDrawFrame(handle, &r, base, MwGetInteger(handle, MwNinverted));
MwDrawRect(handle, &r, base);
if(px != NULL) {

View file

@ -210,7 +210,7 @@ static void frame_draw(MwWidget handle) {
p.x = MwDefaultBorderWidth(handle);
p.y = MwDefaultBorderWidth(handle);
MwDrawFrame(handle, &r, base, 1, 0);
MwDrawFrame(handle, &r, base, 1);
MwDrawRect(handle, &r, base2);
r = r2;
@ -284,7 +284,7 @@ static void frame_draw(MwWidget handle) {
handle->bgcolor = NULL;
}
MwDrawFrame(handle, &r, base, 1, 0);
MwDrawFrame(handle, &r, base, 1);
MwLLFreeColor(text2);
MwLLFreeColor(text);
@ -403,7 +403,7 @@ static void draw(MwWidget handle) {
r.y = 0;
r.width = get_col_width(lb, i);
r.height = MwDefaultBorderWidth(handle) * 2 + MwTextHeight(handle, NULL, "M");
MwDrawFrame(handle, &r, base, 0, 0);
MwDrawFrame(handle, &r, base, 0);
x += MwDefaultBorderWidth(handle);

View file

@ -100,7 +100,7 @@ static void draw(MwWidget handle) {
BEGIN_MENU_LOOP;
if(m->sub[i]->wsub != NULL || (in_area && handle->pressed)) {
MwDrawFrame(handle, &r, base, MwFALSE, 0);
MwDrawFrame(handle, &r, base, MwFALSE);
MwDrawWidgetBack(handle, &r, base, 0, MwFALSE);
}

View file

@ -23,7 +23,7 @@ static void draw(MwWidget handle) {
r.width = MwGetInteger(handle, MwNwidth);
r.height = MwGetInteger(handle, MwNheight);
MwDrawFrame(handle, &r, base, 1, 0);
MwDrawFrame(handle, &r, base, 1);
MwDrawRect(handle, &r, base);
w = MwGetInteger(handle, MwNvalue) - MwGetInteger(handle, MwNminValue);
w = w / (MwGetInteger(handle, MwNmaxValue) - MwGetInteger(handle, MwNminValue));

View file

@ -25,7 +25,7 @@ static void draw(MwWidget handle) {
r.y = (r.height - 2) / 2;
r.height = 2;
}
MwDrawFrameEx(handle, &r, base, 1, 1, 0, 0, MwGetInteger(handle, MwNmodernLook));
MwDrawFrameEx(handle, &r, base, 1, 1, 0, 0);
MwLLFreeColor(base);
}

View file

@ -59,7 +59,7 @@ static void draw(MwWidget handle) {
rc.x += MwGetInteger(handle, MwNleftPadding);
MwDrawFrameEx(handle, &rc, base, 1, 1, 0, 0, 0);
MwDrawFrameEx(handle, &rc, base, 1, 1, 0, 0);
p.y += 2 + 1;
} else {

View file

@ -64,7 +64,7 @@ static void recursion(MwWidget handle, MwTreeViewEntry* tree, MwTreeViewEntry**
const int len = 4;
MwDrawRect(handle, &r, col);
MwDrawFrame(handle, &r, base, tree->opened, 0);
MwDrawFrame(handle, &r, base, tree->opened);
if(tree->opened) {
l[0].x = r.x + (r.width - len) / 2;
l[0].y = r.y + r.height / 2;
@ -91,7 +91,7 @@ static void recursion(MwWidget handle, MwTreeViewEntry* tree, MwTreeViewEntry**
MwLLLine(handle->lowlevel, &l[0], text);
}
r = r2;
MwDrawFrame(handle, &r, base, tree->opened, 0);
MwDrawFrame(handle, &r, base, tree->opened);
if(col != base) MwLLFreeColor(col);
} else {
@ -183,7 +183,7 @@ static void frame_draw(MwWidget handle) {
p.x = MwDefaultBorderWidth(handle);
p.y = MwDefaultBorderWidth(handle);
MwDrawFrame(handle, &r, base, 1, 0);
MwDrawFrame(handle, &r, base, 1);
MwDrawRect(handle, &r, base2);
r = r2;
@ -193,7 +193,7 @@ static void frame_draw(MwWidget handle) {
recursion(handle, tv->tree[i], tv->tree, base, text, base2, text2, &p, 0, LineSpace, &skip, &shared, 1, NULL);
}
MwDrawFrame(handle, &r, base, 1, 0);
MwDrawFrame(handle, &r, base, 1);
MwLLFreeColor(text2);
MwLLFreeColor(text);

View file

@ -18,7 +18,7 @@ static void draw(MwWidget handle) {
r.width = MwGetInteger(handle, MwNwidth);
r.height = MwGetInteger(handle, MwNheight);
if(MwGetInteger(handle, MwNhasBorder)) MwDrawFrame(handle, &r, c, MwGetInteger(handle, MwNinverted), 0);
if(MwGetInteger(handle, MwNhasBorder)) MwDrawFrame(handle, &r, c, MwGetInteger(handle, MwNinverted));
MwDrawRect(handle, &r, c);