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

LibGfx: Convert Font APIs to return String instead of DeprecatedString

This commit is contained in:
Andreas Kling 2023-09-05 15:32:52 +02:00 committed by Tim Flynn
parent 4e9dc127ae
commit 545d8336b8
29 changed files with 106 additions and 104 deletions

View file

@ -114,13 +114,13 @@ ErrorOr<GUI::Widget*> TextTool::get_properties_widget()
auto font_header = TRY(properties_widget->try_add<GUI::Label>("Current Font:"_string));
font_header->set_text_alignment(Gfx::TextAlignment::CenterLeft);
m_font_label = TRY(properties_widget->try_add<GUI::Label>(TRY(String::from_deprecated_string(m_selected_font->human_readable_name()))));
m_font_label = TRY(properties_widget->try_add<GUI::Label>(m_selected_font->human_readable_name()));
auto change_font_button = TRY(properties_widget->try_add<GUI::Button>("Change Font..."_string));
change_font_button->on_click = [this](auto) {
auto picker = GUI::FontPicker::construct(nullptr, m_selected_font, false);
if (picker->exec() == GUI::Dialog::ExecResult::OK) {
m_font_label->set_text(String::from_deprecated_string(picker->font()->human_readable_name()).release_value_but_fixme_should_propagate_errors());
m_font_label->set_text(picker->font()->human_readable_name());
m_selected_font = picker->font();
m_text_editor->set_font(m_selected_font);
m_editor->set_focus(true);