1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17:35 +00:00

PixelPaint: Set Tool on_*_color_change logic using virtual functions

Previously, we were rewriting the on_primary_color_change in the Text
Tool and Gradient, which made the palette widget no longer update after
picking a color from an image. Additionally, it also crashed the program
after leaving the Gradient tool and trying to change color.
This commit is contained in:
Karol Kosek 2023-02-13 18:42:45 +01:00 committed by Sam Atkins
parent cb96c892cc
commit d27d19f012
7 changed files with 23 additions and 18 deletions

View file

@ -63,6 +63,8 @@ public:
virtual void on_second_paint(Layer const*, GUI::PaintEvent&) { }
virtual bool on_keydown(GUI::KeyEvent&);
virtual void on_keyup(GUI::KeyEvent&) { }
virtual void on_primary_color_change(Color) { }
virtual void on_secondary_color_change(Color) { }
virtual void on_tool_activation() { }
virtual void on_tool_deactivation() { }
virtual GUI::Widget* get_properties_widget() { return nullptr; }