From 83d63464db912f030b4cbf2936a878d1c86c338d Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 4 Feb 2024 10:15:20 +0000 Subject: [PATCH] Fix #11966: Scrollbar may be incorrect on first opening of text file window. (#11981) The scrollbar is set up before the true monospace is loaded, so reinitialise the window after loading. --- src/textfile_gui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index 0e840b01a6..c07133f248 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -850,6 +850,9 @@ void TextfileWindow::LoadText(std::string_view buf) this->AfterLoadText(); CheckForMissingGlyphs(true, this); + + /* The font may have changed when searching for glyphs, so ensure widget sizes are updated just in case. */ + this->ReInit(); } /**