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

CupertinoSlider control and Slider.adaptive #2224

Merged
merged 3 commits into from
Dec 12, 2023
Merged

Conversation

ndonkoHenri
Copy link
Contributor

Close #2174

TestCode:

import flet as ft


def main(page):
    page.horizontal_alignment = page.vertical_alignment = "center"
    page.theme_mode = ft.ThemeMode.LIGHT

    def handle_change_start(e):
        slider_status.value = "Sliding"
        page.update()

    def handle_change(e):
        slider_value.value = str(e.control.value)
        page.update()

    def handle_change_end(e):
        slider_status.value = "Finished sliding"
        page.update()

    page.add(
        slider_value := ft.Text("0.0"),
        ft.CupertinoSlider(
            divisions=5,
            max=100,
            active_color=ft.colors.PURPLE,
            thumb_color=ft.colors.PURPLE,
            on_change_start=handle_change_start,
            on_change_end=handle_change_end,
            on_change=handle_change,
        ),
        slider_status := ft.Text(),
    )


ft.app(target=main)

@FeodorFitsner FeodorFitsner merged commit fcca8c0 into main Dec 12, 2023
1 of 2 checks passed
@FeodorFitsner FeodorFitsner deleted the cupertino-slider branch December 12, 2023 18:54
zrr1999 pushed a commit to zrr1999/flet that referenced this pull request Jul 17, 2024
* cupertino slider

* Slider.adaptive

---------

Co-authored-by: Feodor Fitsner <[email protected]>
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.

CupertinoSlider control
2 participants