mirror of
https://github.com/RGBCube/serenity
synced 2025-05-24 20:25:07 +00:00
TextEditor: Save the selected font
This commit is contained in:
parent
c90024fbab
commit
0ce854cf73
1 changed files with 5 additions and 0 deletions
|
@ -64,6 +64,10 @@ MainWidget::MainWidget()
|
||||||
else
|
else
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
|
|
||||||
|
auto font_entry = Config::read_string("TextEditor"sv, "Text"sv, "Font"sv, "default"sv);
|
||||||
|
if (font_entry != "default")
|
||||||
|
m_editor->set_font(Gfx::FontDatabase::the().get_by_name(font_entry));
|
||||||
|
|
||||||
m_editor->on_change = Core::debounce([this] {
|
m_editor->on_change = Core::debounce([this] {
|
||||||
update_preview();
|
update_preview();
|
||||||
},
|
},
|
||||||
|
@ -436,6 +440,7 @@ void MainWidget::initialize_menubar(GUI::Window& window)
|
||||||
if (picker->exec() == GUI::Dialog::ExecResult::OK) {
|
if (picker->exec() == GUI::Dialog::ExecResult::OK) {
|
||||||
dbgln("setting font {}", picker->font()->qualified_name());
|
dbgln("setting font {}", picker->font()->qualified_name());
|
||||||
m_editor->set_font(picker->font());
|
m_editor->set_font(picker->font());
|
||||||
|
Config::write_string("TextEditor"sv, "Text"sv, "Font"sv, picker->font()->qualified_name());
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue