mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 02:38:11 +00:00
PaintBrush: Add a color picker tool.
This commit is contained in:
parent
41613e4303
commit
25fd847ef2
8 changed files with 71 additions and 2 deletions
|
@ -72,3 +72,21 @@ void PaintableWidget::mousemove_event(GMouseEvent& event)
|
|||
if (m_tool)
|
||||
m_tool->on_mousemove(event);
|
||||
}
|
||||
|
||||
void PaintableWidget::set_primary_color(Color color)
|
||||
{
|
||||
if (m_primary_color == color)
|
||||
return;
|
||||
m_primary_color = color;
|
||||
if (on_primary_color_change)
|
||||
on_primary_color_change(color);
|
||||
}
|
||||
|
||||
void PaintableWidget::set_secondary_color(Color color)
|
||||
{
|
||||
if (m_secondary_color == color)
|
||||
return;
|
||||
m_secondary_color = color;
|
||||
if (on_secondary_color_change)
|
||||
on_secondary_color_change(color);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue