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();
});
}

View File

@ -381,6 +381,7 @@
</widget>
<addaction name="menuTheme"/>
<addaction name="actionCompactMode"/>
<addaction name="actionAlwaysOnTop"/>
<addaction name="actionShowPreviewPanel"/>
<addaction name="actionShowToolbar"/>
</widget>
@ -972,6 +973,17 @@
<string>Show Preview Panel</string>
</property>
</action>
<action name="actionAlwaysOnTop">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Always on Top</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Shift+A</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>