mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
PixelPaint: Make tool properties widget construction non-fallible
`Tool::get_properties_widget()` now also returns a NNRP to a widget rather than a raw pointer.
This commit is contained in:
parent
5df88dab07
commit
f34b1c7a7e
41 changed files with 72 additions and 85 deletions
|
@ -41,7 +41,7 @@ void PickerTool::on_mousemove(Layer* layer, MouseEvent& event)
|
|||
m_editor->set_editor_color_to_color_at_mouse_position(layer_event, m_sample_all_layers);
|
||||
}
|
||||
|
||||
ErrorOr<GUI::Widget*> PickerTool::get_properties_widget()
|
||||
NonnullRefPtr<GUI::Widget> PickerTool::get_properties_widget()
|
||||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = GUI::Widget::construct();
|
||||
|
@ -55,7 +55,7 @@ ErrorOr<GUI::Widget*> PickerTool::get_properties_widget()
|
|||
m_properties_widget = properties_widget;
|
||||
}
|
||||
|
||||
return m_properties_widget.ptr();
|
||||
return *m_properties_widget;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue