1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 14:37:45 +00:00

LibGfx: Use "try_" prefix for static factory functions

Also mark them as [[nodiscard]].
This commit is contained in:
Andreas Kling 2021-07-21 18:02:15 +02:00
parent f0409081f5
commit c7d891765c
131 changed files with 422 additions and 421 deletions

View file

@ -190,7 +190,7 @@ void BookmarksBarWidget::model_did_update(unsigned)
button.set_button_style(Gfx::ButtonStyle::Coolbar);
button.set_text(title);
button.set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png"));
button.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-html.png"));
button.set_fixed_size(font().width(title) + 32, 20);
button.set_relative_rect(rect);
button.set_focus_policy(GUI::FocusPolicy::TabFocus);
@ -242,7 +242,7 @@ void BookmarksBarWidget::update_content_size()
auto& bookmark = m_bookmarks.at(i);
bookmark.set_visible(false);
m_additional_menu->add_action(GUI::Action::create(bookmark.text(),
Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png"),
Gfx::Bitmap::try_load_from_file("/res/icons/16x16/filetype-html.png"),
[&](auto&) {
bookmark.on_click(0);
}));