1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:37:35 +00:00

PixelPaint: Use the ValueSlider widget for Tool properties

Use the new ValueSlider and get rid of the temporary solution with
tooltips :^)
This commit is contained in:
Marcus Nilsson 2021-08-05 19:36:38 +02:00 committed by Andreas Kling
parent 07ad64da8c
commit 868be680c2
10 changed files with 23 additions and 57 deletions

View file

@ -13,7 +13,7 @@
#include <LibGUI/Menu.h>
#include <LibGUI/Painter.h>
#include <LibGUI/RadioButton.h>
#include <LibGUI/Slider.h>
#include <LibGUI/ValueSlider.h>
#include <LibGfx/Rect.h>
namespace PixelPaint {
@ -109,15 +109,12 @@ GUI::Widget* EllipseTool::get_properties_widget()
thickness_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
thickness_label.set_fixed_size(80, 20);
auto& thickness_slider = thickness_container.add<GUI::HorizontalSlider>();
thickness_slider.set_fixed_height(20);
auto& thickness_slider = thickness_container.add<GUI::ValueSlider>(Orientation::Horizontal, "px");
thickness_slider.set_range(1, 10);
thickness_slider.set_value(m_thickness);
thickness_slider.set_tooltip(String::formatted("{}px", m_thickness));
thickness_slider.on_change = [&](int value) {
m_thickness = value;
thickness_slider.set_tooltip(String::formatted("{}px", value));
};
auto& mode_container = m_properties_widget->add<GUI::Widget>();