New toolbars, new action icons and toolbar style preference

Two new application toolbars: Extra DB (attach, close database) and Project
(Open, Save). Can be disabled and moved as usual.

Icons for Close Database and Attach Database actions, which lacked ones.

Different icon for the dock configuration, so they are visually
distinguishable from the toolbar configurations.

New preference for the toolbar style, with default value: text besides icon
as before. But in order for the style to change, the value in UI must be
ToolButtonIconOnly.

Needed new icons from famfamfam.com's Silk collection.

See related issue #331
This commit is contained in:
mgrojo
2017-12-04 22:49:06 +01:00
parent 5707b3139f
commit 8fbf44bffe
8 changed files with 248 additions and 9 deletions

View File

@@ -199,7 +199,6 @@ void MainWindow::init()
ui->viewMenu->insertAction(ui->viewDBToolbarAction, ui->dockLog->toggleViewAction());
ui->viewMenu->actions().at(0)->setShortcut(QKeySequence(tr("Ctrl+L")));
ui->viewMenu->actions().at(0)->setIcon(QIcon(":/icons/log_dock"));
ui->viewDBToolbarAction->setChecked(!ui->toolbarDB->isHidden());
// Add menu item for plot dock
ui->viewMenu->insertAction(ui->viewDBToolbarAction, ui->dockPlot->toggleViewAction());
@@ -222,6 +221,14 @@ void MainWindow::init()
ui->viewMenu->insertAction(ui->viewDBToolbarAction, ui->dockRemote->toggleViewAction());
ui->viewMenu->actions().at(4)->setIcon(QIcon(":/icons/log_dock"));
// Set checked state if toolbar is visible
ui->viewDBToolbarAction->setChecked(!ui->toolbarDB->isHidden());
ui->viewExtraDBToolbarAction->setChecked(!ui->toolbarExtraDB->isHidden());
ui->viewProjectToolbarAction->setChecked(!ui->toolbarProject->isHidden());
// Add separator between docks and toolbars
ui->viewMenu->insertSeparator(ui->viewDBToolbarAction);
// If we're not compiling in SQLCipher, hide its FAQ link in the help menu
#ifndef ENABLE_SQLCIPHER
ui->actionSqlCipherFaq->setVisible(false);
@@ -1903,6 +1910,8 @@ void MainWindow::reloadSettings()
// Set data browser font
ui->dataTable->reloadSettings();
setToolButtonStyle(static_cast<Qt::ToolButtonStyle>(Settings::getValue("General", "toolbarStyle").toInt()));
// Set prefetch sizes for lazy population of table models
m_browseTableModel->setChunkSize(Settings::getValue("db", "prefetchsize").toInt());
for(int i=0;i<ui->tabSqlAreas->count();++i)