PixelPaint: Display an error message if opening a file fails

This commit is contained in:
Andreas Kling 2021-06-15 01:10:50 +02:00
commit 8731bc9ead
Notes: sideshowbarker 2024-07-18 12:14:14 +09:00
3 changed files with 48 additions and 38 deletions

View file

@ -38,7 +38,7 @@ protected:
class Image : public RefCounted<Image> {
public:
static RefPtr<Image> try_create_with_size(Gfx::IntSize const&);
static RefPtr<Image> try_create_from_file(String const& file_path);
static Result<NonnullRefPtr<Image>, String> try_create_from_file(String const& file_path);
static RefPtr<Image> try_create_from_bitmap(NonnullRefPtr<Gfx::Bitmap>);
size_t layer_count() const { return m_layers.size(); }
@ -76,7 +76,7 @@ public:
private:
explicit Image(Gfx::IntSize const&);
static RefPtr<Image> try_create_from_pixel_paint_file(String const& file_path);
static Result<NonnullRefPtr<Image>, String> try_create_from_pixel_paint_file(String const& file_path);
void did_change();
void did_modify_layer_stack();