WindowServer: Store system font queries in WindowServer.ini :^)
Changes to the system font settings are now persisted in /etc. Note that you still need to restart the system for changes to fully apply in all programs.
This commit is contained in:
parent
8ac0d4abe1
commit
59fd1f40ce
Notes:
sideshowbarker
2024-07-18 17:37:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/59fd1f40cec
3 changed files with 13 additions and 2 deletions
|
@ -3,6 +3,10 @@ Width=1024
|
|||
Height=768
|
||||
ScaleFactor=1
|
||||
|
||||
[Fonts]
|
||||
Default=Katica 10 400
|
||||
FixedWidth=Csilla 10 400
|
||||
|
||||
[Theme]
|
||||
Name=Default
|
||||
|
||||
|
|
|
@ -724,6 +724,10 @@ Messages::WindowServer::SetSystemFontsResponse ClientConnection::set_system_font
|
|||
});
|
||||
|
||||
WindowManager::the().invalidate_after_theme_or_font_change();
|
||||
|
||||
auto wm_config = Core::ConfigFile::open("/etc/WindowServer.ini");
|
||||
wm_config->write_entry("Fonts", "Default", default_font_query);
|
||||
wm_config->write_entry("Fonts", "FixedWidth", fixed_width_font_query);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,8 +62,11 @@ int main(int, char**)
|
|||
Gfx::set_system_theme(theme);
|
||||
auto palette = Gfx::PaletteImpl::create_with_anonymous_buffer(theme);
|
||||
|
||||
Gfx::FontDatabase::set_default_font_query("Katica 10 400");
|
||||
Gfx::FontDatabase::set_fixed_width_font_query("Csilla 10 400");
|
||||
auto default_font_query = wm_config->read_entry("Fonts", "Default", "Katica 10 400");
|
||||
auto fixed_width_font_query = wm_config->read_entry("Fonts", "FixedWidth", "Csilla 10 400");
|
||||
|
||||
Gfx::FontDatabase::set_default_font_query(default_font_query);
|
||||
Gfx::FontDatabase::set_fixed_width_font_query(fixed_width_font_query);
|
||||
|
||||
WindowServer::EventLoop loop;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue