MwSetDarkTheme instead of MwToggleDarkTheme

This commit is contained in:
NishiOwO
2026-01-27 18:03:16 +09:00
parent 5e492ee5b4
commit 64c3cdb4a5
5 changed files with 6 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ void handler_dark(MwWidget handle, void* user_data, void* call_data) {
(void)call_data; (void)call_data;
toggle = toggle ? 0 : 1; toggle = toggle ? 0 : 1;
MwToggleDarkTheme(window, toggle); MwSetDarkTheme(window, toggle);
} }
void resize(MwWidget handle, void* user_data, void* call_data) { void resize(MwWidget handle, void* user_data, void* call_data) {

View File

@@ -296,7 +296,7 @@ MWDECL void MwHideCursor(MwWidget handle);
* @param handle Widget * @param handle Widget
* @param toggle Toggle * @param toggle Toggle
*/ */
MWDECL void MwToggleDarkTheme(MwWidget handle, int toggle); MWDECL void MwSetDarkTheme(MwWidget handle, int toggle);
/*! /*!
* @brief Gets the parent widget * @brief Gets the parent widget

View File

@@ -353,7 +353,7 @@
<widget name="handle" /> <widget name="handle" />
</arguments> </arguments>
</function> </function>
<function name="MwToggleDarkTheme"> <function name="MwSetDarkTheme">
<arguments> <arguments>
<widget name="handle" /> <widget name="handle" />
<integer name="toggle" /> <integer name="toggle" />

View File

@@ -266,7 +266,7 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
r->common.type = MwLLBackendGDI; r->common.type = MwLLBackendGDI;
r->gdi.get_clipboard = 1; r->gdi.get_clipboard = 1;
r->gdi.get_darktheme = 1; if(parent == NULL) r->gdi.get_darktheme = 1;
r->gdi.force_render = 0; r->gdi.force_render = 0;
r->gdi.grabbed = 0; r->gdi.grabbed = 0;
r->gdi.hWnd = CreateWindow("milsko", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x == MwDEFAULT ? CW_USEDEFAULT : x, y == MwDEFAULT ? CW_USEDEFAULT : y, width, height, parent == NULL ? NULL : parent->gdi.hWnd, 0, wc.hInstance, NULL); r->gdi.hWnd = CreateWindow("milsko", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x == MwDEFAULT ? CW_USEDEFAULT : x, y == MwDEFAULT ? CW_USEDEFAULT : y, width, height, parent == NULL ? NULL : parent->gdi.hWnd, 0, wc.hInstance, NULL);

View File

@@ -131,7 +131,7 @@ static void lldarkthemehandler(MwLL handle, void* data){
MwWidget h = (MwWidget)handle->common.user; MwWidget h = (MwWidget)handle->common.user;
int* ptr = data; int* ptr = data;
if(IsFirstVisible(h)) MwToggleDarkTheme(h, *ptr); if(IsFirstVisible(h)) MwSetDarkTheme(h, *ptr);
} }
MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height) { MwWidget MwCreateWidget(MwClass widget_class, const char* name, MwWidget parent, int x, int y, unsigned int width, unsigned int height) {
@@ -747,7 +747,7 @@ static void force_render_all(MwWidget handle) {
if(handle->lowlevel != NULL) MwForceRender(handle); if(handle->lowlevel != NULL) MwForceRender(handle);
} }
void MwToggleDarkTheme(MwWidget handle, int toggle) { void MwSetDarkTheme(MwWidget handle, int toggle) {
int old = handle->dark_theme; int old = handle->dark_theme;
if(old != toggle) { if(old != toggle) {
handle->dark_theme = toggle; handle->dark_theme = toggle;