* Minimize private API usages
- AvaloniaLocator.Current shouldn't be used unless really needed.
- Add comments where not possible otherwise
* fix wrong if statements
* feat(NumericUpDown): Add InnerContent. It is positioned on the opposite side to ButtonSpinnerLocation
* fix: TextBox Nullability
* fix: Adress review
* fix: nits
* fix: missing update ControlCatalog
* Init
* Remove XY navigation cache as it's no use
* Use pooled collection for XY navigation
* Restructure code a bit, fix IScroller handling
* Init KeyboardNavigationTests_XY tests
* Simplify XYFocus.GetNextFocusableElement usage
* Minor fixes
* Add more tests
* Remove unused NuiKeyboardNavigationHandler
* Finalizing
* Fix tests
* Add TODO12
* Make XYFocusOptions a class
* Add TestServices.FocusableWindow and make KeyboardNavigationHandler lazy, as it can't be reused on multiple windows
* Fix KeyboardNavigationHandler events handling, when focus was not actually changed
* Add arrow key tests
* Replace XYFocusKeyboardNavigationMode with more flexible XYFocusNavigationModes, integrate with KeyDeviceType input types
* Make XY focus navigation less broken, when there is no starting focused control
* Several Android TV compatibility improvements
* Remap tizen Back button to Esc
* Introduce internal XYFocusHelpers
* Make ComboBox and AutoCompleteBox handle Key events only when it's needed
* Make TextBox handle Key events only when it's needed
* Ignore Alt+Down when XY navigation is enabled in CalendarDatePicker and SplitButton
* Rename IsAllowedXYNavigationMode
* Fix ButtonSpinner with XY navigation
* Implement a very simple focus engagement for GridSplitter and Slider
* Ability to configure font features
* Minor adjustments
---------
Co-authored-by: Herman Kirshin <herman.kirshin@jetbrains.com>
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Add BackgroundSizing enum
* Improve formatting in RoundedRect
* Add the BackgroundSizing property to relevant controls
* Add new GeometryBuilder helper
This is based on new ideas and APIs in both WinUI and WPF
* Support BackgroundSizing in BorderRenderHelper
This also removes the last remnants of dash array support in the internal APIs
* Remove old code in BorderRenderHelper moved to GeometryBuilder
* Move Rectangle shape geometry calculation into GeometryBuilder
* Add RadiusX/Y properties to RectangleGeometry
* Use RectangleGeometry directly in the Rectangle shape
Since RectangleGeometry now supports RadiusX/Y there is no longer a need to have a separate geometry creation path.
* Add WinUI-based CalculateRoundedCornersRectangle() method
* Simplify and use the WinUI-algorithm in BorderRenderHelper
* Update GeometryBuilder.DrawRoundedCornersRectangle() based on WinUI
* Remove obsolete WPF-based CalculateRoundedCornersRectangle method
* Update CalculateRoundedCornersRectangleAlternate
* Update GeometryBuilderTests
* Fix merge
* Remove unused dashed line properties in BorderRenderHelper
These were already removed in master but could not be merged directly because of the new backgroundSizing parameter.
* Optimize CalculateRoundedCornersRectangle
In the worse-case up to three Point structs were created during calculation for each keypoint. Now doubles are used during calculations so the Point is created once at the end.
* Adjust corner radius calculation within custom GeometryBuilder.CalculateRoundedCornersRectangle()
Corner radius is defined at the center of the border stroke rather than the outside edge.
* Simplify code in WinUI's algorithm for CalculateRoundedCornersRectangle()
* Remove extra BorderRenderHelper.RenderCore method
This method does not need to be separate from Render.
* Add more CalculateRoundedCornersRectangle tests and adjust method naming
* Remove custom CalculateRoundedCornersRectangle() algorithm and always use the WinUI one
* Remove some AggressiveInlining attributes
* Make parameters clear
* Pass RoundedRectKeypoints by ref
* Use GeometryCombineMode.Exclude to better calculate border geometries
* Update BorderPage.xaml to include BackgroundSizing API
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Don't overwrite IsClipEnabled.
The user should be able to set this on an adorner themselves.
* Use correct clip bounds for adorners.
Only take the adorned visual's clip bounds into account if the adorner is clipped to these bounds.
* Disable clipping on GridSplitter adorner.
Fixes#10700
* Don't clip adorners in ControlCatalog.
Default setting is `true`, but this was being overridden in `AdornerLayer.AddVisualAdorner`. That was fixed by an earlier commit in this PR, so property needs to be set explicitly to false in ControlCatalog.
* add tv support to form factor
* Resolve comments and add chromium book
* Add some documentation
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Update Avalonia.Controls.Platform.Dialogs apis
* Enable nullable on dialogs project
* Implement ManagedFileChooserOverwritePrompt with new styles, instead of hardcoding prompt creation
* Add BclMountedVolumeInfoProvider fallback
* Update samples page to include ShowOverwritePrompt
* ManagedStorageProvider with different window and popup implementations
* Extend ManagedFileDialogOptions
* Fix#8437 because I can
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
* Introduce ErrorConverter and DisplayErrors attached properties
- the converter can be used to change the way a message is print
- we use DisplayErrors to get the converted error messages
* Adjust FluentTheme
* [WIP] Add a sample Page for DataValidationErrors
* use a private attached property to store recent errors
this approach gets rid of the need to DisplayErrors property
* Update samples with some additional details
* Reuse rich SetError logic in DataGrid as well
* Unify some code with OnErrorsOrConverterChanged
* Restore old behavior with null default value
* Add SetErrorConverter test
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* feat: add Content and ContentPresenter for ColorPicker
* feat: update according to https://github.com/AvaloniaUI/Avalonia/pull/13073 feedback.
* feat: add HorizontalContentAlignment and VerticalContentAlignment default value to simple theme.
* feat: update documentation wording.
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Add Fluent HeaderContentControl theme
* Fix file name, add content template
* Add simple theme for HeaderedContentControl
* Add sample page for HeaderedContentControl in the catalog
* Change the HeaderedContentControl to use a Grid instead of a stack panel for its layout
* Fix template part names
* Fix HeaderedContentControl typename
* Fix the template part type again
* Fix control template names
* Introduce IFilePickerFileTypes to have more control over file types in the native backend
* Update samples page for dialogs
* Rename to IAvnFilePickerFileTypes
* WIP
* Fix disabled popup
* Explicitly dispose AvnString and AvnStringArray + GetNSArrayOfStringsAndRelease
* Fix potential crash
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
- animation/layout/render cycle is now managed from a central location
- animations are now throttled if animation/layout/render pass takes longer than a frame which previously caused a soft-freeze with input not being processed
- the public API is trimmed to make sure that we can make other planned changes during the 11.x support cycle
"Changelog":
- IClock is hidden and is planned to be replaced later
- Animator classes are hidden and are planned to be refactored later
- IAnimation members are hidden, it's supposed to be a marker interface for Style.Animations collection now, to start animations manually use Animation.RunAsync
- Sealed several classes in Avalonia.Animation namespace
- Spring class is removed from the public API (it wasn't possible to use it directly in a meaningful way anyway)
- Sealed brushes, transforms, effects and drawings
- Removed separate dispatcher priorities for Layout and Composition, everything now happens from a central place with Render priority (same as WPF)
- - some private "hook" priorities are added for now, those will be removed later
- IRenderLoop is hidden and removed from locator
- IRenderer is hidden (the plan is to remove that concept later)
- - Renderer.Start/Stop exposed as StartRendering/StopRendering on the toplevel (will be on a CompositionTarget/PresentationSource-like type later)
- - Renderer.Diagnistics exposed as RendererDiagnostics (same)
- - Renderer is no longer created by the platform code and is created by TopLevel itself
- - From the user-code hit-testing should be done by VisualExtensions.GetVisual(s)At, which has the same features
- - For unit tests a separate IHitTester interface is added which can be changed for a particular toplevel
- ILayoutManager is hidden
- - LayoutManager.ExecuteLayoutPass() exposed as TopLevel.UpdateLayout()
- Custom animators now have a separate base class that only deals with interpolation
Minor improvements:
- Compositor has a mode that doesn't use DispatcherTimers, useful for unit tests
- Introduced ScopedTestBase that auto-resets the locator when test is finished