Skip to content

Feedback: slider handle shifting.#357

Draft
Aadil127 wants to merge 2 commits into
pop-os:masterfrom
Aadil127:slider-handle-fix
Draft

Feedback: slider handle shifting.#357
Aadil127 wants to merge 2 commits into
pop-os:masterfrom
Aadil127:slider-handle-fix

Conversation

@Aadil127

Copy link
Copy Markdown
slider.mp4

Bottom 3 sliders are showing bounds for widget, rail and handle.


This adds handle bounds that can be configured while creating slider widget.

To prevent issues for slider widget used in many cosmic application i have set default bounds for handle as defined in theme for slider. ( libcosmic/src/theme/style/iced.rs:755 )

Color picker widget's slider needs to update as it has custom style for slider handle
(without changes slider rail width will be slightly smaller)

Currently nothing is overflowing outside of widget layout.

Need feed back on this approach.

@Aadil127

Aadil127 commented Jun 21, 2026

Copy link
Copy Markdown
Author
renderer.fill_quad(
    renderer::Quad {
        bounds: Rectangle {
            x: bounds.x + offset,
            y: rail_y + 6.0,
            width: BREAKPOINT_WIDTH,
            height: 8.0_f32
                .min(bounds.y + bounds.height - (rail_y + 6.0)),
        },
        border: Border {
            radius: 0.0.into(),
            width: 0.0,
            color: Color::TRANSPARENT,
        },
        ..renderer::Quad::default()
    },
    crate::core::Background::Color(style.breakpoint.color),
);

Currently it also stops breakpoints from going outside of widget bounds.
Do we want this or have consistent height for breakpoints even if it makes it overflow if height of widget is small?

@Aadil127

Aadil127 commented Jun 21, 2026

Copy link
Copy Markdown
Author

I have just seen that in the upstream iced they are only using width for rectangle handle shape and height of handle is same as widget's height. Do i go with that approach?
(I am leaning towards approach taken in upstream iced)
I think i will not change my approach if i removed handle height and made handle height same as widget's than breakpoints will become smaller and breakpoint will be hidden if handle is on top of that.

@Aadil127 Aadil127 changed the title Feedback: slider handle shifting. WIP, Feedback: slider handle shifting. Jun 21, 2026
@Aadil127 Aadil127 changed the title WIP, Feedback: slider handle shifting. Feedback: slider handle shifting. Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant