mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:57:44 +00:00
Userland: Use non-fallible EventReceiver::add()
where possible
This commit is contained in:
parent
707ca984bd
commit
b4e134cb52
54 changed files with 934 additions and 934 deletions
|
@ -111,13 +111,13 @@ ErrorOr<GUI::Widget*> TextTool::get_properties_widget()
|
|||
auto properties_widget = GUI::Widget::construct();
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto font_header = TRY(properties_widget->try_add<GUI::Label>("Current Font:"_string));
|
||||
font_header->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
auto& font_header = properties_widget->add<GUI::Label>("Current Font:"_string);
|
||||
font_header.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
m_font_label = TRY(properties_widget->try_add<GUI::Label>(m_selected_font->human_readable_name()));
|
||||
m_font_label = properties_widget->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& change_font_button = properties_widget->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(picker->font()->human_readable_name());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue