mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:07:45 +00:00
PixelPaint: Make tools use the new API for property change shortcuts
Every tool that has a slider now registers the primary/secondary sliders and now uses the same keyboard shortcuts to modify the primary and secondary properties. `[` and `]` for the primary, `{` and `}` for the secondary.
This commit is contained in:
parent
d28fb8926f
commit
280cbf2e18
10 changed files with 15 additions and 0 deletions
|
@ -106,6 +106,7 @@ void EllipseTool::on_second_paint(Layer const* layer, GUI::PaintEvent& event)
|
|||
|
||||
void EllipseTool::on_keydown(GUI::KeyEvent& event)
|
||||
{
|
||||
Tool::on_keydown(event);
|
||||
if (event.key() == Key_Escape && m_drawing_button != GUI::MouseButton::None) {
|
||||
m_drawing_button = GUI::MouseButton::None;
|
||||
m_editor->update();
|
||||
|
@ -134,6 +135,7 @@ GUI::Widget* EllipseTool::get_properties_widget()
|
|||
thickness_slider.on_change = [&](int value) {
|
||||
m_thickness = value;
|
||||
};
|
||||
set_primary_slider(&thickness_slider);
|
||||
|
||||
auto& mode_container = m_properties_widget->add<GUI::Widget>();
|
||||
mode_container.set_fixed_height(46);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue