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

NavigationDrawerDestination label color changed don't work #3532

Closed
1 task done
burhansvural opened this issue Jun 25, 2024 · 3 comments · Fixed by #3551
Closed
1 task done

NavigationDrawerDestination label color changed don't work #3532

burhansvural opened this issue Jun 25, 2024 · 3 comments · Fixed by #3551
Assignees
Labels
bug Something isn't working

Comments

@burhansvural
Copy link

burhansvural commented Jun 25, 2024

Duplicate Check

Describe the bug

look at the my sending code...
theme1 It should work like this but it doesn't work! Delete the label_text_style property, other properties and their assigned values ​​always work. When I assign a value to the label_text_style property, everything on the screen becomes invisible but values ​​assigned to other properties work normally.

Code

import flet as ft


def home(page: ft.Page):
    theme1 = ft.Theme(
        navigation_drawer_theme=ft.NavigationDrawerTheme(
            label_text_style={
                ft.ControlState.HOVERED: ft.TextStyle(color=ft.colors.WHITE),
                ft.ControlState.FOCUSED: ft.TextStyle(color=ft.colors.YELLOW),
                ft.ControlState.DEFAULT: ft.TextStyle(color=ft.colors.BLUE),
            },
            bgcolor=ft.colors.GREEN,
            shadow_color=ft.colors.BLUE_ACCENT_700,
            elevation=16,
            indicator_color=ft.colors.RED,
            indicator_shape=ft.RoundedRectangleBorder(radius=10),
            surface_tint_color=ft.colors.AMBER,
            tile_height=120
        )
    )
    page.theme = theme1

    drawer = ft.NavigationDrawer(
        controls=[
            ft.Container(height=12),
            ft.NavigationDrawerDestination(
                label="Item 1",
                icon=ft.icons.DOOR_BACK_DOOR_OUTLINED,
                selected_icon_content=ft.Icon(ft.icons.DOOR_BACK_DOOR),
            ),
            ft.Divider(thickness=2),
            ft.NavigationDrawerDestination(
                icon_content=ft.Icon(ft.icons.MAIL_OUTLINED),
                label="Item 2",
                selected_icon=ft.icons.MAIL,
            ),
            ft.NavigationDrawerDestination(
                icon_content=ft.Icon(ft.icons.PHONE_OUTLINED),
                label="Item 3",
                selected_icon=ft.icons.PHONE,
            ),
        ],
    )

    page.add(
        ft.SafeArea(
            content=ft.Column(
                controls=[
                    ft.Container(
                        content=ft.Row(
                            controls=[
                                ft.IconButton(
                                    icon=ft.icons.MENU,
                                    on_click=lambda e: page.open(drawer),
                                ),
                                ft.Text(
                                    "Casa del Rey de la Gloria",

                                ),
                                ft.IconButton(
                                    icon=ft.icons.SEARCH,
                                    # on_pressed=lambda: page.open_drawer(),
                                ),

                            ],
                            alignment=ft.MainAxisAlignment.SPACE_BETWEEN,
                            expand=True

                        ),

                    ),
                    ft.Container()
                ],
                alignment=ft.MainAxisAlignment.CENTER,
                horizontal_alignment=ft.CrossAxisAlignment.CENTER,
                spacing=20,
                expand=True
            ),
        )
    )


if __name__ == "__main__":
    ft.app(target=home, assets_dir="assets")

To reproduce

no error message appears.

Expected behavior

No response

Screenshots

No response

Operating System

Linux

Operating system details

Debian 12

Flet version

0.23.1

Regression

I'm not sure / I don't know

Suggestions

No response

Additional details

No response

@ndonkoHenri ndonkoHenri added the bug Something isn't working label Jun 26, 2024
@ndonkoHenri ndonkoHenri moved this from 🆕 New to 👀 In review in Flet Development Jun 26, 2024
@ndonkoHenri ndonkoHenri self-assigned this Jul 7, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Flet Development Jul 23, 2024
@ndonkoHenri
Copy link
Contributor

Issue has been fixed.
Give it a try by installing the latest Flet prerelease: pip install flet --pre (https://pypi.org/project/flet/#history)
Report if the issue persists.

@burhansvural
Copy link
Author

burhansvural commented Jul 24, 2024

It's not working correctly.
flet version= 0.24.0.dev3171

ft.ControlState.DEFAULT: ft.TextStyle(color=ft.colors.GREY_700),
this line work correctly but others ;

ft.ControlState.HOVERED: ft.TextStyle(color=ft.colors.WHITE),
ft.ControlState.FOCUSED: ft.TextStyle(color=ft.colors.YELLOW),
not working correctly.

@ndonkoHenri ndonkoHenri reopened this Jul 24, 2024
@github-project-automation github-project-automation bot moved this from ✅ Done to 🆕 New in Flet Development Jul 24, 2024
@ndonkoHenri
Copy link
Contributor

Not all the states are supported by this property. Only the following work: DEFAULT, SELECTED and DISABLED.

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Flet Development Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants