Skip to content

fix: keep the desktop bar's right-hand controls pinned right - #973

Merged
diegotori merged 1 commit into
fluttercommunity:masterfrom
Fullphysio:fix/desktop-bar-right-controls
Oct 20, 2026
Merged

diegotori merged 1 commit into
fluttercommunity:masterfrom
Fullphysio:fix/desktop-bar-right-controls

Conversation

@Ortes

@Ortes Ortes commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

MaterialDesktopControls puts its right-hand controls (fullscreen, options, subtitles, cast, additional controls) partway across the bar instead of at the right edge.

Cause: a3c8955 made the position label a loose Flexible next to the existing Spacer. Both have flex 1, so they split the free space evenly. The label only uses its natural width, so the rest of its share ends up after the controls. At 1280 px wide, the fullscreen button sits 375 px from the right edge.

Fix: make the label the bar's only flex child (Expanded + Align to the start) and drop the Spacer.

This keeps what the Flexible was added for: on a narrow window the label still shrinks instead of overflowing when there are extra controls. I checked 360, 420 and 480 px with three additionalControls. There's no overflow on either version, and the fullscreen button reaches the right edge on both. The label also gets all of the leftover width instead of half of it (17 px instead of 9 px at 360 px).

Added test/desktop_bar_layout_test.dart. It fails on master (375 px from the edge) and passes with the fix.

Before (master) After
before after

Both are from the example app on Chrome with "Desktop controls" selected. The "after" shot was taken while the controls were fading out.

The position label was a loose Flexible next to a Spacer; the two split
the free space and the label's unused share sat after the controls.
@Ortes
Ortes force-pushed the fix/desktop-bar-right-controls branch from e2bd630 to 178e9df Compare October 13, 2026 19:24
@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.61%. Comparing base (d568acf) to head (178e9df).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #973   +/-   ##
=======================================
  Coverage   82.60%   82.61%           
=======================================
  Files          48       48           
  Lines        2967     2968    +1     
=======================================
+ Hits         2451     2452    +1     
  Misses        516      516           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Ortes added a commit to Ortes/cineseed that referenced this pull request Oct 19, 2026

@diegotori diegotori left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@diegotori
diegotori merged commit 9345d9d into fluttercommunity:master Oct 20, 2026
5 checks passed
diegotori added a commit that referenced this pull request Oct 20, 2026
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