Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in new convenience function for a hidden Scrollbar #2775

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ellieplayswow
Copy link

why

  • a Scrollable widget requires a Direction, which in turn requires a Scrollbar
  • all of these are reasonably defaulted to a vertical-only scrollable with a sane 8px wide scrollbar
  • sometimes you want to maintain the scrollable functionality but not display a scrollbar

changes tl;dr

  • adding in convenience function iced_widget::scrollable::Scrollbar::hidden() that is simply default() with zero-width

example:

widget::scrollable(row![
    horizontal_space().width(Length::Fixed(600.0)),
    "hello",
    horizontal_space().width(Length::Fixed(600.0))
])
.direction(Direction::Horizontal(Scrollbar::hidden()))
// you can then control via methods eg iced::widget::scrollable::scroll_to(id, offset)

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