allowing hotswapping the top-most setting on windows
This commit is contained in:
@@ -115,9 +115,16 @@ void BaseWindow::init()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef USEWINSDK
|
||||||
|
app->settings->windowTopMost.connect([this](bool topMost, auto) {
|
||||||
|
::SetWindowPos((HWND)this->winId(), topMost ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0,
|
||||||
|
SWP_NOMOVE | SWP_NOSIZE);
|
||||||
|
});
|
||||||
|
#else
|
||||||
if (app->settings->windowTopMost.getValue()) {
|
if (app->settings->windowTopMost.getValue()) {
|
||||||
this->setWindowFlags(this->windowFlags() | Qt::WindowStaysOnTopHint);
|
this->setWindowFlags(this->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseWindow::setStayInScreenRect(bool value)
|
void BaseWindow::setStayInScreenRect(bool value)
|
||||||
|
|||||||
@@ -8,7 +8,11 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
#ifdef USEWINSDK
|
||||||
|
#define WINDOW_TOPMOST "Window always on top"
|
||||||
|
#else
|
||||||
#define WINDOW_TOPMOST "Window always on top (requires restart)"
|
#define WINDOW_TOPMOST "Window always on top (requires restart)"
|
||||||
|
#endif
|
||||||
#define INPUT_EMPTY "Hide input box when empty"
|
#define INPUT_EMPTY "Hide input box when empty"
|
||||||
#define PAUSE_HOVERING "When hovering"
|
#define PAUSE_HOVERING "When hovering"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user