mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
PixelPaint: Allow tools to know when the user has left them
This commit is contained in:
parent
d28c9ba054
commit
a321df12e1
Notes:
sideshowbarker
2024-07-17 03:05:18 +09:00
Author: https://github.com/tslater2006 Commit: https://github.com/SerenityOS/serenity/commit/a321df12e1 Pull-request: https://github.com/SerenityOS/serenity/pull/15828 Reviewed-by: https://github.com/AtkinsSJ ✅ Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/gmta
2 changed files with 4 additions and 1 deletions
|
@ -521,8 +521,10 @@ void ImageEditor::set_active_tool(Tool* tool)
|
|||
return;
|
||||
}
|
||||
|
||||
if (m_active_tool)
|
||||
if (m_active_tool) {
|
||||
m_active_tool->on_tool_deactivation();
|
||||
m_active_tool->clear();
|
||||
}
|
||||
|
||||
m_active_tool = tool;
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ public:
|
|||
virtual bool on_keydown(GUI::KeyEvent const&);
|
||||
virtual void on_keyup(GUI::KeyEvent&) { }
|
||||
virtual void on_tool_activation() { }
|
||||
virtual void on_tool_deactivation() { }
|
||||
virtual GUI::Widget* get_properties_widget() { return nullptr; }
|
||||
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> cursor() { return Gfx::StandardCursor::None; }
|
||||
virtual Gfx::IntPoint point_position_to_preferred_cell(Gfx::FloatPoint position) const { return position.to_type<int>(); }
|
||||
|
|
Loading…
Reference in a new issue