Mercurial > hg > easyhg
diff mainwindow.cpp @ 230:e67bd8abc3e3
* Add settings for text verboseness and toolbar labels
author | Chris Cannam |
---|---|
date | Thu, 06 Jan 2011 15:15:02 +0000 |
parents | a1f4b5359051 |
children | 2f4d401ce47c |
line wrap: on
line diff
--- a/mainwindow.cpp Thu Jan 06 13:16:34 2011 +0000 +++ b/mainwindow.cpp Thu Jan 06 15:15:02 2011 +0000 @@ -1312,6 +1312,11 @@ { SettingsDialog *settingsDlg = new SettingsDialog(this); settingsDlg->exec(); + + if (settingsDlg->presentationChanged()) { + hgTabs->updateFileStates(); + updateToolBarStyle(); + } } #define STDOUT_NEEDS_BIG_WINDOW 512 @@ -2240,11 +2245,22 @@ workFolderToolBar->addAction(hgRemoveAct); workFolderToolBar -> setMovable(false); - foreach (QToolButton *tb, findChildren<QToolButton *>()) { - tb->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); - } + updateToolBarStyle(); } +void MainWindow::updateToolBarStyle() +{ + QSettings settings; + settings.beginGroup("Presentation"); + bool showText = settings.value("showiconlabels", true).toBool(); + settings.endGroup(); + + foreach (QToolButton *tb, findChildren<QToolButton *>()) { + tb->setToolButtonStyle(showText ? + Qt::ToolButtonTextUnderIcon : + Qt::ToolButtonIconOnly); + } +} void MainWindow::createStatusBar() {