make zoom-in store the new size permanently in the settings.

This commit is contained in:
mae
2009-06-18 16:12:24 +02:00
parent 12ac317d0a
commit c3c98cca78
3 changed files with 11 additions and 6 deletions

View File

@@ -458,14 +458,17 @@ void FontSettingsPage::apply()
const int size = d_ptr->ui.sizeComboBox->currentText().toInt(&ok);
if (ok)
d_ptr->m_value.setFontSize(size);
saveSettings();
}
void FontSettingsPage::saveSettings()
{
if (d_ptr->m_value != d_ptr->m_lastValue) {
d_ptr->m_lastValue = d_ptr->m_value;
if (QSettings *settings = Core::ICore::instance()->settings())
d_ptr->m_value.toSettings(d_ptr->m_settingsGroup, d_ptr->m_descriptions, settings);
d_ptr->m_lastValue = d_ptr->m_value;
if (QSettings *settings = Core::ICore::instance()->settings())
d_ptr->m_value.toSettings(d_ptr->m_settingsGroup, d_ptr->m_descriptions, settings);
QTimer::singleShot(0, this, SLOT(delayedChange()));
QTimer::singleShot(0, this, SLOT(delayedChange()));
}
}

View File

@@ -96,6 +96,8 @@ public:
void apply();
void finish();
void saveSettings();
const FontSettings &fontSettings() const;
signals:

View File

@@ -175,7 +175,7 @@ void TextEditorSettings::fontSizeRequested(int pointSize)
{
FontSettings &fs = const_cast<FontSettings&>(m_fontSettingsPage->fontSettings());
fs.setFontSize(pointSize);
emit fontSettingsChanged(m_fontSettingsPage->fontSettings());
m_fontSettingsPage->saveSettings();
}
FontSettings TextEditorSettings::fontSettings() const