rounded corners on select widgets #12

Merged
IoI_xD merged 15 commits from rounded into master 2026-03-27 11:08:43 +09:00
3 changed files with 4 additions and 1 deletions
Showing only changes of commit 00e44bec32 - Show all commits

MwNisRounded

IoI_xD 2026-03-26 18:02:48 -07:00 • committed by Nishi

View file

@ -40,6 +40,7 @@
#define MwNlength "Ilength" #define MwNlength "Ilength"
#define MwNforceInverted "IforceInverted" #define MwNforceInverted "IforceInverted"
#define MwNroundness "Iroundness" #define MwNroundness "Iroundness"
#define MwNisRounded "IisRounded"
#define MwNtitle "Stitle" #define MwNtitle "Stitle"
#define MwNtext "Stext" #define MwNtext "Stext"

View file

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

View file

@ -207,7 +207,7 @@ void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int
void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border) { void MwDrawWidgetBack(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border) {
MwLLColor col; MwLLColor col;
MwBool rounded = handle->lowlevel->common.supports_transparency && MwGetInteger(handle, MwNroundness) != MwDEFAULT; MwBool rounded = handle->lowlevel->common.supports_transparency && MwGetInteger(handle, MwNroundness) != MwDEFAULT && MwGetInteger(handle, MwNisRounded) != 0;
if(border) { if(border) {
MwDrawFrame(handle, rect, color, invert, rounded); MwDrawFrame(handle, rect, color, invert, rounded);
@ -333,6 +333,7 @@ void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, i
p[5].x = rect->x + roundness; p[5].x = rect->x + roundness;
p[5].y = rect->y + rect->height - roundness; p[5].y = rect->y + rect->height - roundness;
MwLLPolygon(handle->lowlevel, p, 6, invert ? darker : lighter);
/* top right edge */ /* top right edge */
for(i = 0; i < BORDER_SMOOTHNESS; i += 2) { for(i = 0; i < BORDER_SMOOTHNESS; i += 2) {