Implement window always on top

* Closes #4151
This commit is contained in:
Jonathan White 2020-10-11 19:01:44 -04:00
parent a55bb39f20
commit c2f36d877f
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
2 changed files with 22 additions and 0 deletions

View file

@ -1757,4 +1757,14 @@ void MainWindow::initViewMenu()
connect(m_ui->actionShowPreviewPanel, &QAction::toggled, this, [](bool checked) {
config()->set(Config::GUI_HidePreviewPanel, !checked);
});
connect(m_ui->actionAlwaysOnTop, &QAction::toggled, this, [this](bool checked) {
if (checked) {
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
} else {
setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
}
show();
});
}