mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +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:
@@ -41,11 +41,9 @@ TextTool::TextTool()
|
||||
}).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
void TextTool::on_tool_activation()
|
||||
void TextTool::on_primary_color_change(Color color)
|
||||
{
|
||||
m_editor->on_primary_color_change = [this](auto color) {
|
||||
m_text_color = color;
|
||||
};
|
||||
m_text_color = color;
|
||||
}
|
||||
|
||||
void TextTool::on_tool_deactivation()
|
||||
|
||||
Reference in New Issue
Block a user