PixelPaint: Show Guides on GuideTool activation

This adds on_tool_activation() to Tool which GuideTool can use
to show guides, if they're hidden, when it's activated. Also
show guides on mousedown since there's no use in drawing invisible
guides.
This commit is contained in:
Marcus Nilsson 2021-08-13 22:40:29 +02:00 committed by Andreas Kling
commit 1ad08ab7d6
Notes: sideshowbarker 2024-07-18 06:58:13 +09:00
6 changed files with 40 additions and 3 deletions

View file

@ -316,10 +316,24 @@ void ImageEditor::set_active_tool(Tool* tool)
if (m_active_tool) {
m_active_tool->setup(*this);
m_active_tool->on_tool_activation();
m_active_cursor = m_active_tool->cursor();
}
}
void ImageEditor::set_guide_visibility(bool show_guides)
{
if (m_show_guides == show_guides)
return;
m_show_guides = show_guides;
if (on_set_guide_visibility)
on_set_guide_visibility(m_show_guides);
update();
}
void ImageEditor::layers_did_change()
{
update();