lepoco / lepoco/wpfui

TitleBar - Add support for PreferredHeightOption

Open
#1,308 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
9.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe

WinUI has the PreferredHeightOption property that allows setting the TitleBar height to TitleBarHeightOption.Tall, making the title bar buttons and the TitleBar height both 48px. However, such a setting does not seem to be available in WPF-UI.

https://learn.microsoft.com/en-us/windows/apps/develop/title-bar#interactive-content

Describe the solution you'd like

Add a new property (e.g., PreferredHeightOption) to the TitleBar and use an enumeration (e.g., TitleBarHeightOption) to set a taller button and title bar height.

Describe alternatives you've considered

Currently, I modify the button height by overriding the Style, but this approach is too intrusive for WPF-UI. If the property names in WPF-UI change in the future, this method of changing the height will also become ineffective.

<ui:TitleBar.Resources>
    <Style TargetType="{x:Type ui:TitleBarButton}" BasedOn="{StaticResource {x:Type ui:TitleBarButton}}">
        <Setter Property="Height" Value="48" />
    </Style>
</ui:TitleBar.Resources>
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TitleBar and TitleBarButton controls and their XAML styles. Review how button height and TitleBar sizing are currently defined, then add the requested PreferredHeightOption/TitleBarHeightOption behavior and verify that the tall option makes both the buttons and title bar 48px.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.