mirror of
				https://github.com/keepassxreboot/keepassxc.git
				synced 2025-11-03 15:18:08 -05:00 
			
		
		
		
	Persist Always on Top setting
This commit is contained in:
		
							parent
							
								
									bc08913c61
								
							
						
					
					
						commit
						d6b69204a6
					
				
					 3 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -94,6 +94,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
 | 
			
		|||
    {Config::GUI_MovableToolbar, {QS("GUI/MovableToolbar"), Roaming, false}},
 | 
			
		||||
    {Config::GUI_HideGroupsPanel, {QS("GUI/HideGroupsPanel"), 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, {}}},
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -76,6 +76,7 @@ public:
 | 
			
		|||
        GUI_MovableToolbar,
 | 
			
		||||
        GUI_HideGroupsPanel,
 | 
			
		||||
        GUI_HidePreviewPanel,
 | 
			
		||||
        GUI_AlwaysOnTop,
 | 
			
		||||
        GUI_ToolButtonStyle,
 | 
			
		||||
        GUI_ShowTrayIcon,
 | 
			
		||||
        GUI_TrayIconAppearance,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1831,6 +1831,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 {
 | 
			
		||||
| 
						 | 
				
			
			@ -1838,6 +1839,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) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue