1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

PixelPaint: Have layers and images send out notifications on changes

We use this to automatically update the thumbnail in LayerListWidget
when you draw into a layer. We also use it to repaint the ImageEditor
when the image changes somehow. :^)
This commit is contained in:
Andreas Kling 2020-05-25 22:49:50 +02:00
parent de85cd0907
commit dc3de47b03
14 changed files with 53 additions and 12 deletions

View file

@ -26,16 +26,18 @@
#pragma once
#include "Image.h"
#include <LibGUI/Frame.h>
#include <LibGfx/FloatPoint.h>
namespace PixelPaint {
class Image;
class Layer;
class Tool;
class ImageEditor final : public GUI::Frame {
class ImageEditor final
: public GUI::Frame
, public ImageClient {
C_OBJECT(ImageEditor);
public:
@ -91,6 +93,8 @@ private:
virtual void context_menu_event(GUI::ContextMenuEvent&) override;
virtual void resize_event(GUI::ResizeEvent&) override;
virtual void image_did_change() override;
GUI::MouseEvent event_adjusted_for_layer(const GUI::MouseEvent&, const Layer&) const;
GUI::MouseEvent event_with_pan_and_scale_applied(const GUI::MouseEvent&) const;