Skip to content

v1: rework WindowDragArea #5349

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Jun 11, 2025
Merged

v1: rework WindowDragArea #5349

merged 3 commits into from
Jun 11, 2025

Conversation

ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Jun 5, 2025

Test Code

def main(page: ft.Page):
    page.add(
        ft.WindowDragArea(
            content=ft.Container(ft.Text("Test")),
            on_double_tap=print,
            on_drag_end=print,
            on_drag_start=print,
        )
    )

Summary by Sourcery

Rework the WindowDragArea control to use the new ConstrainedControl base in Python, consolidate its event properties, and provide a matching Dart-side implementation in the Flutter extension.

New Features:

  • Add support for an on_drag_end event callback.
  • Introduce a Dart WindowDragAreaControl widget to render and handle drag and double-tap behavior.
  • Switch to using WindowEvent for double-tap maximize/unmaximize events and dedicated DragStartEvent/DragEndEvent types for drag callbacks.

Enhancements:

  • Refactor Python WindowDragArea to declare properties (content, maximizable, event handlers) instead of subclassing GestureDetector.
  • Update Flet core extension to register the new WindowDragArea control for Flutter integration.
  • Remove custom handler methods and streamline event triggering logic.

@ndonkoHenri ndonkoHenri requested a review from FeodorFitsner June 5, 2025 05:25
@FeodorFitsner FeodorFitsner merged commit 9c655d2 into v1 Jun 11, 2025
2 checks passed
@FeodorFitsner FeodorFitsner deleted the v1-window-drag-area branch June 11, 2025 18:26
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants