PixelPaint: Add ImageEditor::update_tool_cursor()
method
This just allows us to ask the image editor to update the tool's current cursor. This is useful in cases where a tool may want to change it's cursor for some operation, and wants to invalidate the active cursor cached in the ImageEditor.
This commit is contained in:
parent
0472063b96
commit
11263beaca
Notes:
sideshowbarker
2024-07-18 04:00:27 +09:00
Author: https://github.com/mustafaquraish Commit: https://github.com/SerenityOS/serenity/commit/11263beaca8 Pull-request: https://github.com/SerenityOS/serenity/pull/10007 Reviewed-by: https://github.com/TobyAsE ✅
2 changed files with 9 additions and 0 deletions
Userland/Applications/PixelPaint
|
@ -442,6 +442,14 @@ void ImageEditor::set_active_tool(Tool* tool)
|
|||
}
|
||||
}
|
||||
|
||||
void ImageEditor::update_tool_cursor()
|
||||
{
|
||||
if (m_active_tool) {
|
||||
m_active_cursor = m_active_tool->cursor();
|
||||
set_override_cursor(m_active_cursor);
|
||||
}
|
||||
}
|
||||
|
||||
void ImageEditor::set_guide_visibility(bool show_guides)
|
||||
{
|
||||
if (m_show_guides == show_guides)
|
||||
|
|
|
@ -36,6 +36,7 @@ public:
|
|||
|
||||
Tool* active_tool() { return m_active_tool; }
|
||||
void set_active_tool(Tool*);
|
||||
void update_tool_cursor();
|
||||
|
||||
void did_complete_action();
|
||||
bool undo();
|
||||
|
|
Loading…
Add table
Reference in a new issue