diff --git a/Userland/Applications/PixelPaint/RectangleTool.cpp b/Userland/Applications/PixelPaint/RectangleTool.cpp index 34b9395c33..19592fb694 100644 --- a/Userland/Applications/PixelPaint/RectangleTool.cpp +++ b/Userland/Applications/PixelPaint/RectangleTool.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include namespace PixelPaint { @@ -41,7 +42,7 @@ void RectangleTool::draw_using(GUI::Painter& painter, Gfx::IntPoint const& start painter.fill_rect(rect, m_editor->color_for(m_drawing_button)); break; case FillMode::Outline: - painter.draw_rect(rect, m_editor->color_for(m_drawing_button)); + painter.draw_rect_with_thickness(rect, m_editor->color_for(m_drawing_button), m_thickness); break; case FillMode::Gradient: painter.fill_rect_with_gradient(rect, m_editor->primary_color(), m_editor->secondary_color()); @@ -124,6 +125,22 @@ GUI::Widget* RectangleTool::get_properties_widget() m_properties_widget = GUI::Widget::construct(); m_properties_widget->set_layout(); + auto& thickness_container = m_properties_widget->add(); + thickness_container.set_fixed_height(20); + thickness_container.set_layout(); + + auto& thickness_label = thickness_container.add("Thickness:"); + thickness_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); + thickness_label.set_fixed_size(80, 20); + + auto& thickness_slider = thickness_container.add(Orientation::Horizontal, "px"); + thickness_slider.set_range(1, 10); + thickness_slider.set_value(m_thickness); + + thickness_slider.on_change = [&](int value) { + m_thickness = value; + }; + auto& mode_container = m_properties_widget->add(); mode_container.set_fixed_height(70); mode_container.set_layout(); diff --git a/Userland/Applications/PixelPaint/RectangleTool.h b/Userland/Applications/PixelPaint/RectangleTool.h index f84e4031cb..c74ceed66e 100644 --- a/Userland/Applications/PixelPaint/RectangleTool.h +++ b/Userland/Applications/PixelPaint/RectangleTool.h @@ -46,6 +46,7 @@ private: Gfx::IntPoint m_rectangle_end_position; FillMode m_fill_mode { FillMode::Outline }; DrawMode m_draw_mode { DrawMode::FromCorner }; + int m_thickness { 1 }; }; }