MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / applyForTheme

Function applyForTheme

AdaptixClient/Source/Utils/TitleBarStyle.cpp:40–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38 }
39
40 void applyForTheme(QWidget* window, const QString& themeName)
41 {
42 bool light = isLightTheme(themeName);
43
44#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
45 QGuiApplication::styleHints()->setColorScheme(
46 light ? Qt::ColorScheme::Light : Qt::ColorScheme::Dark
47 );
48 Q_UNUSED(window)
49#elif defined(Q_OS_WIN)
50 if (!window) return;
51 HWND hwnd = reinterpret_cast<HWND>(window->winId());
52 BOOL darkMode = light ? FALSE : TRUE;
53 DwmSetWindowAttribute(hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE, &darkMode, sizeof(darkMode));
54#else
55 Q_UNUSED(window)
56 Q_UNUSED(light)
57#endif
58 }
59}

Callers 2

MainAdaptixMethod · 0.85
onApplyMethod · 0.85

Calls 2

isLightThemeFunction · 0.85
setColorSchemeMethod · 0.80

Tested by

no test coverage detected