mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:57:35 +00:00
PixelPaint: Show more specific Undo/Redo action text
The Undo/Redo actions now tell you what kind of action will be undone/redone. This is achieved by adding an "action text" field to the ImageUndoCommand and having everyone who calls did_complete_action() provide this text.
This commit is contained in:
parent
101eb53de5
commit
bf25b0a0b5
15 changed files with 57 additions and 20 deletions
|
@ -67,7 +67,7 @@ void BrushTool::on_mousemove(Layer* layer, MouseEvent& event)
|
|||
void BrushTool::on_mouseup(Layer*, MouseEvent&)
|
||||
{
|
||||
if (m_was_drawing) {
|
||||
m_editor->did_complete_action();
|
||||
m_editor->did_complete_action(tool_name());
|
||||
m_was_drawing = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ void BucketTool::on_mousedown(Layer* layer, MouseEvent& event)
|
|||
flood_fill(layer->currently_edited_bitmap(), layer_event.position(), target_color, m_editor->color_for(layer_event), m_threshold);
|
||||
|
||||
layer->did_modify_bitmap();
|
||||
m_editor->did_complete_action();
|
||||
m_editor->did_complete_action(tool_name());
|
||||
}
|
||||
|
||||
GUI::Widget* BucketTool::get_properties_widget()
|
||||
|
|
|
@ -88,7 +88,7 @@ void EllipseTool::on_mouseup(Layer* layer, MouseEvent& event)
|
|||
m_drawing_button = GUI::MouseButton::None;
|
||||
layer->did_modify_bitmap();
|
||||
m_editor->update();
|
||||
m_editor->did_complete_action();
|
||||
m_editor->did_complete_action(tool_name());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ void LineTool::on_mouseup(Layer* layer, MouseEvent& event)
|
|||
m_drawing_button = GUI::MouseButton::None;
|
||||
layer->did_modify_bitmap();
|
||||
m_editor->update();
|
||||
m_editor->did_complete_action();
|
||||
m_editor->did_complete_action(tool_name());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ void MoveTool::on_mouseup(Layer* layer, MouseEvent& event)
|
|||
if (layer_event.button() != GUI::MouseButton::Primary)
|
||||
return;
|
||||
m_layer_being_moved = nullptr;
|
||||
m_editor->did_complete_action();
|
||||
m_editor->did_complete_action(tool_name());
|
||||
}
|
||||
|
||||
void MoveTool::on_keydown(GUI::KeyEvent& event)
|
||||
|
|
|
@ -92,7 +92,7 @@ void RectangleTool::on_mouseup(Layer* layer, MouseEvent& event)
|
|||
m_drawing_button = GUI::MouseButton::None;
|
||||
layer->did_modify_bitmap();
|
||||
m_editor->update();
|
||||
m_editor->did_complete_action();
|
||||
m_editor->did_complete_action(tool_name());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ void SprayTool::on_mouseup(Layer*, MouseEvent&)
|
|||
{
|
||||
if (m_timer->is_active()) {
|
||||
m_timer->stop();
|
||||
m_editor->did_complete_action();
|
||||
m_editor->did_complete_action(tool_name());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue