mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Persist Always on Top setting
This commit is contained in:
@@ -92,6 +92,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
||||
{Config::GUI_HideToolbar, {QS("GUI/HideToolbar"), Roaming, false}},
|
||||
{Config::GUI_MovableToolbar, {QS("GUI/MovableToolbar"), Roaming, false}},
|
||||
{Config::GUI_HidePreviewPanel, {QS("GUI/HidePreviewPanel"), Roaming, false}},
|
||||
{Config::GUI_AlwaysOnTop, {QS("GUI/GUI_AlwaysOnTop"), Roaming, false}},
|
||||
{Config::GUI_ToolButtonStyle, {QS("GUI/ToolButtonStyle"), Roaming, Qt::ToolButtonIconOnly}},
|
||||
{Config::GUI_ShowTrayIcon, {QS("GUI/ShowTrayIcon"), Roaming, false}},
|
||||
{Config::GUI_TrayIconAppearance, {QS("GUI/TrayIconAppearance"), Roaming, {}}},
|
||||
|
||||
@@ -74,6 +74,7 @@ public:
|
||||
GUI_HideToolbar,
|
||||
GUI_MovableToolbar,
|
||||
GUI_HidePreviewPanel,
|
||||
GUI_AlwaysOnTop,
|
||||
GUI_ToolButtonStyle,
|
||||
GUI_ShowTrayIcon,
|
||||
GUI_TrayIconAppearance,
|
||||
|
||||
@@ -1773,6 +1773,7 @@ void MainWindow::initViewMenu()
|
||||
});
|
||||
|
||||
connect(m_ui->actionAlwaysOnTop, &QAction::toggled, this, [this](bool checked) {
|
||||
config()->set(Config::GUI_AlwaysOnTop, checked);
|
||||
if (checked) {
|
||||
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
} else {
|
||||
@@ -1780,6 +1781,8 @@ void MainWindow::initViewMenu()
|
||||
}
|
||||
show();
|
||||
});
|
||||
// Set checked after connecting to act on a toggle in state (default state is unchecked)
|
||||
m_ui->actionAlwaysOnTop->setChecked(config()->get(Config::GUI_AlwaysOnTop).toBool());
|
||||
|
||||
m_ui->actionHideUsernames->setChecked(config()->get(Config::GUI_HideUsernames).toBool());
|
||||
connect(m_ui->actionHideUsernames, &QAction::toggled, this, [](bool checked) {
|
||||
|
||||
Reference in New Issue
Block a user