mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-20 23:12:34 -05:00
Toolbar and tool buttons style. (#2357)
* Toolbar and tool buttons style. - Add ability to change toolbar state and tool buttons style via application settings widget. - Save/restore toolbar state on app start/finish. - Resolves #2343. * Implicitly convert enum to QVariant
This commit is contained in:
parent
f8c6c9f72c
commit
d09ca076dc
5 changed files with 134 additions and 1 deletions
|
|
@ -144,6 +144,7 @@ MainWindow::MainWindow()
|
|||
m_countDefaultAttributes = m_ui->menuEntryCopyAttribute->actions().size();
|
||||
|
||||
restoreGeometry(config()->get("GUI/MainWindowGeometry").toByteArray());
|
||||
restoreState(config()->get("GUI/MainWindowState").toByteArray());
|
||||
#ifdef WITH_XC_BROWSER
|
||||
m_ui->settingsWidget->addSettingsPage(new BrowserPlugin(m_ui->tabWidget));
|
||||
#endif
|
||||
|
|
@ -826,6 +827,7 @@ void MainWindow::saveWindowInformation()
|
|||
{
|
||||
if (isVisible()) {
|
||||
config()->set("GUI/MainWindowGeometry", saveGeometry());
|
||||
config()->set("GUI/MainWindowState", saveState());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -947,6 +949,13 @@ void MainWindow::applySettingsChanges()
|
|||
#endif
|
||||
|
||||
m_ui->toolBar->setHidden(config()->get("GUI/HideToolbar").toBool());
|
||||
m_ui->toolBar->setMovable(config()->get("GUI/MovableToolbar").toBool());
|
||||
|
||||
bool isOk = false;
|
||||
const auto toolButtonStyle = static_cast<Qt::ToolButtonStyle>(config()->get("GUI/ToolButtonStyle").toInt(&isOk));
|
||||
if (isOk) {
|
||||
m_ui->toolBar->setToolButtonStyle(toolButtonStyle);
|
||||
}
|
||||
|
||||
updateTrayIcon();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue