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

Inesa/icon and icon content #4305

Merged
merged 15 commits into from
Nov 4, 2024
Merged

Inesa/icon and icon content #4305

merged 15 commits into from
Nov 4, 2024

Conversation

InesaFitsner
Copy link
Contributor

@InesaFitsner InesaFitsner commented Nov 4, 2024

Description

Fixes #4189

Test Code

For NavigationBar:

import flet as ft


def main(page: ft.Page):

    page.title = "NavigationBar Example"
    page.navigation_bar = ft.NavigationBar(
        adaptive=True,
        destinations=[
            ft.NavigationBarDestination(icon=ft.Icons.EXPLORE, label="Explore"),
            ft.NavigationBarDestination(icon=ft.Icon(ft.Icons.ADD)),
            ft.NavigationBarDestination(
                icon=ft.icons.ABC,
                selected_icon=ft.Text("Selected Icon Content"),
                label="Explore",
            ),
        ],
    )
    page.add(ft.Text("Body!"))


ft.app(main)

For Dropdown:

import flet as ft


def main(page: ft.Page):

    dd = ft.Dropdown(
        icon=ft.Text("Icon"),
        select_icon=ft.Icon(ft.Icons.ADD),
        select_icon_size=50,
        select_icon_enabled_color=ft.colors.RED,
        width=300,
        options=[
            ft.dropdown.Option("Red"),
            ft.dropdown.Option("Green"),
            ft.dropdown.Option("Blue"),
        ],
    )
    page.add(dd)


ft.app(main)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I signed the CLA.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes
  • I have made corresponding changes to the documentation (if applicable)

Screenshots (if applicable):

Additional details

Summary by Sourcery

Refactor icon handling in Dropdown, NavigationBar, NavigationDrawer, and NavigationRail components by introducing new properties for select icons and deprecating old ones. Update documentation to reflect these changes and fix related bugs.

Bug Fixes:

  • Fix the issue with icon handling in the Dropdown and Navigation components by introducing new properties for select icons and deprecating old ones.

Enhancements:

  • Deprecate the use of 'icon_content' and 'selected_icon_content' properties in favor of 'icon' and 'selected_icon' properties across various components.

Documentation:

  • Update documentation to reflect the deprecation of 'icon_content' and 'selected_icon_content' properties and the introduction of new icon handling properties.

@FeodorFitsner FeodorFitsner merged commit 4331504 into main Nov 4, 2024
3 checks passed
@FeodorFitsner FeodorFitsner deleted the inesa/icon-and-icon-content branch November 4, 2024 22:17
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.

icon and icon_content should be one icon property of IconValueOrControl type (Control or IconValue)
2 participants