diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 15706bed0..1eff09656 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -43,9 +43,14 @@ MainWindow::MainWindow() QAction* toggleViewAction = m_ui->toolBar->toggleViewAction(); toggleViewAction->setText(tr("Show toolbar")); m_ui->menuView->addAction(toggleViewAction); + int toolbarIconSize = config()->get("ToolbarIconSize", 20).toInt(); + setToolbarIconSize(toolbarIconSize); bool showToolbar = config()->get("ShowToolbar").toBool(); m_ui->toolBar->setVisible(showToolbar); connect(m_ui->toolBar, SIGNAL(visibilityChanged(bool)), this, SLOT(saveToolbarState(bool))); + connect(m_ui->actionToolbarIconSize16, SIGNAL(triggered()), this, SLOT(setToolbarIconSize16())); + connect(m_ui->actionToolbarIconSize22, SIGNAL(triggered()), this, SLOT(setToolbarIconSize22())); + connect(m_ui->actionToolbarIconSize28, SIGNAL(triggered()), this, SLOT(setToolbarIconSize28())); m_clearHistoryAction = new QAction("Clear history", m_ui->menuFile); m_lastDatabasesActions = new QActionGroup(m_ui->menuRecentDatabases); @@ -420,6 +425,30 @@ void MainWindow::saveToolbarState(bool value) config()->set("ShowToolbar", value); } +void MainWindow::setToolbarIconSize(int size) +{ + config()->set("ToolbarIconSize", size); + m_ui->toolBar->setIconSize(QSize(size, size)); + m_ui->actionToolbarIconSize16->setChecked(size == 16); + m_ui->actionToolbarIconSize22->setChecked(size == 22); + m_ui->actionToolbarIconSize28->setChecked(size == 28); +} + +void MainWindow::setToolbarIconSize16() +{ + setToolbarIconSize(16); +} + +void MainWindow::setToolbarIconSize22() +{ + setToolbarIconSize(22); +} + +void MainWindow::setToolbarIconSize28() +{ + setToolbarIconSize(28); +} + void MainWindow::setShortcut(QAction* action, QKeySequence::StandardKey standard, int fallback) { if (!QKeySequence::keyBindings(standard).isEmpty()) { diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index b6c309145..60da08010 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -57,6 +57,10 @@ private Q_SLOTS: void showEntryContextMenu(const QPoint& globalPos); void showGroupContextMenu(const QPoint& globalPos); void saveToolbarState(bool value); + void setToolbarIconSize(int size); + void setToolbarIconSize16(); + void setToolbarIconSize22(); + void setToolbarIconSize28(); private: static void setShortcut(QAction* action, QKeySequence::StandardKey standard, int fallback = 0); diff --git a/src/gui/MainWindow.ui b/src/gui/MainWindow.ui index 74f04b530..ec05f82ee 100644 --- a/src/gui/MainWindow.ui +++ b/src/gui/MainWindow.ui @@ -70,7 +70,7 @@ 0 0 800 - 20 + 24 @@ -143,6 +143,15 @@ View + + + Toolbar &Icon Size + + + + + + @@ -346,6 +355,30 @@ Lock databases + + + true + + + &16x16 + + + + + true + + + &22x22 + + + + + true + + + 2&8x28 + +