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

Function isLightTheme

AdaptixClient/Source/Utils/TitleBarStyle.cpp:20–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18namespace TitleBarStyle {
19
20 static bool isLightTheme(const QString& themeName)
21 {
22 QString themeFile = ":/themes/" + themeName;
23 QFile file(themeFile);
24
25 if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
26 return false;
27
28 QString content = QString::fromUtf8(file.read(500));
29 file.close();
30
31 QRegularExpression regex(R"(@theme-type:\s*(light|dark))");
32 QRegularExpressionMatch match = regex.match(content);
33
34 if (match.hasMatch())
35 return match.captured(1).toLower() == "light";
36
37 return false;
38 }
39
40 void applyForTheme(QWidget* window, const QString& themeName)
41 {

Callers 1

applyForThemeFunction · 0.85

Calls 3

readMethod · 0.80
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected