PixelPaint: Use GUI::OpacitySlider for layer opacity settings

This commit is contained in:
Andreas Kling 2020-12-31 12:09:39 +01:00
parent 0b55b0bdb8
commit 47028c56c6
Notes: sideshowbarker 2024-07-19 00:18:55 +09:00
2 changed files with 3 additions and 4 deletions

View File

@ -30,7 +30,7 @@
#include <LibGUI/CheckBox.h>
#include <LibGUI/GroupBox.h>
#include <LibGUI/Label.h>
#include <LibGUI/Slider.h>
#include <LibGUI/OpacitySlider.h>
#include <LibGUI/TextBox.h>
#include <LibGfx/Font.h>
@ -68,8 +68,7 @@ LayerPropertiesWidget::LayerPropertiesWidget()
opacity_label.set_text_alignment(Gfx::TextAlignment::CenterLeft);
opacity_label.set_fixed_size(80, 20);
m_opacity_slider = opacity_container.add<GUI::HorizontalSlider>();
m_opacity_slider->set_fixed_height(20);
m_opacity_slider = opacity_container.add<GUI::OpacitySlider>();
m_opacity_slider->set_range(0, 100);
m_opacity_slider->on_change = [this](int value) {
if (m_layer)

View File

@ -44,7 +44,7 @@ private:
LayerPropertiesWidget();
RefPtr<GUI::CheckBox> m_visibility_checkbox;
RefPtr<GUI::HorizontalSlider> m_opacity_slider;
RefPtr<GUI::OpacitySlider> m_opacity_slider;
RefPtr<GUI::TextBox> m_name_textbox;
WeakPtr<Layer> m_layer;