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 unselect option for touchbarscrubber #15

Merged
merged 2 commits into from
Apr 9, 2023

Conversation

Lynoma
Copy link
Contributor

@Lynoma Lynoma commented Apr 5, 2023

This PR intends to add an option to unselect the scrubbar item after being selected. This allows the Scrubber to be used as a container for buttons to be clicked instead of selected.

To use it you just have to set the shouldUnselectAfterHit to true.

TouchBarScrubber(
        children: scrubberChildren,
        selectedStyle: ScrubberSelectionStyle.roundedBackground,
        overlayStyle: ScrubberSelectionStyle.outlineOverlay,
        mode: ScrubberMode.fixed,
        shouldUnselectAfterHit: true,
        onSelect: (childId) {
          
        },
        onHighlight: (childId) {

        },
)

Thanks for taking the time to review it 🙏

@vital-edu vital-edu mentioned this pull request Apr 9, 2023
@vital-edu vital-edu merged commit 1b18e7f into vital-edu:master Apr 9, 2023
@vital-edu
Copy link
Owner

Thanks @Lynoma for the contribution.

After reviewing your code I decided to modify it to eliminate a bug that was occurring:
if you keep pressing a scrubber and move it to another item, the item was not being unselected.

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.

2 participants