diff --git a/examples/basic/periodic.c b/examples/basic/periodic.c index 39c6b4a..efc1da5 100644 --- a/examples/basic/periodic.c +++ b/examples/basic/periodic.c @@ -313,8 +313,8 @@ int main() { w = child(f); MwViewportSetSize(w, 512, 512); MwVaCreateWidget(MwSubWindowClass, "swnd", MwViewportGetViewport(w), 32, 32, 128, 128, - MwNtitle, "Sub window", - NULL); + MwNtitle, "Sub window", + NULL); add(f); #endif diff --git a/include/Mw/StringDefs.h b/include/Mw/StringDefs.h index 9534085..d8e01b1 100644 --- a/include/Mw/StringDefs.h +++ b/include/Mw/StringDefs.h @@ -50,6 +50,7 @@ #define MwNsubBackground "SsubBackground" #define MwNforeground "Sforeground" #define MwNsubForeground "SsubForeground" +#define MwNtitleBackground "StitleBackground" #define MwNvulkanExtension "SEvulkanExtension" #define MwNvulkanLayer "SEvulkanLayer" diff --git a/src/backend/gdi.c b/src/backend/gdi.c index c87e3fa..db6090d 100644 --- a/src/backend/gdi.c +++ b/src/backend/gdi.c @@ -51,10 +51,13 @@ static void detect_darktheme(MwLL handle) { t = dw ? 0 : 1; + /* no don't do this here (nishi) */ +#if 0 if(t && DwmSetWindowAttribute != NULL) { - // LPARAM style = GetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE); - // if(!(style & WS_CHILD)) MwLLSetDarkTheme(handle, 1); + LPARAM style = GetWindowLongPtr(handle->gdi.hWnd, GWL_STYLE); + if(!(style & WS_CHILD)) MwLLSetDarkTheme(handle, 1); } +#endif MwLLDispatch(handle, dark_theme, &t); } diff --git a/src/core.c b/src/core.c index c73a635..cc0cdc4 100644 --- a/src/core.c +++ b/src/core.c @@ -173,7 +173,7 @@ static void lldarkthemehandler(MwLL handle, void* data) { int s; if(IsFirstVisible(h) && (shgeti(h->integer, MwNdarkTheme) == -1 || ((s = MwGetInteger(h, MwNdarkThemeAutomatic)) != MwDEFAULT && s))) { - if(MwGetInteger(h, MwNmodernLook)){ + if(MwGetInteger(h, MwNmodernLook)) { MwVaApply(h, MwNdarkTheme, *ptr, MwNdarkThemeAutomatic, 1, diff --git a/src/widget/subwindow.c b/src/widget/subwindow.c index b7051f9..1659498 100644 --- a/src/widget/subwindow.c +++ b/src/widget/subwindow.c @@ -5,12 +5,14 @@ static int wcreate(MwWidget handle) { MwSetDefault(handle); + MwSetText(handle, MwNtitleBackground, "#008"); + return 0; } static void draw(MwWidget handle) { - MwLLColor c = MwParseColor(handle, MwGetText(handle, MwNbackground)); - MwLLColor c2 = MwParseColor(handle, MwGetText(handle, MwNsubBackground)); + MwLLColor c = MwParseColor(handle, MwGetText(handle, MwNbackground)); + MwLLColor c2 = MwParseColor(handle, MwGetText(handle, MwNtitleBackground)); MwRect r, r2; r.x = 0; @@ -21,7 +23,7 @@ static void draw(MwWidget handle) { MwDrawFrame(handle, &r, c, 0); MwDrawRect(handle, &r, c); - r2 = r; + r2 = r; r2.height = TitleHeight; MwDrawRect(handle, &r2, c2);