Add "Zoom" setting to the Help font settings

If the scrollWheelZooming is enabled, this
setting will get updated when using scroll wheel.
It will also be used when zooming in/out
by using keyboard shortcuts.

Fixes: QTCREATORBUG-25109
Fixes: QTCREATORBUG-25230
Fixes: QTCREATORBUG-23731
Change-Id: I9d22632b4c034ce236fa39dba074df4a2746ff84
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2021-01-14 13:21:15 +01:00
parent aa974e6816
commit 291f46386f
20 changed files with 188 additions and 230 deletions

View File

@@ -70,6 +70,8 @@ QWidget *GeneralSettingsPage::widget()
m_ui->styleComboBox->setEditable(false);
m_font = LocalHelpManager::fallbackFont();
m_fontZoom = LocalHelpManager::fontZoom();
m_ui->zoomSpinBox->setValue(m_fontZoom);
updateFontSizeSelector();
updateFontStyleSelector();
@@ -92,6 +94,9 @@ QWidget *GeneralSettingsPage::widget()
connect(m_ui->sizeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &GeneralSettingsPage::updateFont);
connect(m_ui->zoomSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
this, [this](int value) { m_fontZoom = value; });
m_homePage = LocalHelpManager::homePage();
m_ui->homePageLineEdit->setText(m_homePage);
@@ -150,10 +155,11 @@ void GeneralSettingsPage::apply()
if (!m_ui) // page was never shown
return;
if (m_font != LocalHelpManager::fallbackFont()) {
if (m_font != LocalHelpManager::fallbackFont())
LocalHelpManager::setFallbackFont(m_font);
emit fontChanged();
}
if (m_fontZoom != LocalHelpManager::fontZoom())
LocalHelpManager::setFontZoom(m_fontZoom);
QString homePage = QUrl::fromUserInput(m_ui->homePageLineEdit->text()).toString();
if (homePage.isEmpty())