-
Notifications
You must be signed in to change notification settings - Fork 590
fix: WindowDragArea dragging delays
#5795
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've reviewed this pull request using the Sourcery rules engine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the WindowDragArea control to use manual double-tap detection and adds a distance property to Python's Offset class for calculating Euclidean distance.
- Replaced
GestureDetector.onDoubleTapwith custom double-tap detection usingListenerand pointer events - Converted
WindowDragAreaControlfromStatelessWidgettoStatefulWidgetto track tap timing and position - Added
distanceproperty to Python'sOffsetclass to provide parity with Flutter's Offset API
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| sdk/python/packages/flet/src/flet/controls/transform.py | Adds a distance property to the Offset class that calculates the Euclidean distance from the origin using the standard formula (x² + y²)^0.5 |
| packages/flet/lib/src/controls/window_drag_area.dart | Refactors WindowDragArea to use StatefulWidget with manual double-tap detection via Listener, tracking tap timing and position to determine when maximize/unmaximize should trigger based on Flutter's double-tap thresholds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Deploying flet-docs with
|
| Latest commit: |
5de6aa4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://eef79074.flet-docs.pages.dev |
| Branch Preview URL: | https://improve-window-drag-area.flet-docs.pages.dev |
Assigns the 'value' property of the Markdown control during initialization instead of within each test. Also removes the 'similarity_threshold' parameter from screenshot assertions for consistency.
Fix #5193
Example
Summary by Sourcery
Improve WindowDragAreaControl responsiveness by separating dragging from double-tap detection, implement custom pointer‐based double-tap maximize/unmaximize, and add a utility distance method to Offset in the Python SDK.
New Features:
Enhancements:
Chores: