Skip to content

Adaptive Widget Width and UI Polish - #1183

Draft
divyanshudhruv wants to merge 12 commits into
unchihugo:masterfrom
divyanshudhruv:feat/adaptive-widget-width
Draft

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

Conversation

@divyanshudhruv

@divyanshudhruv divyanshudhruv commented Oct 2, 2026 •

Copy link
Copy Markdown

Warning

This PR includes translation updates that add approximately 700 lines across ~29 localization dictionaries. The increased LOC is primarily localization and does not represent additional application logic.

Important

I've also included a compact file-by-file review below covering the changed files, new logic, and supporting changes so the full scope can be reviewed together without splitting the work into multiple smaller PRs.

Summary

DEMO.mp4

Adds adaptive widget width support to the taskbar widget. The widget now adjusts its width based on available space, with smooth resizing, event coalescing, hysteresis, and priority-based layout handling.

Also includes UI, settings, localization, and seekbar improvements that are part of the final implementation.

Motivation

The taskbar widget previously had limited width handling when available space changed. I've been running into this issue for quite a while, and it was honestly pretty irritating to deal with. This improves how the widget responds to different screen and content sizes while keeping resizing smooth and stable.

Closes #1175, #447

Type of Change

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

What Changed

File-by-file review (click to open 👆)

Adaptive width

File Changes
Classes/Utils/WidgetLayoutSolver.cs NEW Added the core adaptive layout solver with width tiers, priority-based hiding, and layout fallback handling.
Controls/TaskbarWidgetControl.xaml.cs Integrated the solver into widget sizing and centralized visibility, priority, and layout handling.
ViewModels/UserSettings.cs Added adaptive width, animation, priority, and accent-color settings, with defensive defaults and XML persistence handling.
Classes/NativeMethods.cs Added native WinEvent support for detecting taskbar layout changes.

Measurement and animation

File Changes
Windows/TaskbarWindow.xaml.cs Added adaptive free-space detection, taskbar measurement, WinEvent handling, smooth width animation, and positioning. Also fixed hook installation across taskbar handle and Explorer PID changes.
Pages/TaskbarWidgetPage.xaml Added adaptive width settings, animation controls, and priority ordering UI.
Pages/TaskbarWidgetPage.xaml.cs Added drag-and-drop priority management, validation, localization, and persistence.

UI improvements

File Changes
Pages/SystemPage.xaml Split album-art accent coloring into separate visualizer, pause icon, and music note controls.
MainWindow.xaml Added an accent-colored seekbar elapsed section while preserving the existing slider behavior.
Localization dictionaries Added 23 localization keys across all 29 dictionaries, including the missing shared UI label.

Supporting changes

Area Changes
Dependencies Added gong-wpf-dragdrop for priority ordering.
Documentation Added adaptive width documentation and configuration details.
Diagnostics Added adaptive layout and resize diagnostics.
Performance Added event coalescing, caching, hysteresis, and resize change detection.
Compatibility Adaptive width is disabled and opt-in by default, and priority settings use defensive defaults and self-healing persistence.

Adaptive Widget Width

  • Added automatic widget width adjustment based on available space.
  • Added smooth width animation with easing.
  • Added WinEvent burst coalescing to reduce unnecessary resize operations.
  • Added hysteresis to prevent repeated resize and layout thrashing.
  • Added priority-based layout handling.
  • Added icon-only handling with a small grace range.
  • Added adaptive layout diagnostics and resize logging.
  • Added adaptive width localization and README documentation.
  • Adaptive widget width is off by default and can be enabled from settings.

UI and Settings

  • Added accent sub-toggles for the visualizer bar, pause icon, and music note.
  • Added album-art accent coloring to the seekbar.
  • Updated NEW, UPDATED, ATTENTION, and INFORMATIONAL badge styling.
  • Added configurable animation speed from 100ms to 2000ms.
  • Added drag-and-drop priority ordering.
  • Added localized priority role labels.
  • Added 23 new localization keys across all 29 supported dictionaries.
  • Added gong-wpf-dragdrop dependency.
  • Added a 6px gap between the music player and audio visualizer.
  • Fixed DPI scaling for the visualizer gap.
  • Removed unnecessary right-side negative margin so the ICON-ONLY state keeps a square appearance.
  • Fixed priority-order persistence to prevent the serialized collection from growing on every load.
  • Added defensive priority-order defaults and self-healing for missing or duplicate entries.
  • Preserved existing user settings by avoiding unconditional overwrites of accent sub-toggle values.

