LibGUI: Ensure final stop of the opacity slider gradient has 255 alpha

Otherwise, if you change the opacity in the color picker, the slider's
opacity changes.
This commit is contained in:
MacDue 2023-05-14 10:40:44 +01:00 committed by Andreas Kling
parent acf8e19eac
commit 9685d54291
Notes: sideshowbarker 2024-07-16 23:44:30 +09:00

View file

@ -41,7 +41,7 @@ void OpacitySlider::paint_event(PaintEvent& event)
Gfx::StylePainter::paint_transparency_grid(painter, inner_rect, palette());
// Alpha gradient
painter.fill_rect_with_linear_gradient(inner_rect, Array { Gfx::ColorStop { Color::Transparent, 0 }, Gfx::ColorStop { m_base_color, 1 } },
painter.fill_rect_with_linear_gradient(inner_rect, Array { Gfx::ColorStop { Color::Transparent, 0 }, Gfx::ColorStop { m_base_color.with_alpha(255), 1 } },
orientation() == Orientation::Horizontal ? 90.0f : 180.0f);
constexpr int notch_size = 3;