Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add WindowCornerHintsProperty #17354

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BAndysc
Copy link
Contributor

@BAndysc BAndysc commented Oct 26, 2024

What does the pull request do?

This PR adds a new StyledProperty to the Window class: WindowCornerHintsProperty, which provides hints for window corner appearance. The hint is only used on Windows, as only this platform supports controlling corner appearance.

This is required for Classic.Avalonia theme to look good.

What is the current behavior?

Currently, there is no way to control window corners; it is up to Avalonia to decide which corner style to use.

What is the updated/expected behavior with this PR?

When WindowCornerHintsProperty is set to default platform, round, or do not round, the appropriate corner preference is used. However, by default, WindowCornerHintsProperty has the value NoHint, which indicates that it is up to Avalonia to decide which corner style should be used. This way, the default behavior is the same as it is now.

How was the solution implemented (if it's not obvious)?

This PR follows the implementation of ExtendClientAreaChromeHintsProperty.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #17294

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0052796-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6
Copy link
Member

This API makes sense to me as part of Win32Properties class: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/Platform/Win32Properties.cs#L17. Not xplat.

@BAndysc
Copy link
Contributor Author

BAndysc commented Oct 28, 2024

This API makes sense to me as part of Win32Properties class: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/Platform/Win32Properties.cs#L17. Not xplat.

Oh, I didn't know about Win32/Mac/X11 Properties classes. I have updated the PR, now it adds a new attached property in Win32Properties, it makes much more sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an ability to control Windows rounded corners behavior
3 participants