diff --git a/include/Mw/LowLevel/GDI.h b/include/Mw/LowLevel/GDI.h index e505b0a..d2e2473 100644 --- a/include/Mw/LowLevel/GDI.h +++ b/include/Mw/LowLevel/GDI.h @@ -34,8 +34,7 @@ struct _MwLLGDI { struct _MwLLGDIColor { struct _MwLLCommonColor common; - COLORREF color; - HBRUSH brush; + HBRUSH brush; }; struct _MwLLGDIPixmap { diff --git a/include/Mw/StringDefs.h b/include/Mw/StringDefs.h index 885e07e..6ad4e46 100644 --- a/include/Mw/StringDefs.h +++ b/include/Mw/StringDefs.h @@ -64,7 +64,6 @@ #define MwNsubForeground "SsubForeground" #define MwNtitleForeground "StitleForeground" - #define MwNvulkanExtension "SEvulkanExtension" #define MwNvulkanLayer "SEvulkanLayer" #define MwNvulkanConfig "VEvulkanConfig" diff --git a/src/backend/cairo.c b/src/backend/cairo.c index d70de1b..65380fb 100644 --- a/src/backend/cairo.c +++ b/src/backend/cairo.c @@ -212,8 +212,8 @@ static void MwLLFreeColorImpl(MwLLColor color) {} static MwBool lmao = MwFALSE; static int MwLLPendingImpl(MwLL handle) { - lmao = !lmao; - return lmao; + lmao = !lmao; + return lmao; } static void MwLLNextEventImpl(MwLL handle) { MwLLDispatch(handle, draw, NULL); @@ -257,10 +257,10 @@ static void MwLLRaiseImpl(MwLL handle) {} static void MwLLClipImpl(MwLL handle, MwRect* rect) {} static void MwLLSetupDragAndDropImpl(MwLL handle) {} static int MwLLCairoCallInitImpl(void) { - if(cairo_load_funcs() != 0) { - return 1; - } - return 0; + if(cairo_load_funcs() != 0) { + return 1; + } + return 0; } #include "call.c" CALL(Cairo); diff --git a/src/backend/gdi.c b/src/backend/gdi.c index 71bfcfb..89caab2 100644 --- a/src/backend/gdi.c +++ b/src/backend/gdi.c @@ -170,9 +170,9 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { } case WM_DROPFILES: { - HDROP hDrop = (HDROP)wp; - UINT count; - UINT i; + HDROP hDrop = (HDROP)wp; + UINT count; + UINT i; count = wsymtbl.DragQueryFileW(hDrop, 0xFFFFFFFF, NULL, 0); @@ -524,7 +524,8 @@ static MwLLColor MwLLAllocColorImpl(MwLL handle, int r, int g, int b) { } static void MwLLColorUpdateImpl(MwLL handle, MwLLColor c, int r, int g, int b) { - HDC dc = GetDC(handle->gdi.hWnd); + HDC dc = GetDC(handle->gdi.hWnd); + COLORREF color; if(r > 255) r = 255; if(g > 255) g = 255; @@ -533,9 +534,10 @@ static void MwLLColorUpdateImpl(MwLL handle, MwLLColor c, int r, int g, int b) { if(g < 0) g = 0; if(b < 0) b = 0; + color = GetNearestColor(dc, RGB(r, g, b)); + if(c->gdi.brush != NULL) DeleteObject(c->gdi.brush); - c->gdi.color = GetNearestColor(dc, RGB(r, g, b)); - c->gdi.brush = CreateSolidBrush(c->gdi.color); + c->gdi.brush = CreateSolidBrush(color); c->common.red = r; c->common.green = g; c->common.blue = b; @@ -1032,7 +1034,7 @@ static void MwLLSetupDragAndDropImpl(MwLL handle) { } static int MwLLGDICallInitImpl(void) { - void* ntdll; + void* ntdll; memset(&wsymtbl, 0, sizeof(wsymtbl)); diff --git a/src/core.c b/src/core.c index 4d584d0..9d149d8 100644 --- a/src/core.c +++ b/src/core.c @@ -194,7 +194,7 @@ static void llclipboardhandler(MwLL handle, void* data) { } static void lldraganddrophandler(MwLL handle, void* data) { - MwWidget h = (MwWidget)handle->common.user; + MwWidget h = (MwWidget)handle->common.user; if(MwGetInteger(h, MwNdisabled) == 1) return; MwDispatchUserHandler(h, MwNdragAndDropHandler, data); diff --git a/src/dialog/messagebox.c b/src/dialog/messagebox.c index 6a96f6d..ff72bc8 100644 --- a/src/dialog/messagebox.c +++ b/src/dialog/messagebox.c @@ -68,9 +68,9 @@ MwWidget MwMessageBox(MwWidget handle, const char* text, const char* title, unsi if(flag & MwMB_BUTTONYES) spawn_button(window, w - (x += 8 + 80), h - 8 - 24, MwMB_BUTTONYES, "Yes"); if((flag & MwMB_ICONMASK) != 0) { - MwWidget icon; - MwLLPixmap px; - MwU32* data = NULL; + MwWidget icon; + MwLLPixmap px; + MwU32* data = NULL; icon = MwCreateWidget(MwImageClass, "image", window, 8, (h - 48) / 2, 48, 48); diff --git a/src/text/gdi.c b/src/text/gdi.c index b965e2d..97e6870 100644 --- a/src/text/gdi.c +++ b/src/text/gdi.c @@ -28,10 +28,10 @@ static int GDI_MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const c tw = MwTextWidth(handle, ttf, text); th = MwTextHeight(handle, ttf, text); - if(handle->lowlevel->common.type == MwLLBackendGDI && MwGetInteger(handle, MwNmodernLook) == MwFALSE) { + if(handle->lowlevel->common.type == MwLLBackendGDI) { HFONT old_font = SelectObject(handle->lowlevel->gdi.hDC, ttf->font); int old_bkmode = SetBkMode(handle->lowlevel->gdi.hDC, TRANSPARENT); - COLORREF old_color = SetTextColor(handle->lowlevel->gdi.hDC, color->gdi.color); + COLORREF old_color = SetTextColor(handle->lowlevel->gdi.hDC, RGB(color->common.red, color->common.green, color->common.blue)); TextOut(handle->lowlevel->gdi.hDC, point->x, point->y - th / 2, t, strlen(t)); @@ -180,7 +180,7 @@ static HANDLE WINAPI _AddFontMemResourceExPolyFill(PVOID pFileView, DWORD cjSize CHAR temp_path_dir[MAX_PATH]; CHAR temp_path_name[MAX_PATH]; HANDLE tempFile = NULL; - DWORD hr; + DWORD hr; (void)pvResrved; diff --git a/src/text/text.c b/src/text/text.c index 9ad1e94..9d7d184 100644 --- a/src/text/text.c +++ b/src/text/text.c @@ -91,6 +91,7 @@ void MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const char* text, fadedColor->common.red = fadedColor->common.red + (c->common.red - fadedColor->common.red) * 0.5; fadedColor->common.green = fadedColor->common.green + (c->common.green - fadedColor->common.green) * 0.5; fadedColor->common.blue = fadedColor->common.blue + (c->common.blue - fadedColor->common.blue) * 0.5; + MwLLColorUpdate(handle->lowlevel, fadedColor, fadedColor->common.red, fadedColor->common.green, fadedColor->common.blue); MwLLFreeColor(c); } diff --git a/src/widget/entry.c b/src/widget/entry.c index 44f5a42..9d423bf 100644 --- a/src/widget/entry.c +++ b/src/widget/entry.c @@ -9,7 +9,7 @@ static int wcreate(MwWidget handle) { t->right = 0; t->length = 0; t->cursor_blink_timer = 0; - t->active = 0; + t->active = 0; handle->internal = t; while(topmost_parent->parent) topmost_parent = topmost_parent->parent;