FontSettingsWidget: Display the default (fixed-width) font's name

Previously, the font was applied to the Labels but the name wasn't
updated on initial startup.
This meant that the Label's content was only correct in the default
state but not if the user changed the defaults.
This commit is contained in:
Thomas Keppler 2021-05-23 17:07:38 +02:00 committed by Linus Groh
parent ad6587424f
commit 883d0d2466
Notes: sideshowbarker 2024-07-18 17:28:27 +09:00

View File

@ -23,8 +23,13 @@ FontSettingsWidget::FontSettingsWidget()
auto& fixed_width_font_label = *find_descendant_of_type_named<GUI::Label>("fixed_width_font_label");
auto& fixed_width_font_button = *find_descendant_of_type_named<GUI::Button>("fixed_width_font_button");
default_font_label.set_font(Gfx::FontDatabase::default_font());
fixed_width_font_label.set_font(Gfx::FontDatabase::default_fixed_width_font());
auto& default_font = Gfx::FontDatabase::default_font();
default_font_label.set_font(default_font);
default_font_label.set_text(default_font.qualified_name());
auto& default_fixed_width_font = Gfx::FontDatabase::default_fixed_width_font();
fixed_width_font_label.set_font(default_fixed_width_font);
fixed_width_font_label.set_text(default_fixed_width_font.qualified_name());
default_font_button.on_click = [this, &default_font_label] {
auto font_picker = GUI::FontPicker::construct(window(), &default_font_label.font(), false);