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

CupertinoContextMenu and CupertinoContextMenuAction controls #2772

Merged
merged 5 commits into from
Mar 2, 2024

Conversation

ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Feb 29, 2024

TestCode:

import flet as ft


def main(page):
    page.window_always_on_top = True
    page.theme_mode = ft.ThemeMode.LIGHT
    page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
    page.vertical_alignment = ft.MainAxisAlignment.CENTER

    page.add(
        ft.CupertinoContextMenu(
            enable_haptic_feedback=True,
            content=ft.Image("https://picsum.photos/200/200"),
            actions=[
                ft.CupertinoContextMenuAction(
                    text="Action 1",
                    default=True,
                    trailing_icon=ft.icons.CHECK,
                    on_click=lambda e: print("Action 1"),
                ),
                ft.CupertinoContextMenuAction(
                    text="Action 2",
                    trailing_icon=ft.icons.MORE,
                    on_click=lambda e: print("Action 2"),
                ),
                ft.CupertinoContextMenuAction(
                    text="Action 3",
                    destructive=True,
                    trailing_icon=ft.icons.CANCEL,
                    on_click=lambda e: print("Action 3"),
                ),
            ],
        )
    )


ft.app(target=main)

@FeodorFitsner FeodorFitsner merged commit 7973968 into main Mar 2, 2024
2 checks passed
@ndonkoHenri ndonkoHenri deleted the context-menu branch March 2, 2024 22:47
zrr1999 pushed a commit to zrr1999/flet that referenced this pull request Jul 17, 2024
…t-dev#2772)

* CupertinoContextMenu: initial commit

* CupertinoContextMenuAction: initial commit

* Fix text color of CupertinoContextMenuAction in dark mode

---------

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.

2 participants