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

DisplaySettings: Propagate errors in FontSettingsWidget

This commit is contained in:
implicitfield 2023-02-11 19:14:20 +02:00 committed by Andreas Kling
parent 00be9eb210
commit 682bff4c49
2 changed files with 15 additions and 4 deletions

View file

@ -17,9 +17,16 @@ namespace DisplaySettings {
static void update_label_with_font(GUI::Label&, Gfx::Font const&);
FontSettingsWidget::FontSettingsWidget()
ErrorOr<NonnullRefPtr<FontSettingsWidget>> FontSettingsWidget::try_create()
{
load_from_gml(font_settings_gml).release_value_but_fixme_should_propagate_errors();
auto font_settings_widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) FontSettingsWidget()));
TRY(font_settings_widget->setup_interface());
return font_settings_widget;
}
ErrorOr<void> FontSettingsWidget::setup_interface()
{
TRY(load_from_gml(font_settings_gml));
auto& default_font = Gfx::FontDatabase::default_font();
m_default_font_label = *find_descendant_of_type_named<GUI::Label>("default_font_label");
@ -59,6 +66,8 @@ FontSettingsWidget::FontSettingsWidget()
set_modified(true);
}
};
return {};
}
static void update_label_with_font(GUI::Label& label, Gfx::Font const& font)