mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 13:07:47 +00:00
FontEditor: Propagate errors formatting preview text
This commit is contained in:
parent
5ec9654477
commit
36641187d1
1 changed files with 6 additions and 2 deletions
|
@ -87,8 +87,12 @@ ErrorOr<RefPtr<GUI::Window>> MainWidget::create_preview_window()
|
||||||
|
|
||||||
m_preview_textbox = find_descendant_of_type_named<GUI::TextBox>("preview_textbox");
|
m_preview_textbox = find_descendant_of_type_named<GUI::TextBox>("preview_textbox");
|
||||||
m_preview_textbox->on_change = [&] {
|
m_preview_textbox->on_change = [&] {
|
||||||
auto preview = String::formatted("{}\n{}", m_preview_textbox->text(), Unicode::to_unicode_uppercase_full(m_preview_textbox->text()).release_value_but_fixme_should_propagate_errors()).release_value_but_fixme_should_propagate_errors();
|
auto maybe_preview = [](StringView text) -> ErrorOr<String> {
|
||||||
m_preview_label->set_text(preview);
|
return TRY(String::formatted("{}\n{}", text, TRY(Unicode::to_unicode_uppercase_full(text))));
|
||||||
|
}(m_preview_textbox->text());
|
||||||
|
if (maybe_preview.is_error())
|
||||||
|
return show_error(maybe_preview.release_error(), "Formatting preview text failed"sv);
|
||||||
|
m_preview_label->set_text(maybe_preview.release_value());
|
||||||
};
|
};
|
||||||
m_preview_textbox->set_text(pangrams[0]);
|
m_preview_textbox->set_text(pangrams[0]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue