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

Scrollbar thickness attribute works incorrect #3144

Closed
sagittarius-H opened this issue Apr 30, 2024 · 0 comments · Fixed by #3147
Closed

Scrollbar thickness attribute works incorrect #3144

sagittarius-H opened this issue Apr 30, 2024 · 0 comments · Fixed by #3147
Assignees
Labels
bug: regression A feature that worked correctly doesn't anymore

Comments

@sagittarius-H
Copy link

sagittarius-H commented Apr 30, 2024

Description

Thickness attribute only works when interacting with scrollbar (hover, scroll), otherwise scrollbar does not change its width.

Code example to reproduce the issue:

import flet

def main(page: flet.Page):

    page.horizontal_alignment = flet.CrossAxisAlignment.CENTER
    page.vertical_alignment = flet.MainAxisAlignment.CENTER

    page.add(
        flet.Stack(
            controls=[
                flet.Container(
                    content=flet.CircleAvatar(bgcolor="#e3e7e8", radius=6.5),
                    alignment=flet.alignment.bottom_right,
                ),
                flet.Container(
                    content=flet.CircleAvatar(bgcolor="#e3e7e8", radius=6.5),
                    alignment=flet.alignment.top_right,
                ),
                flet.Container(
                    content=flet.Column(
                        width=200,
                        height=80,
                        scroll=flet.ScrollMode.ALWAYS,
                        controls=[flet.Text(value=str(i)) for i in range(100)]
                    ),
                    theme=flet.Theme(
                        scrollbar_theme=flet.ScrollbarTheme(
                            track_color={
                                flet.MaterialState.DEFAULT: "#E3E7E8",
                            },
                            track_visibility=True,
                            thumb_color={
                                flet.MaterialState.DEFAULT: "#616161",
                            },
                            thickness=5,
                            radius=10,
                            main_axis_margin=5,
                            min_thumb_length=5,
                        )
                    ),
                    top=5
                ),
            ],
            width=200,
            height=90,
        )
    )

flet.app(target=main)

Describe the results you received:

Recording.2024-04-30.143008.mp4

Describe the results you expected:

When setting thickness attribute without explicitly specifying MaterialStates, scrollbar must always remain the same width.

Flet version (pip show flet):

Name: flet
Version: 0.22.0
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page: 
Author: Appveyor Systems Inc.
Author-email: hello@flet.dev
License: Apache-2.0
Location: C:\Users\HermanC\PycharmProjects\flet-Learn\venv\Lib\site-packages
Requires: cookiecutter, fastapi, flet-runtime, packaging, qrcode, uvicorn, watchdog
Required-by:

Give your requirements.txt file (don't pip freeze, instead give direct packages):

flet==0.22.0

Operating system:

Windows 11 21H2

@InesaFitsner InesaFitsner self-assigned this Apr 30, 2024
@InesaFitsner InesaFitsner added the bug: regression A feature that worked correctly doesn't anymore label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: regression A feature that worked correctly doesn't anymore
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants