parent
b9b2e54427
commit
973435e5df
|
@ -300,7 +300,7 @@ bool WinNativeEventFilter::nativeEventFilter(const QByteArray &eventType,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_THEMECHANGED: {
|
case WM_THEMECHANGED: {
|
||||||
data->themeEnabled = IsThemeActive();
|
handleThemeChanged(data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WM_WINDOWPOSCHANGED: {
|
case WM_WINDOWPOSCHANGED: {
|
||||||
|
@ -360,6 +360,7 @@ void WinNativeEventFilter::init(LPWINDOW data) {
|
||||||
SetLayeredWindowAttributes(data->hwnd, RGB(255, 0, 255), 0, LWA_COLORKEY);
|
SetLayeredWindowAttributes(data->hwnd, RGB(255, 0, 255), 0, LWA_COLORKEY);
|
||||||
// Make sure our window has the frame shadow.
|
// Make sure our window has the frame shadow.
|
||||||
handleDwmCompositionChanged(data);
|
handleDwmCompositionChanged(data);
|
||||||
|
handleThemeChanged(data);
|
||||||
// Tell the window to redraw itself.
|
// Tell the window to redraw itself.
|
||||||
SetWindowPos(data->hwnd, nullptr, 0, 0, 0, 0,
|
SetWindowPos(data->hwnd, nullptr, 0, 0, 0, 0,
|
||||||
SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE |
|
SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE |
|
||||||
|
@ -444,6 +445,10 @@ void WinNativeEventFilter::handleDwmCompositionChanged(LPWINDOW data) {
|
||||||
updateRegion(data);
|
updateRegion(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WinNativeEventFilter::handleThemeChanged(LPWINDOW data) {
|
||||||
|
data->themeEnabled = IsThemeActive();
|
||||||
|
}
|
||||||
|
|
||||||
UINT WinNativeEventFilter::getDpiForWindow(HWND handle) const {
|
UINT WinNativeEventFilter::getDpiForWindow(HWND handle) const {
|
||||||
const auto getScreenDpi = [this]() -> UINT {
|
const auto getScreenDpi = [this]() -> UINT {
|
||||||
// Available since Windows 7.
|
// Available since Windows 7.
|
||||||
|
|
|
@ -38,6 +38,7 @@ private:
|
||||||
void init(LPWINDOW data);
|
void init(LPWINDOW data);
|
||||||
void updateRegion(LPWINDOW data);
|
void updateRegion(LPWINDOW data);
|
||||||
void handleDwmCompositionChanged(LPWINDOW data);
|
void handleDwmCompositionChanged(LPWINDOW data);
|
||||||
|
void handleThemeChanged(LPWINDOW data);
|
||||||
UINT getDpiForWindow(HWND handle) const;
|
UINT getDpiForWindow(HWND handle) const;
|
||||||
qreal getDprForWindow(HWND handle) const;
|
qreal getDprForWindow(HWND handle) const;
|
||||||
int getSystemMetricsForWindow(HWND handle, int index) const;
|
int getSystemMetricsForWindow(HWND handle, int index) const;
|
||||||
|
|
Loading…
Reference in New Issue