feat: show click (pointer) cursor on hover over Material controls and progress bar#950
Open
Ortes wants to merge 1 commit into
Open
feat: show click (pointer) cursor on hover over Material controls and progress bar#950Ortes wants to merge 1 commit into
Ortes wants to merge 1 commit into
Conversation
On web and desktop, the play/pause, mute, subtitles, fullscreen buttons and the seek/progress bar were built with `GestureDetector`, which does not change the mouse cursor on hover. As a result the pointer stayed the default arrow, giving no affordance that the controls are clickable. Wrap the clickable child of each of these `GestureDetector`s in a `MouseRegion(cursor: SystemMouseCursors.click)` so the cursor turns into a pointer on hover, matching the existing `IconButton`-based controls (options/subtitles) which already do this. The non-draggable progress bar is left untouched. Covers `MaterialControls`, `MaterialDesktopControls` and the shared `VideoProgressBar`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #950 +/- ##
==========================================
+ Coverage 43.82% 44.00% +0.18%
==========================================
Files 21 21
Lines 1602 1609 +7
==========================================
+ Hits 702 708 +6
- Misses 900 901 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On web and desktop, hovering the mouse over the player controls keeps the default arrow cursor — there's no affordance that the buttons and the seek bar are clickable.
The affected controls (play/pause, mute, subtitle toggle, fullscreen, and the draggable progress bar) are built with
GestureDetector, which — unlikeIconButton— does not set a hover cursor. The options/subtitlesIconButtons already show a pointer, so the bar is inconsistent.This PR wraps the clickable child of each of those
GestureDetectors in aMouseRegion(cursor: SystemMouseCursors.click)so the cursor turns into a pointer on hover, matching theIconButton-based controls.What changed
MaterialControls— mute, fullscreen, subtitle toggleMaterialDesktopControls— play/pause, mute, fullscreenVideoProgressBar(shared) — the draggable progress/seek bar only; the non-draggable variant is left untouchedCupertinoControlsis intentionally left out: it is touch-first (iOS) and its root already wraps everything in aMouseRegion. Happy to extend it in a follow-up if maintainers prefer full coverage.Behavior
MouseRegiononly affects the hover cursor.MouseRegionwraps the same child theGestureDetectoralready used).Testing
flutter analyze— no issues.example/app on web; controls behave identically, with the pointer cursor now appearing on hover over the buttons and the seek bar.🤖 Generated with Claude Code