1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

LibVT+Terminal: Resize terminal when font changes

When the font is changed in the Terminal application, we now resize the
terminal window to accomodate the new font.
This commit is contained in:
Andreas Kling 2021-01-09 13:46:22 +01:00
parent 9d6198b683
commit 6a19542715
3 changed files with 23 additions and 3 deletions

View file

@ -417,7 +417,8 @@ int main(int argc, char** argv)
[&](auto&) {
auto picker = GUI::FontPicker::construct(window, &terminal.font(), true);
if (picker->exec() == GUI::Dialog::ExecOK) {
terminal.set_font(picker->font());
terminal.set_font_and_resize_to_fit(*picker->font());
window->resize(terminal.size());
config->write_entry("Text", "Font", picker->font()->qualified_name());
config->sync();
}