* Do not reset the selected range when the TextBox loses focus
Do not render selection highlight when the TextBox doesn't has focus
* Invalidate TextLayout when the focus is lost
* Make ClearSelectionAfterFocusLost optional
Make inactive selection highlight optional
* Make sure changes to ShowSelectionHighlight invalidate the visual and text layout
* Add failing focus tests for flyouts inside overlay popups
* Implement IKeyboardNavigationHandler on OverlayPopupHost
* Layout OverlayPopupHost content for focus to work
* Rework how TextBlock skips redundant measure and arrange calls
Add some tests
* Adjust tests
* Try this
* Make sure the TextBlock is arranged after it has been measured with a different availableSize
* Make it more clear that we are resetting and recreating the TextLayout
* Capture textLayout after inlines have been processed
* Set TimePickerPresenter.Time seconds component to zero when UseSeconds is false
* Remove unneeded PART_FirstSpace annotation from TimePickerPresenter
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Only check MainWindow visiblity in DoShutdown cancellation, when ShutdownMode == ShutdownMode.OnMainWindowClose
* Raise WindowClosedEvent event AFTER IsVisible/_shown properties were updated
* Add OnMainWindowClose cancellation tests
* Assert that Closing event was actually raised.
* Re-do fix by forcing window closing
* Forced .Shutdown() should also raise Window.Closed events, and not ignore them
* Always Return 0 bidi level for TextEndOfLine run
* Fix test unit
* Expand the unit test
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* ComboBox empty selection should not generate a TextBlock as SelectionBoxItem
Fixes: #16747
* Add test for ComboBox DisplayMemberBinding behavior without selection.
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* test: Check that `SplitButton.Click` is not fired when `SplitButton` is not in focused
* fix: `SplitButton.Click` is not fired when `SplitButton` is not in focused
* fix: Address review
* fix: Address review
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* test(SplitViewTests.cs): added failing test for issue #17176
* fix(SplitView.cs): added pane state pseudo class update in OnApplyTemplate
- fixed#17176
* test(SplitViewTests): added globalclock mock to failing test
* Show Avalonia context menu and toolip...
In native text box in integration test app. Only implemented for win32 right now.
This is to test the two popup behaviors required for native controls:
- The context menu needs focus to be transferred to Avalonia
- The ToolTip must not transfer focus to Avalonia
* Added Popup.TakesFocusFromNativeControl.
By default, if a popup is shown when a native control is focused, focus is transferred back to Avalonia in order for the popup to receive input. If this property is set to false, then the shown popup will not receive input until it receives an interaction which explicitly focuses the popup, such as a mouse click.
The effect of this property can be seen in the Embedding tag of the IntegrationTestApp: hovering over the native text box shows an Avalonia `ToolTip` which does not steal focus from the native text box. Right-clicking to open an Avalonia `ContextMenu` does steal focus so the menu items can be selected using the arrow keys.
Currently only implemented on a win32.
* Show tooltip and context menu on macOS.
* Implement TakeFocus on macOS.
* Add integration tests.
Only tested on win32 so far.
* Integration tests won't work on macOS.
As can be expected at this point, really.
* Update API diff.
* Fix HeadlessWindowImpl.Position does not persist new value
* Create unit-test for 17071 fix
* Fix CI errors
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Add failing test for #16746
* Always read the value from the target object.
The value must be read from the target object instead of using the value from the event because the value may have changed again between the time the event was raised and now: if that occurs in a two-way binding then we end up with a stack overflow.
* Added failing AutoCompleteBox test.
* Make sure that flags are reset if exits early.
Wrap everything in a `try`...`finally` block so that they get reset even on exception.
* Use scalable rasterization for visual brush
* Make ConfigureSceneBrushContentWithPicture less byzantine
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Enable VisualBrush to be used as Visual's OpacityMask
* Add missing test file
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Implement AvaloniaObject on ResourceProvider
* ColorPaletteResources and ColorPaletteResourcesCollection should inherit ResourceProvider
* Use ResourceProvider in tests too
* Adjust API diff
---------
Co-authored-by: Steven Kirk <grokys@users.noreply.github.com>
* Make sure wrapper and platform DrawingContext have the same transform after Flush
* Add some tests
* Update Avalonia.RenderTests.WpfCompare.csproj
* Remove comments
* Use test font
* Stop Selection.Clear() when selecting a range to enable multiple consecutive blocks to be selected.
* Reinstated Selection.Clear() when range is true and toggleModifier is false.
When range and toggleModifier are true, consecutive ranges are selected.
Added new unit test.
The typo causes the resources `implicitSharedInstance1` and `implicitSharedInstance2` are both always `AvaloniaProperty.UnsetValue`, where `Assert.Same` passes.
* Add CustomPopupPlacement API
* Add Placement="Custom" support for Flyout, ToolTip and ContextMenu controls as well
* Adjust some API changes
* Add Avalonia.Controls.Primitives.IPopupHost.ConfigurePosition breaking change
* Extract new types into separated files
* Fix build after merge conflict
* Adjust nupkg.xml
* Dispose property subscriptions after popup is closed, avoiding flickering
* Adjust API to be more future proof and add new parameters.
* Add new ContextRequestedEventArgs overload while I am on it
* test: Check that the button should not fire the click event on the space key when it is not active
* fix: Button should not fire the click event on the space key when it is not active
* fix: Address review
* Basic failing unit test for UWP/WinUI XYFocus search boundary scenario.
* Change IsAllowedXYNavigationMode to return false if keyDeviceType is null and modes == disabled.
* Add helper function to find the closest InputElement to the target element whose parent does not allow XYFocus rather than always searching from the TopLevel. This restricts focus searches within a specific subtree rather than allowing searches to bridge subtrees that share an XYFocus disabled parent.
* Update BindingBase.Instance signature.
- Swap `target` and `targetProperty` order to make it consistent with other similar methods
- Make `targetProperty` nullable as it will need to be null for `MultiBinding`
* IBinding2.Instance needs to accept a null target property.
It will need to be null for `MultiBinding`.
* Attach needs to accept a null target property.
It will need to be null for `MultiBinding`.
* Initial implementation of MultiBindingExpression.
* Fix failing template binding test.
Only publish unset value if we've already published a value.
* Enabled nullability annotations.
* Added passing test for #16084.
* Remove obsolete API usages.
* Bind to Tag not Text.
Prevents test passing when it shouldn't. See https://github.com/AvaloniaUI/Avalonia/pull/16219#discussion_r1665466968
* Handle DoNothing in MultiBindingExpression.
* Added embedding page to IntegrationTestApp.
Currently embeds a lone native text box, and only when running on Windows.
* Win32 automation support for native control host.
Allows native controls to appear in the Avalonia automation tree as a child of the `NativeControlHost`. They also appear in the _wrong_ place - as a direct child of the `Window` - but this appears to be expected behavior as it happens when hosting a win32 control in WPF as well.
* Basic native control integration test on win32.
* Test editing native win32 control in popup.
* Add embedded text box on macOS.
* macOS automation support for native control host.
Implements special-casing of `InteropAutomationPeer`on macOS.
* Make native control integration test work on macOS.
The test for the native control in a popup is disabled on macOS because we have a bug there.
* Add missing parts
* Fix build error
* Skip test to see if CI passes again.
* Log more info about integration tests on win32.
* Try to fix flaky test.
* The tests won't yet work on macOS yet.
Will require #16577.
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Fixed overlay popups not automatically closing
* Fix overlay tooltip tests not actually generating overlay tooltips
Verify popup type whenever we verify that the popup is open
* Fixed overlay tooltips not being attached to the visual tree in tests
* Record video for failing win32 integration tests.
* Be more specific when selecting the test dll.
https://github.com/microsoft/vstest/issues/3939
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>