make zoom-in/-out apply to all editors

This commit is contained in:
mae
2009-06-17 19:12:19 +02:00
parent 69ff0eeb83
commit aa630932b1
8 changed files with 49 additions and 10 deletions

View File

@@ -152,7 +152,7 @@ void TextEditorSettings::initializeEditor(BaseTextEditor *editor)
{
// Connect to settings change signals
connect(this, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
editor, SLOT(setFontSettings(TextEditor::FontSettings)));
editor, SLOT(setFontSettingsIfVisible(TextEditor::FontSettings)));
connect(this, SIGNAL(tabSettingsChanged(TextEditor::TabSettings)),
editor, SLOT(setTabSettings(TextEditor::TabSettings)));
connect(this, SIGNAL(storageSettingsChanged(TextEditor::StorageSettings)),
@@ -160,6 +160,9 @@ void TextEditorSettings::initializeEditor(BaseTextEditor *editor)
connect(this, SIGNAL(displaySettingsChanged(TextEditor::DisplaySettings)),
editor, SLOT(setDisplaySettings(TextEditor::DisplaySettings)));
connect(editor, SIGNAL(requestFontSize(int)),
this, SLOT(fontSizeRequested(int)));
// Apply current settings (tab settings depend on font settings)
editor->setFontSettings(fontSettings());
editor->setTabSettings(tabSettings());
@@ -167,6 +170,14 @@ void TextEditorSettings::initializeEditor(BaseTextEditor *editor)
editor->setDisplaySettings(displaySettings());
}
void TextEditorSettings::fontSizeRequested(int pointSize)
{
FontSettings &fs = const_cast<FontSettings&>(m_fontSettingsPage->fontSettings());
fs.setFontSize(pointSize);
emit fontSettingsChanged(m_fontSettingsPage->fontSettings());
}
FontSettings TextEditorSettings::fontSettings() const
{
return m_fontSettingsPage->fontSettings();