Taskbar and Explorer handling

  • Fixed WinEvent hook installation when the taskbar handle is not available during initial window loading.
  • Added Explorer PID tracking so the hook is reinstalled after an Explorer restart.
  • Added explicit WinEvent hook cleanup before reinstalling and when the window closes.
  • Added adaptive visualizer gap scaling for non-100% DPI configurations.

Additional Information

Preview

  • Adaptive widget resizing at different available widths

    • Before
      Group 2495

    • After
      Adaptive widget resizing

  • Smooth width animation

Smooth width animation
  • Accent settings
Accent settings
  • Drag-and-drop priority list
Drag and drop priority list
  • Animation speed setting
Animation speed setting
  • Seekbar accent color
Seekbar accent color
  • NEW/UPDATED badge styling
NEW and UPDATED badge styling
  • Gap between music player and visualizer
Music player and visualizer spacing

Verification

  • Build completed with 0 errors.
  • App launches successfully.
  • Adaptive width behavior tested locally.
  • UI and settings changes tested locally.
  • 23 localization keys are present across all 29 dictionaries.
  • Missing localization keys: 0.

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 MainWindow / Media Flyout Changes to MainWindow including the Media Flyout SettingsWindow Changes to SettingsWindow or settings pages not related to flyouts/widgets TaskbarWindow Changes to TaskbarWindow; the container for taskbar widgets Taskbar Widget Changes to the Taskbar Media Widget Taskbar Visualizer Changes to the Taskbar Visualizer labels Oct 2, 2026
@divyanshudhruv

Copy link
Copy Markdown
Author

Hi @unchihugo, I've added quite a few features and UI updates in this PR. I hope you like the changes and find them useful for FluentFlyout.

I'm a regular FluentFlyout user, so I'm planning to contribute more substantially over time.

I've also read through the CLA. I understand there isn't currently a contributor support or revenue-sharing arrangement, but if I continue making substantial contributions and features that actually make sense for the project, attract more users, increase usage, etc., would you be open to discussing some form of support? For example, GitHub Sponsors for ongoing contributions or potentially a revenue-sharing arrangement for larger features used in the paid Store version.

I'm planning to keep contributing regardless, but I wanted to bring this up now since I expect to be working on FluentFlyout more going forward, with more better and faster improvements to come.

@unchihugo unchihugo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Hi @divyanshudhruv, thanks for looking to contribute.

This current PR touches upon a lot of features, and would be hard to get in due to the merge conflicts and difficulty reviewing the amount of changed code. Just to be clear, I manually review all changes, and a 2,600 LOC diff isn't easy to review.

Could you please open separate PRs per issue/feature, starting with the shrinking function? This is easier for me to review and follows open-source contributing guidelines. Furthermore, please leave translations untranslated unless you're a fluent speaker: we crowdsource the translations on Weblate!

PS: it looks like some changes you made like the album art color for the scrollbar breaks our current fix for the scrollbar via unchihugo/wpf-ui, and the gap between the widget and visualizer isn't necessary as it doesn't follow native Windows implementation.

@divyanshudhruv

divyanshudhruv commented Oct 2, 2026 •

Copy link
Copy Markdown
Author

Hi @divyanshudhruv, thanks for looking to contribute.

This current PR touches upon a lot of features, and would be hard to get in due to the merge conflicts and difficulty reviewing the amount of changed code. Just to be clear, I manually review all changes, and a 2,600 LOC diff isn't easy to review.

Could you please open separate PRs per issue/feature, starting with the shrinking function? This is easier for me to review and follows open-source contributing guidelines. Furthermore, please leave translations untranslated unless you're a fluent speaker: we crowdsource the translations on Weblate!

PS: it looks like some changes you made like the album art color for the scrollbar breaks our current fix for the scrollbar via unchihugo/wpf-ui, and the gap between the widget and visualizer isn't necessary as it doesn't follow native Windows implementation.

Haha, sure! Would it be okay if I open stacked PRs, or would you prefer that I start with just the shrinking function for now?

@divyanshudhruv
divyanshudhruv marked this pull request as draft October 2, 2026 14:06

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MainWindow / Media Flyout Changes to MainWindow including the Media Flyout SettingsWindow Changes to SettingsWindow or settings pages not related to flyouts/widgets Taskbar Visualizer Changes to the Taskbar Visualizer Taskbar Widget Changes to the Taskbar Media Widget TaskbarWindow Changes to TaskbarWindow; the container for taskbar widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Adaptive (dynamic) flyout width when icons overlap or available space is limited

2 participants