From b8552d5d48335e397a9fddc994542c1fba4d5670 Mon Sep 17 00:00:00 2001 From: Giuseppe Penone Date: Wed, 14 Apr 2021 21:36:40 +0100 Subject: [PATCH] fix zooming text/tree font not being properly enforced like preferences dialog does (#1568) --- src/ct/ct_main_win.cc | 2 +- src/ct/ct_widgets.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ct/ct_main_win.cc b/src/ct/ct_main_win.cc index a18eef3af..0967bee95 100644 --- a/src/ct/ct_main_win.cc +++ b/src/ct/ct_main_win.cc @@ -532,8 +532,8 @@ void CtMainWin::_zoom_tree(bool is_increase) int size = fontDesc.get_size() / Pango::SCALE + (is_increase ? 1 : -1); if (size < 6) size = 6; fontDesc.set_size(size * Pango::SCALE); - _uCtTreeview->override_font(fontDesc); _pCtConfig->treeFont = CtFontUtil::get_font_str(fontDesc); + signal_app_apply_for_each_window([](CtMainWin* win) { win->update_theme(); }); } void CtMainWin::reset() diff --git a/src/ct/ct_widgets.cc b/src/ct/ct_widgets.cc index f7c94a310..21aa9fef1 100644 --- a/src/ct/ct_widgets.cc +++ b/src/ct/ct_widgets.cc @@ -737,7 +737,6 @@ void CtTextView::zoom_text(const bool is_increase, const std::string& syntaxHigh int size = fontDesc.get_size() / Pango::SCALE + (is_increase ? 1 : -1); if (size < 6) size = 6; fontDesc.set_size(size * Pango::SCALE); - override_font(fontDesc); if (syntaxHighlighting == CtConst::RICH_TEXT_ID) { auto pCtConfig = _pCtMainWin->get_ct_config(); @@ -761,6 +760,7 @@ void CtTextView::zoom_text(const bool is_increase, const std::string& syntaxHigh else { _pCtMainWin->get_ct_config()->codeFont = CtFontUtil::get_font_str(fontDesc); } + _pCtMainWin->signal_app_apply_for_each_window([](CtMainWin* win) { win->update_theme(); }); } void CtTextView::set_spell_check(bool allow_on)