Skip to content

Shrink Widget to Fit Available Taskbar Space - #1184

Closed
divyanshudhruv wants to merge 3 commits into
unchihugo:masterfrom
divyanshudhruv:feat/adaptive-width
Closed

divyanshudhruv wants to merge 3 commits into
unchihugo:masterfrom
divyanshudhruv:feat/adaptive-width

Conversation

@divyanshudhruv

@divyanshudhruv divyanshudhruv commented Oct 2, 2026 •

Copy link
Copy Markdown

Important

PR #1183 will be closed and split into smaller feature PRs for easier review. This PR is one of those feature-specific PRs.

DEMO.mp4

Summary

Adds an opt-in adaptive width for the taskbar widget. When there isn't enough space, the widget checks how much room is available and hides the less important parts until it fits. It hides the visualizer first, then the playback controls, then the song text. The album icon is always kept visible.

Motivation

Long song titles, a large number of pinned apps, or the Widgets button can leave the widget with very little room and cause it to overlap other taskbar elements. These changes address the behaviour requested in #1175 and #447.

Closes #1175
Closes #447
Partially Closes #1183

Type of Change

  • Feature
  • Bug fix
  • Refactor (no functional changes)
  • Style (formatting, naming)
  • Other

What Changed

  • Added an Adaptive width setting under Settings - Taskbar Widget. It is off by default.
  • Added a Hide when full setting. When enabled, the widget hides completely if there isn't even enough space for the album icon.
  • Added WidgetLayoutSolver to choose the widest layout that fits the available space.
  • Added TaskbarFreeSpaceCalculator to calculate the available space using the tray, Widgets button, and centered taskbar elements.
  • Both layout and free-space calculations are kept independent of UI state and Win32-specific code.
  • The widget applies the selected layout by resizing the text containers and showing or hiding individual elements.
  • Added a background UI Automation scan to find the centered taskbar elements. A lightweight Win32 check is used to decide when the more expensive lookup needs to run.
  • Cached the tray and Widgets button bounds to avoid unnecessary lookups.
  • Remembered unsuccessful UI Automation lookups for a few seconds instead of retrying them on every pass.
  • Avoided rewriting widget and visualizer positions when the resolved geometry has not changed.

Additional Information

Both settings are off by default, so existing installations keep their current layout unless adaptive width is enabled.

Checklist

  • Code changes are manually tested and working.
  • Formatting and naming are consistent with the project.
  • Self-review of changes is done.
  • AI tools were used (if yes, I reviewed and fully understand the changes myself).

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read and agree to the FluentFlyout CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot added TaskbarWindow Changes to TaskbarWindow; the container for taskbar widgets Taskbar Widget Changes to the Taskbar Media Widget labels Oct 2, 2026
@divyanshudhruv

divyanshudhruv commented Oct 2, 2026 •

Copy link
Copy Markdown
Author

Hi @unchihugo ! I've split one of the features of #1183 into this separate PR. Can you please review it? I can't find any shorter way to implement this effectively. Hope it helps.

Would you prefer me to stack the 2nd PR on top of this one, or wait for this PR to be merged and then open the 2nd PR against master?

The 2nd PR would cover the configurable hide order and animated width transitions. (both related to UI + min-features)

I'll follow whichever is easier for you to review.

@divyanshudhruv divyanshudhruv changed the title feat(taskbar): shrink the widget to fit available taskbar space Shrink Widget to Fit Available Taskbar Space Oct 2, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Taskbar Widget Changes to the Taskbar Media Widget TaskbarWindow Changes to TaskbarWindow; the container for taskbar widgets

Projects

None yet

1 participant