From 1464238eb52d2cc1a4ec4b63e3b5d2a3789aa1bf Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 4 Apr 2022 08:03:22 +0200 Subject: [PATCH] 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: Reviewed-by: Orgad Shaneh --- src/plugins/vcsbase/vcsoutputwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/vcsbase/vcsoutputwindow.cpp b/src/plugins/vcsbase/vcsoutputwindow.cpp index 5151bc71fe6..ec00b8e829b 100644 --- a/src/plugins/vcsbase/vcsoutputwindow.cpp +++ b/src/plugins/vcsbase/vcsoutputwindow.cpp @@ -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)