mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
This commit is contained in:
parent
f0409081f5
commit
c7d891765c
131 changed files with 422 additions and 421 deletions
|
@ -50,7 +50,7 @@ ToolboxWidget::~ToolboxWidget()
|
|||
void ToolboxWidget::setup_tools()
|
||||
{
|
||||
auto add_tool = [&](String name, StringView const& icon_name, GUI::Shortcut const& shortcut, NonnullOwnPtr<Tool> tool) {
|
||||
auto action = GUI::Action::create_checkable(move(name), shortcut, Gfx::Bitmap::load_from_file(String::formatted("/res/icons/pixelpaint/{}.png", icon_name)),
|
||||
auto action = GUI::Action::create_checkable(move(name), shortcut, Gfx::Bitmap::try_load_from_file(String::formatted("/res/icons/pixelpaint/{}.png", icon_name)),
|
||||
[this, tool = tool.ptr()](auto& action) {
|
||||
if (action.is_checked())
|
||||
on_tool_selection(tool);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue