[PR #8219] Bind Launch Mode/Size, BI Opacity, Opacity, and FontWeight #27148

Closed
opened 2026-01-31 09:20:17 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/8219

State: closed
Merged: Yes


Summary of the Pull Request

Properly binds and polishes controls for a few settings in the Settings UI:

  • LaunchMode is now bound to a radio button
  • "Launch size" was added and bound as two number boxes
  • backgroundImageOpacity and acrylicOpacity are now bound to a Slider control
    • A PercentageConverter was introduced to convert from decimal range (0.0-1.0) to whole numbers (0-100)
    • Common styling was added to CommonResources
  • fontWeight is now bound to a combination of controls:
    • ComboBox is used to display the named values (FontWeights docs)
    • A special Custom option is included. When selected, a Slider appears that lets you choose a custom value.
  • AcrylicOpacity slider only appears if useAcrylic is enabled

References

#1564 - Settings UI

Detailed Description of the Pull Request / Additional comments

bf7d06d is the most complicated commit here. FontWeight is exposed as a FontWeight but is constantly treated as a uint16_t. The following changes were made to handle this:

  • FontWeightConverter: bind the slider value to the setting
  • ConversionTrait<FontWeight> stores the values as uint16_t instead of unsigned int
  • ConversionTrait<FontWeight> accepts a range of 1 to 999 in accordance to FontWeight docs
  • manually add and track the CustomFontWeight EnumEntry for the ComboBox. A sentinel value of 0 is used
  • manually implement getter/setter for CurrentFontWeight so that the Slider control is shown/hidden appropriately

Follow-up work for a later PR

The following work items are being added and tracked.

  • non-alphabetical enum ordering
    • FontWeight struggles with this the most. We should order the options from lightest to heaviest.

Demo

Slider Demo

Startup Page

**Original Pull Request:** https://github.com/microsoft/terminal/pull/8219 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Properly binds and polishes controls for a few settings in the Settings UI: - `LaunchMode` is now bound to a radio button - "Launch size" was added and bound as two number boxes - `backgroundImageOpacity` and `acrylicOpacity` are now bound to a Slider control - A `PercentageConverter` was introduced to convert from decimal range (0.0-1.0) to whole numbers (0-100) - Common styling was added to CommonResources - `fontWeight` is now bound to a combination of controls: - ComboBox is used to display the named values ([FontWeights docs](https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Text.FontWeights?view=winrt-19041)) - A special `Custom` option is included. When selected, a Slider appears that lets you choose a custom value. - AcrylicOpacity slider only appears if useAcrylic is enabled ## References #1564 - Settings UI ## Detailed Description of the Pull Request / Additional comments bf7d06d is the most complicated commit here. FontWeight is exposed as a `FontWeight` but is constantly treated as a `uint16_t`. The following changes were made to handle this: - `FontWeightConverter`: bind the slider value to the setting - `ConversionTrait<FontWeight>` stores the values as `uint16_t` instead of `unsigned int` - `ConversionTrait<FontWeight>` accepts a range of 1 to 999 in accordance to [FontWeight docs](https://docs.microsoft.com/en-us/uwp/api/windows.ui.text.fontweight?view=winrt-19041) - manually add and track the `CustomFontWeight` `EnumEntry` for the ComboBox. A sentinel value of 0 is used - manually implement getter/setter for `CurrentFontWeight` so that the Slider control is shown/hidden appropriately ## Follow-up work for a later PR The following work items are being added and tracked. - [ ] non-alphabetical enum ordering - FontWeight struggles with this the most. We should order the options from lightest to heaviest. ## Demo ![Slider Demo](https://user-images.githubusercontent.com/11050425/99599265-d71dc480-29af-11eb-9d8a-e32ba975a69e.gif) ![Startup Page](https://user-images.githubusercontent.com/11050425/100675743-63b77380-331c-11eb-83b9-53e28f004e96.png)
claunia added the pull-request label 2026-01-31 09:20:17 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27148