Skip to content

Commit 334ea18

Browse files
committed
Push omitted implemetation of a method from two commits back
1 parent f65a561 commit 334ea18

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

modules/Lith/Core/windowhelper.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ QString WindowHelper::currentThemeName() const {
9393
return m_darkTheme ? QStringLiteral("dark") : QStringLiteral("light");
9494
}
9595

96+
void WindowHelper::connectToWindow(QQuickWindow* window) {
97+
if (m_window == window) {
98+
return;
99+
}
100+
if (m_window) {
101+
disconnect(m_window, nullptr, this, nullptr);
102+
}
103+
m_window = window;
104+
if (m_window) {
105+
connect(window, &QQuickWindow::widthChanged, this, &WindowHelper::handleWindowChange);
106+
connect(window, &QQuickWindow::heightChanged, this, &WindowHelper::handleWindowChange);
107+
}
108+
handleWindowChange();
109+
}
110+
96111
void WindowHelper::detectSystemDarkStyle() {
97112
#if WIN32
98113
QSettings registry("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", QSettings::NativeFormat);

0 commit comments

Comments
 (0)