Mercurial > hg > sonic-visualiser
diff main/PreferencesDialog.cpp @ 225:d7ded015af32
* Make font size in panes configurable, with a smaller default
* Add [ and ] to select prev/next pane
author | Chris Cannam |
---|---|
date | Tue, 11 Dec 2007 14:58:29 +0000 |
parents | 98ba77e0d897 |
children | e3ff897a60bf |
line wrap: on
line diff
--- a/main/PreferencesDialog.cpp Fri Dec 07 16:47:31 2007 +0000 +++ b/main/PreferencesDialog.cpp Tue Dec 11 14:58:29 2007 +0000 @@ -30,6 +30,7 @@ #include <QLineEdit> #include <QFileDialog> #include <QMessageBox> +#include <QSpinBox> #include "widgets/WindowTypeSelector.h" #include "widgets/IconLoader.h" @@ -156,6 +157,18 @@ connect(bgMode, SIGNAL(currentIndexChanged(int)), this, SLOT(backgroundModeChanged(int))); + QSpinBox *fontSize = new QSpinBox; + int fs = prefs->getPropertyRangeAndValue("View Font Size", &min, &max, + &deflt); + fontSize->setMinimum(min); + fontSize->setMaximum(max); + fontSize->setSuffix(" pt"); + fontSize->setSingleStep(1); + fontSize->setValue(fs); + + connect(fontSize, SIGNAL(valueChanged(int)), + this, SLOT(viewFontSizeChanged(int))); + // General tab QFrame *frame = new QFrame; @@ -176,6 +189,11 @@ subgrid->addWidget(bgMode, row++, 1, 1, 2); subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel + ("View Font Size"))), + row, 0); + subgrid->addWidget(fontSize, row++, 1, 1, 2); + + subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel ("Resample On Load"))), row, 0); subgrid->addWidget(resampleOnLoad, row++, 1, 1, 1); @@ -315,6 +333,13 @@ } void +PreferencesDialog::viewFontSizeChanged(int sz) +{ + m_viewFontSize = sz; + m_applyButton->setEnabled(true); +} + +void PreferencesDialog::okClicked() { applyClicked(); @@ -335,6 +360,7 @@ prefs->setResampleOnLoad(m_resampleOnLoad); prefs->setTemporaryDirectoryRoot(m_tempDirRoot); prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode)); + prefs->setViewFontSize(m_viewFontSize); m_applyButton->setEnabled(false);