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

Fix: Allow ColorPicker-Fylout to swap position if needed #13567

Merged
merged 4 commits into from
Nov 13, 2023

Conversation

timunie
Copy link
Contributor

@timunie timunie commented Nov 10, 2023

What does the pull request do?

Makes it easier to handle the ColorPicker-Flyout and also other Flyouts. The ColorView should no longer hide the Button if the free space is not enough to show the Fylout. Also the hard-coded positioning was changed into a DynamicResource in order to make adjustments easier.

What is the current behavior?

See #13550

What is the updated/expected behavior with this PR?

  • Flyouts can switch orientation if the space is not enough
  • Users can configure the DropDown-direction

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

Added PlacementConstraintAdjustment-Property to PopupFyloutBase in order to configure adjustments. Before it was hard-coded to Slide.

Checklist

Breaking changes

Technically it is a behavior change das now the Flyout will flip position instead of slide. However in most use-cases the flip operation is preferred. Still this can be reverted if we specify the old values as default. Let me know your thoughts.

Obsoletions / Deprecations

Fixed issues

Fixes #13550

/cc @robloo

This adds much more flexibility to control flyout positioning when there is not enough space to show the Flyout.
This allows the position to be overridden easily. It should no longer be hard coded.
@robloo
Copy link
Contributor

robloo commented Nov 10, 2023

Thanks for opening this! It is probably best to do something along these lines first to close the original issue.

@timunie timunie requested review from MrJul and robloo November 13, 2023 10:55
@timunie timunie added this pull request to the merge queue Nov 13, 2023
@@ -50,7 +52,8 @@
</Style>
</DropDownButton.Styles>
<DropDownButton.Flyout>
<Flyout Placement="Top">
<Flyout FlyoutPresenterClasses="nopadding"
Copy link
Contributor

@robloo robloo Nov 13, 2023

Choose a reason for hiding this comment

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

Are you sure this is defined for simple theme? It was likely not set on purpose.

Lol, nevermind. I should have just looked up a few lines. Good catch.

Merged via the queue into AvaloniaUI:master with commit 4007dfa Nov 13, 2023
6 checks passed
@timunie timunie deleted the fix/ColorPickerFlyoutPosition branch November 13, 2023 16:20
@maxkatz6 maxkatz6 added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Nov 28, 2023
maxkatz6 pushed a commit that referenced this pull request Dec 5, 2023
* Add `PlacementConstraintAdjustmentProperty` to PopupFlyoutBase

This adds much more flexibility to control flyout positioning when there is not enough space to show the Flyout.

* Make Fylout position of the ColorPicker a DynamicResource

This allows the position to be overridden easily. It should no longer be hard coded.

* Address review
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Dec 5, 2023
robloo added a commit to robloo/FluentAvalonia that referenced this pull request Apr 13, 2024
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.

ColorView overlaps ColorPicker split button
4 participants