From 8d7016367e8f2f40b9d91899250e1999fa1a5304 Mon Sep 17 00:00:00 2001 From: IoI_xD Date: Thu, 26 Mar 2026 14:40:21 -0700 Subject: [PATCH] experimental rounded corners idea --- include/Mw/Draw.h | 6 +- include/Mw/LowLevel.h | 9 +- include/Mw/LowLevel/Wayland.h | 3 + src/backend/wayland.c | 3 + src/draw.c | 232 ++++++++++++++++++++++++++++------ src/widget/box.c | 2 +- src/widget/combobox.c | 2 +- src/widget/frame.c | 2 +- src/widget/image.c | 2 +- src/widget/listbox.c | 6 +- src/widget/menu.c | 2 +- src/widget/progressbar.c | 2 +- src/widget/separator.c | 2 +- src/widget/submenu.c | 2 +- src/widget/treeview.c | 8 +- src/widget/window.c | 2 +- 16 files changed, 223 insertions(+), 62 deletions(-) diff --git a/include/Mw/Draw.h b/include/Mw/Draw.h index b90d4e4..4fb74c2 100644 --- a/include/Mw/Draw.h +++ b/include/Mw/Draw.h @@ -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); +MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int rounded); /*! * @brief Draws a frame @@ -63,7 +63,7 @@ MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color); * @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); +MWDECL void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int rounded); /*! * @brief Does the DrawFrame/DrawRect combo used for drawing widget. @@ -95,7 +95,7 @@ MWDECL void MwDrawTriangle(MwWidget handle, MwRect* rect, MwLLColor color, int i * @param same Same as dark color * @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); +MWDECL void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same, int rounded); /*! * @brief Creates a pixmap from image diff --git a/include/Mw/LowLevel.h b/include/Mw/LowLevel.h index 9766d05..d7ddb4b 100644 --- a/include/Mw/LowLevel.h +++ b/include/Mw/LowLevel.h @@ -34,10 +34,11 @@ enum MwLLBackends { }; struct _MwLLCommon { - void* user; - int copy_buffer; - int type; - int coordinate_type; + void* user; + int copy_buffer; + int type; + int coordinate_type; + MwBool supports_transparency; MwLLHandler handler; }; diff --git a/include/Mw/LowLevel/Wayland.h b/include/Mw/LowLevel/Wayland.h index c24ce3c..de7828a 100644 --- a/include/Mw/LowLevel/Wayland.h +++ b/include/Mw/LowLevel/Wayland.h @@ -123,6 +123,7 @@ typedef struct wayland_call_table { void (*cairo_fill)(cairo_t* cr); void (*cairo_pattern_set_filter)(cairo_pattern_t* pattern, cairo_filter_t filter); + void (*cairo_set_antialias)(cairo_t*, cairo_antialias_t); } wayland_call_table_t; @@ -201,6 +202,7 @@ MwInline int wayland_load_funcs() { CAIRO_FUNC(cairo_rectangle); CAIRO_FUNC(cairo_new_path); CAIRO_FUNC(cairo_set_line_cap); + CAIRO_FUNC(cairo_set_antialias); CAIRO_FUNC(cairo_set_source_rgba); CAIRO_FUNC(cairo_set_source_rgb); CAIRO_FUNC(cairo_reset_clip); @@ -257,6 +259,7 @@ MwInline int wayland_load_funcs() { #define cairo_rectangle wl_call_tbl.cairo_rectangle #define cairo_new_path wl_call_tbl.cairo_new_path #define cairo_set_line_cap wl_call_tbl.cairo_set_line_cap +#define cairo_set_antialias wl_call_tbl.cairo_set_antialias #define cairo_set_source_rgba wl_call_tbl.cairo_set_source_rgba #define cairo_set_source_rgb wl_call_tbl.cairo_set_source_rgb #define cairo_reset_clip wl_call_tbl.cairo_reset_clip diff --git a/src/backend/wayland.c b/src/backend/wayland.c index 5ba779b..f747955 100644 --- a/src/backend/wayland.c +++ b/src/backend/wayland.c @@ -1972,6 +1972,9 @@ static void MwLLPolygonImpl(MwLL handle, MwPoint* points, int points_count, MwLL static void MwLLLineImpl(MwLL handle, MwPoint* points, MwLLColor color) { int i; + clip(handle); + + cairo_set_antialias(handle->wayland.front_cairo, CAIRO_ANTIALIAS_NONE); cairo_set_line_cap(handle->wayland.front_cairo, CAIRO_LINE_CAP_SQUARE); cairo_set_source_rgb(handle->wayland.front_cairo, color->common.red / 255.0, color->common.green / 255.0, color->common.blue / 255.0); cairo_new_path(handle->wayland.front_cairo); diff --git a/src/draw.c b/src/draw.c index 4286d66..2746237 100644 --- a/src/draw.c +++ b/src/draw.c @@ -11,9 +11,12 @@ #include "../external/stb_ds.h" +#define BORDER_ROUNDNESS 10 +#define BORDER_SMOOTHNESS 50 + static int get_color_diff(MwWidget handle) { if(MwGetInteger(handle, MwNmodernLook)) { - return 46; + return 23; } else { return 80; } @@ -29,7 +32,7 @@ static int hex(const char* txt, int len) { n = c - 'a' + 10; } else if('A' <= c && c <= 'F') { n = c - 'A' + 10; - } else if('0' <= c && c <= '9') { + } else if('0' <= c && c <= 'g') { n = c - '0'; } r = r << 4; @@ -102,14 +105,15 @@ void MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color) { MwLLPolygon(handle->lowlevel, p, 4, color); } -void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color) { +void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int rounded) { MwLLPixmap pixmap; - int y; + int y, i; double darken = 0.; int ColorDiff = get_color_diff(handle); double darkenStep = (ColorDiff / 4.) / rect->height; unsigned long sz = 1 * rect->height * 4; unsigned char* data = malloc(sz); + MwRect r = *rect; memset(data, 0, sz); for(y = 0; y < rect->height; y++) { @@ -124,18 +128,64 @@ void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color) { } pixmap = MwLLCreatePixmap(handle->lowlevel, data, 1, rect->height); - MwLLDrawPixmap(handle->lowlevel, rect, pixmap); + if(rounded && rect->height >= (BORDER_ROUNDNESS * 2) && rect->width >= (BORDER_ROUNDNESS * 2)) { + int xt; + int x = rect->x + (BORDER_ROUNDNESS + 1); + int y = rect->y + (BORDER_ROUNDNESS + 1); + for(i = 0; i < BORDER_ROUNDNESS; i++) { + double point = ((i + (M_PI * 4)) / 7.); + double point2 = (((i + 1) + (M_PI * 4)) / 7.); + int x2 = x - (sin(point2) * BORDER_ROUNDNESS); + r.x = x - (sin(point) * BORDER_ROUNDNESS); + r.y = y + (cos(point) * BORDER_ROUNDNESS); + r.width = (x - (sin(point + 1) * BORDER_ROUNDNESS)) - r.x; + r.height = (rect->height - ((r.y - rect->y) * 2) - 1); + MwLLDrawPixmap(handle->lowlevel, &r, pixmap); + for(xt = x; xt < x2; xt++) { + r.x = xt; + r.y = y + (cos(point2) * BORDER_ROUNDNESS); + r.height = (rect->height - ((r.y - rect->y)) - 1); + MwLLDrawPixmap(handle->lowlevel, &r, pixmap); + } + } + r = *rect; + r.x += BORDER_ROUNDNESS; + r.width -= (BORDER_ROUNDNESS * 2); + r.height -= 1; + MwLLDrawPixmap(handle->lowlevel, &r, pixmap); + r = *rect; + x = (rect->x + rect->width) - (BORDER_ROUNDNESS + 2); + y = rect->y + (BORDER_ROUNDNESS + 1); + for(i = 0; i < BORDER_ROUNDNESS; i++) { + double point = ((i + (M_PI * 4)) / 7.); + double point2 = (((i + 1) + (M_PI * 4)) / 7.); + int x2 = x + (sin(point2) * BORDER_ROUNDNESS); + r.x = x + (sin(point) * BORDER_ROUNDNESS); + r.y = y + (cos(point) * BORDER_ROUNDNESS); + r.width = 1; + r.height = (rect->height - ((r.y - rect->y) * 2) - 1); + MwLLDrawPixmap(handle->lowlevel, &r, pixmap); + for(xt = x; xt < x2; xt++) { + r.x = xt; + r.y = y + (cos(point2) * BORDER_ROUNDNESS); + r.height = (rect->height - ((r.y - rect->y) * 2) - 2); + MwLLDrawPixmap(handle->lowlevel, &r, pixmap); + } + } + } else { + MwLLDrawPixmap(handle->lowlevel, &r, pixmap); + } MwLLDestroyPixmap(pixmap); free(data); } -void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert) { +void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int rounded) { int inv; if((inv = MwGetInteger(handle, MwNforceInverted)) != MwDEFAULT && inv) invert = 1; if(MwGetInteger(handle, MwNmodernLook)) { - MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle), 0, 0); + MwDrawFrameEx(handle, rect, color, invert, MwDefaultBorderWidth(handle), 0, 0, rounded); } else { int diff = get_color_diff(handle) / 3 * 2; @@ -143,11 +193,11 @@ void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert) { 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); - if((i % 2) == 1) MwDrawFrameEx(handle, rect, color, invert, 1, diff, 0); + 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); } } else { - MwDrawFrameEx(handle, rect, color, invert, 1, 0, 0); + MwDrawFrameEx(handle, rect, color, invert, 1, 0, 0, 0); } } } @@ -156,11 +206,11 @@ void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert MwLLColor col; if(border) { - MwDrawFrame(handle, rect, color, invert); + MwDrawFrame(handle, rect, color, invert, handle->lowlevel->common.supports_transparency); } col = invert ? MwLightenColor(handle, color, -8, -8, -8) : color; if(MwGetInteger(handle, MwNmodernLook)) { - MwDrawRectFading(handle, rect, col); + MwDrawRectFading(handle, rect, col, handle->lowlevel->common.supports_transparency); } else { MwDrawRect(handle, rect, col); } @@ -234,54 +284,158 @@ void MwDrawDiamond(MwWidget handle, MwRect* rect, MwLLColor color, int invert) { MwLLFreeColor(darker); } -void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same) { - MwPoint p[6]; +void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same, int rounded) { + 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 i; + MwLLColor middle = MwLLAllocColor(handle->lowlevel, + (lighter->common.red * darker->common.red) / 255, + (lighter->common.green * darker->common.green) / 255, + (lighter->common.blue * darker->common.blue) / 255); - p[0].x = rect->x; - p[0].y = rect->y; + if(rounded) { + /* 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 + (BORDER_ROUNDNESS + 2); + int y = rect->y + (BORDER_ROUNDNESS + 2); - p[1].x = rect->x + rect->width; - p[1].y = rect->y; + line[0].x = x - (sin(point) * BORDER_ROUNDNESS); + line[0].y = y + (cos(point) * BORDER_ROUNDNESS); + line[1].x = x - (sin(point + 1) * BORDER_ROUNDNESS); + line[1].y = y + (cos(point + 1) * BORDER_ROUNDNESS); + MwLLLine(handle->lowlevel, line, invert ? darker : lighter); + } - p[2].x = rect->x + rect->width - border; - p[2].y = rect->y + border; + p[0].x = rect->x + BORDER_ROUNDNESS; + p[0].y = rect->y; - 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; - p[4].x = rect->x + border; - p[4].y = rect->y + rect->height - border; + p[2].x = rect->x + rect->width - border - BORDER_ROUNDNESS; + p[2].y = rect->y + border; - p[5].x = rect->x; - p[5].y = rect->y + rect->height; + p[3].x = rect->x + border - BORDER_ROUNDNESS; + p[3].y = rect->y + border + BORDER_ROUNDNESS; + p[4].x = rect->x + border - BORDER_ROUNDNESS; + p[4].y = rect->y + rect->height - border - BORDER_ROUNDNESS; + + p[5].x = rect->x + BORDER_ROUNDNESS; + p[5].y = rect->y + rect->height - BORDER_ROUNDNESS; + MwLLPolygon(handle->lowlevel, p, 6, invert ? darker : lighter); + + /* 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) - (BORDER_ROUNDNESS + 2); + int y = rect->y + (BORDER_ROUNDNESS + 2); + double placeholder = (sin(point) * BORDER_ROUNDNESS); + line[0].x = x + placeholder; + line[0].y = y + (cos(point) * BORDER_ROUNDNESS); + line[1].x = x + (sin(point + 1) * BORDER_ROUNDNESS); + line[1].y = y + (cos(point + 1) * BORDER_ROUNDNESS); + MwLLLine(handle->lowlevel, line, middle); + } + } 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; + } MwLLPolygon(handle->lowlevel, p, 6, invert ? darker : lighter); - p[0].x = rect->x + rect->width; - p[0].y = rect->y; + if(rounded && rect->height >= (BORDER_ROUNDNESS * 2) && rect->width >= (BORDER_ROUNDNESS * 2)) { + /* 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 + (BORDER_ROUNDNESS + 2); + int y = (rect->y + rect->height) - (BORDER_ROUNDNESS + 2); - p[1].x = rect->x + rect->width - border; - p[1].y = rect->y + border; + line[0].x = x - (sin(point) * BORDER_ROUNDNESS); + line[0].y = y - (cos(point) * BORDER_ROUNDNESS); + line[1].x = x - (sin(point + 1) * BORDER_ROUNDNESS); + line[1].y = y - (cos(point + 1) * BORDER_ROUNDNESS); + MwLLLine(handle->lowlevel, line, middle); + } + p[0].x = rect->x + BORDER_ROUNDNESS; + p[0].y = rect->y + 1; - p[2].x = rect->x + rect->width - border; - p[2].y = rect->y + rect->height - border; + p[1].x = rect->x + rect->width - border; + p[1].y = rect->y + border + BORDER_ROUNDNESS; - p[3].x = rect->x + border; - p[3].y = rect->y + rect->height - border; + p[2].x = rect->x + rect->width - border; + p[2].y = rect->y + rect->height - border - BORDER_ROUNDNESS; - p[4].x = rect->x; - p[4].y = rect->y + rect->height; + p[3].x = rect->x + rect->width - border - BORDER_ROUNDNESS; + p[3].y = rect->y + rect->height - border; - p[5].x = rect->x + rect->width; - p[5].y = rect->y + rect->height; + p[4].x = rect->x + border + BORDER_ROUNDNESS; + p[4].y = rect->y + rect->height - border; - MwLLPolygon(handle->lowlevel, p, 6, invert ? lighter : darker); + p[5].x = rect->x + BORDER_ROUNDNESS; + p[5].y = rect->y + rect->height - BORDER_ROUNDNESS; + + p[6].x = rect->x + rect->width - BORDER_ROUNDNESS; + p[6].y = rect->y + rect->height - BORDER_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) - (BORDER_ROUNDNESS + 2); + int y = (rect->y + rect->height) - (BORDER_ROUNDNESS + 2); + + line[0].x = x + (sin(point) * BORDER_ROUNDNESS); + line[0].y = y - (cos(point) * BORDER_ROUNDNESS); + line[1].x = x + (sin(point + 1) * BORDER_ROUNDNESS); + line[1].y = y - (cos(point + 1) * BORDER_ROUNDNESS); + MwLLLine(handle->lowlevel, line, middle); + } + } 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); + } MwLLFreeColor(lighter); MwLLFreeColor(darker); + MwLLFreeColor(middle); rect->x += border; rect->y += border; diff --git a/src/widget/box.c b/src/widget/box.c index 4c4ae68..d8d4745 100644 --- a/src/widget/box.c +++ b/src/widget/box.c @@ -24,7 +24,7 @@ static void draw(MwWidget handle) { r.height = MwGetInteger(handle, MwNheight); if(MwGetInteger(handle, MwNhasBorder)) { - MwDrawFrame(handle, &r, base, MwGetInteger(handle, MwNinverted)); + MwDrawFrame(handle, &r, base, MwGetInteger(handle, MwNinverted), 0); } MwDrawRect(handle, &r, base); diff --git a/src/widget/combobox.c b/src/widget/combobox.c index 6b54373..0672ff3 100644 --- a/src/widget/combobox.c +++ b/src/widget/combobox.c @@ -72,7 +72,7 @@ static void draw(MwWidget handle) { r.y += r.height; r.height = MwDefaultBorderWidth(handle) * 2; - MwDrawFrame(handle, &r, base, 0); + MwDrawFrame(handle, &r, base, 0, 0); MwLLFreeColor(text); MwLLFreeColor(base); diff --git a/src/widget/frame.c b/src/widget/frame.c index 117b0f8..3c2ffe9 100644 --- a/src/widget/frame.c +++ b/src/widget/frame.c @@ -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); + MwDrawFrame(handle, &fr, base, inverted, 0); rr.x = MwDefaultBorderWidth(handle); rr.y = MwDefaultBorderWidth(handle); diff --git a/src/widget/image.c b/src/widget/image.c index 74ee0bf..cadddb3 100644 --- a/src/widget/image.c +++ b/src/widget/image.c @@ -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)); + if(MwGetInteger(handle, MwNhasBorder)) MwDrawFrame(handle, &r, base, MwGetInteger(handle, MwNinverted), 0); MwDrawRect(handle, &r, base); if(px != NULL) { diff --git a/src/widget/listbox.c b/src/widget/listbox.c index cb84e44..be46708 100644 --- a/src/widget/listbox.c +++ b/src/widget/listbox.c @@ -208,7 +208,7 @@ static void frame_draw(MwWidget handle) { p.x = MwDefaultBorderWidth(handle); p.y = MwDefaultBorderWidth(handle); - MwDrawFrame(handle, &r, base, 1); + MwDrawFrame(handle, &r, base, 1, 0); MwDrawRect(handle, &r, base2); r = r2; @@ -282,7 +282,7 @@ static void frame_draw(MwWidget handle) { handle->bgcolor = NULL; } - MwDrawFrame(handle, &r, base, 1); + MwDrawFrame(handle, &r, base, 1, 0); MwLLFreeColor(text2); MwLLFreeColor(text); @@ -401,7 +401,7 @@ static void draw(MwWidget handle) { r.y = 0; r.width = get_col_width(lb, i); r.height = MwDefaultBorderWidth(handle) * 2 + MwTextHeight(handle, "M"); - MwDrawFrame(handle, &r, base, 0); + MwDrawFrame(handle, &r, base, 0, 0); x += MwDefaultBorderWidth(handle); diff --git a/src/widget/menu.c b/src/widget/menu.c index 44fc2fe..e360f3d 100644 --- a/src/widget/menu.c +++ b/src/widget/menu.c @@ -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); + MwDrawFrame(handle, &r, base, MwFALSE, 0); MwDrawWidgetBack(handle, &r, base, 0, MwFALSE); } diff --git a/src/widget/progressbar.c b/src/widget/progressbar.c index d85a8dd..7be7bff 100644 --- a/src/widget/progressbar.c +++ b/src/widget/progressbar.c @@ -23,7 +23,7 @@ static void draw(MwWidget handle) { r.width = MwGetInteger(handle, MwNwidth); r.height = MwGetInteger(handle, MwNheight); - MwDrawFrame(handle, &r, base, 1); + MwDrawFrame(handle, &r, base, 1, 0); MwDrawRect(handle, &r, base); w = MwGetInteger(handle, MwNvalue) - MwGetInteger(handle, MwNminValue); w = w / (MwGetInteger(handle, MwNmaxValue) - MwGetInteger(handle, MwNminValue)); diff --git a/src/widget/separator.c b/src/widget/separator.c index 8fcfc5b..571c5df 100644 --- a/src/widget/separator.c +++ b/src/widget/separator.c @@ -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); + MwDrawFrameEx(handle, &r, base, 1, 1, 0, 0, MwGetInteger(handle, MwNmodernLook)); MwLLFreeColor(base); } diff --git a/src/widget/submenu.c b/src/widget/submenu.c index 8281550..88607ff 100644 --- a/src/widget/submenu.c +++ b/src/widget/submenu.c @@ -59,7 +59,7 @@ static void draw(MwWidget handle) { rc.x += MwGetInteger(handle, MwNleftPadding); - MwDrawFrameEx(handle, &rc, base, 1, 1, 0, 0); + MwDrawFrameEx(handle, &rc, base, 1, 1, 0, 0, 0); p.y += 2 + 1; } else { diff --git a/src/widget/treeview.c b/src/widget/treeview.c index 76e1e01..3a335be 100644 --- a/src/widget/treeview.c +++ b/src/widget/treeview.c @@ -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); + MwDrawFrame(handle, &r, base, tree->opened, 0); 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); + MwDrawFrame(handle, &r, base, tree->opened, 0); 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); + MwDrawFrame(handle, &r, base, 1, 0); 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); + MwDrawFrame(handle, &r, base, 1, 0); MwLLFreeColor(text2); MwLLFreeColor(text); diff --git a/src/widget/window.c b/src/widget/window.c index 979e073..74a96e6 100644 --- a/src/widget/window.c +++ b/src/widget/window.c @@ -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)); + if(MwGetInteger(handle, MwNhasBorder)) MwDrawFrame(handle, &r, c, MwGetInteger(handle, MwNinverted), 0); MwDrawRect(handle, &r, c);