VcsBase: Apply text editor's font settings to the output pane

Some of Git's output is formatted in a way that benefits from a
monospace font. Therefore, it would be useful to be able to set such a
font.

This change syncs the font of the Version Control output pane with the
text editor font. This is also the standard with other output panes.

Fixes: QTCREATORBUG-27164
Change-Id: Id579f18aef741d18f7434ecef35081ffc155ef1c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Alessandro Portale
2022-04-04 08:03:22 +02:00
parent e45766cdc8
commit 1464238eb5

View File

@@ -315,7 +315,12 @@ VcsOutputWindow::VcsOutputWindow()
TextEditor::TextEditorSettings::behaviorSettings().m_scrollWheelZooming);
};
auto updateFontSettings = [] {
d->widget.setBaseFont(TextEditor::TextEditorSettings::fontSettings().font());
};
updateBehaviorSettings();
updateFontSettings();
setupContext(Internal::C_VCS_OUTPUT_PANE, &d->widget);
connect(this, &IOutputPane::zoomInRequested, &d->widget, &Core::OutputWindow::zoomIn);
@@ -323,6 +328,8 @@ VcsOutputWindow::VcsOutputWindow()
connect(this, &IOutputPane::resetZoomRequested, &d->widget, &Core::OutputWindow::resetZoom);
connect(TextEditor::TextEditorSettings::instance(), &TextEditor::TextEditorSettings::behaviorSettingsChanged,
this, updateBehaviorSettings);
connect(TextEditor::TextEditorSettings::instance(),
&TextEditor::TextEditorSettings::fontSettingsChanged, this, updateFontSettings);
}
static QString filterPasswordFromUrls(QString input)