mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +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
|
@ -110,6 +110,7 @@ void RectangleSelectTool::on_mouseup(Layer*, MouseEvent& event)
|
|||
|
||||
void RectangleSelectTool::on_keydown(GUI::KeyEvent& key_event)
|
||||
{
|
||||
Tool::on_keydown(key_event);
|
||||
if (key_event.key() == KeyCode::Key_Space)
|
||||
m_moving_mode = MovingMode::MovingOrigin;
|
||||
else if (key_event.key() == KeyCode::Key_Control)
|
||||
|
@ -164,6 +165,7 @@ GUI::Widget* RectangleSelectTool::get_properties_widget()
|
|||
feather_slider.on_change = [&](int value) {
|
||||
m_edge_feathering = (float)value / (float)feather_slider_max;
|
||||
};
|
||||
set_primary_slider(&feather_slider);
|
||||
|
||||
auto& mode_container = m_properties_widget->add<GUI::Widget>();
|
||||
mode_container.set_fixed_height(20);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue