When opening a context menu and pressing the "arrow down" key, the first menu item was not selected. This issue was introduced by #11287. The fix is to make the `ContextMenu` focusable.
Added an integration test to try to prevent regressions.
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Add a failing test for #15712.
* Validate StartU at the start of a measure pass.
If any container U size has changed since the last layout pass then `StartU` must be considered unstable as the average container height will have changed.
* Correctly position focused element.
If the focused element has been moved outside the visible viewport due to a realized container size change, then we need to ensure it's positioned correctly.
* We can skip check if StartU is already unstable.
* Don't invalidate virt. panels more than necessary.
* Add another virt panel test.
And revert the expected results for another test to the way they were at the beginning of this PR.
* Tweak container size estimation.
Use the desired size of _measured_ containers instead of the bounds: a layout pass may not had completed on the containers yet, so the bounds may not be up-to-date. Was easier to move the estimation methods out of `RealizedStackElements` and into `VirtualizingStackPanel` itself in order to do this, and arguably makes more sense.
* Fix NUnit test context not being properly set
* Add failing tests
* Capture ExecutionContext to keep async locals
* Remove explicit EstablishExecutionEnvironment call, as it was a bad idea
* Make ExecutionContext usage disabled by default, and only enabled for NUnit
* Add more tests for ScrollIntoView.
* Improve ScrollIntoView.
Take into account the element we're scrolling to when calculating the anchor element for realization.
* Implement MacOS.IsTemplateIcon attached property on TrayIcon
* Use MacOS.IsTemplateIcon in the ControlCatalog
* Rename MacOS to MacOSProperties
* Extract IsTemplateIcon to ITrayIconWithIsTemplateImpl
I'm not sure why, but the fluent `Expander` theme uses a mix of static and dynamic resources with seemingly no reason to differentiate them? It's not so much a problem for the resources in the default values for `Expander` as these can be overridden with local values, but for the toggle button and trigger styles, it means there's no way to customize these values.
Converted all of the `StaticResource`s to `DynamicResource`s.
* Revert "Fix popups position on X11 (#14551)"
This reverts commit 06f88f6e00.
* Revert "Use popupParent as X11 parent window (#14366)"
This reverts commit 0bde86b457.
* Discard additional lines upon inserting when AcceptReturn=false
* Use LineBreakEnumerator for detecting line breaks
* Remove unused member
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Use Grapheme enumerator
---------
Co-authored-by: Markus <markus@mlet.at>
Co-authored-by: Max Katz <maxkatz6@outlook.com>
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
#Conflicts:
# src/Avalonia.Controls/TextBox.cs
* Ensure to use the appropriate parent when talking with X11 in X11Window
Signed-off-by: Mary Guillemard <mary@mary.zone>
* Translate root window coordinates to window coordinates when setting X11Window.Position
567561e272 caused the origin of window to not be (0, 0) for popups on X.
As a result, all popups were wrongly positioned.
This change Position to translate from root window coordinates (the display space) to parent window coordinates.
Signed-off-by: Mary Guillemard <mary@mary.zone>
---------
Signed-off-by: Mary Guillemard <mary@mary.zone>
* Update VirtualizingCarouselPanel.cs
Changes the calculation of the "forward" flag for the page transition to enable seamless forward and backward transitions.
* Update VirtualizingCarouselPanel.cs
Added Check for more than 2 items in carousel as there is actually no way to determine the correct transition with only 2 items. If there are only 2 items the transition behaviour is not changed.
* Update VirtualizingCarouselPanelTests.cs
Added Unit Tests for cycling through list forward and backward
* Added failing tests for #14456.
And one passing test.
* Handle converted compiled binding nodes...
...without a path. Previously the `convertedNode` was being discarded if the binding node had no arguments or property value assignments.
Fixes#14456
This fixes a case when elements have different widths and the BringIntoView wants to scroll horizontally due to custom TargetRect
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Delegate focus to TextBox
* Port FocusChanged from AutoCompleteBox to NumericUpDown
* Improve focus with NumericUpDown and ButtonSpinner bindings
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Add failing test for control visibility changing.
There was already a test for when visibility moves from visible to invisible but we were missing one for the other way around.
* Create peer even for invisible controls.
When an invisible control is encountered, unless a peer is created for it, there is nothing to listen for the `IsVisible` property changing to `true`. Make sure we create a peer even for invisible controls; we just don't add them to the child collection.