mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
PixelPaint: Register RectangleTool thickness slider as primary
... So we can use `[` and `]` shortcuts to change the size.
This commit is contained in:
parent
d6348e1b32
commit
255f729c1f
Notes:
sideshowbarker
2024-07-18 04:30:38 +09:00
Author: https://github.com/mustafaquraish Commit: https://github.com/SerenityOS/serenity/commit/255f729c1f1 Pull-request: https://github.com/SerenityOS/serenity/pull/9870
1 changed files with 3 additions and 1 deletions
|
@ -107,11 +107,12 @@ void RectangleTool::on_second_paint(Layer const* layer, GUI::PaintEvent& event)
|
|||
painter.add_clip_rect(event.rect());
|
||||
auto start_position = m_editor->layer_position_to_editor_position(*layer, m_rectangle_start_position).to_type<int>();
|
||||
auto end_position = m_editor->layer_position_to_editor_position(*layer, m_rectangle_end_position).to_type<int>();
|
||||
draw_using(painter, start_position, end_position);
|
||||
draw_using(painter, start_position, end_position, m_thickness * m_editor->scale());
|
||||
}
|
||||
|
||||
void RectangleTool::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();
|
||||
|
@ -140,6 +141,7 @@ GUI::Widget* RectangleTool::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(70);
|
||||
|
|
Loading…
Reference in a new issue