* Add key text, consumed modifiers and native key info to key events
KeyEventArgs gets the data that terminal emulators need to encode keys:
- KeyText: the text that the platform layout produced with all modifiers
applied, including C0 control characters.
- KeyTextIgnoringModifiers: the text with Shift, Caps Lock and AltGr applied
and Ctrl, Alt and Meta ignored (Option on macOS).
- ConsumedModifiers: the pressed modifiers that the layout used, with the
xkbcommon GTK rules on X11 and Wayland, a per-layout key table on Win32 and
UCKeyTranslate comparisons on macOS.
- NativeKeyInfo: the platform scan code, virtual key and modifier state.
Win32 pairs WM_CHAR/WM_SYSCHAR with their key down, marks keys that use a
pending dead key as DeadCharProcessed, and makes at most one ToUnicodeEx call
per key event. Wayland key repeat resolves the key again on every repeat, so
it types text and follows modifier changes.
ControlCatalog gets a Terminal page with a TERM=ansi-mini terminal on a PTY
(posix_spawn on Linux and macOS, ConPTY on Windows) and a key inspector.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Rename NativeKeyInfo to PlatformKeyInfo and use a string format catalog
Replace the NativeKeyInfoFormat enum with KnownPlatformKeyInfoFormats, a static
class of string values, like the GPU interop handle types. Format is a
constructor parameter of PlatformKeyInfo.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Make KnownPlatformKeyInfoFormats values constants
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Replace the ControlCatalog terminal demo with a key events table
The Key Events page lists KeyDown and TextInput events with their key text,
consumed modifiers and platform scan code and virtual key. A Terminal column
shows what a terminal emulator sends for each key, in caret notation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review feedback on Win32 dead keys, PlatformKeyInfo and layout tables
- PlatformKeyInfo is a readonly record struct.
- Any key that produces text ends a pending dead key, except Ctrl/Alt chords
that produce only control characters, so Enter no longer leaves the next
key marked as DeadCharProcessed.
- A dead key pressed twice reports the dead char as KeyTextIgnoringModifiers.
- The dead-key state is shared by all windows and processes, so a window ends
any pending dead key when it gains focus, instead of resetting its flag on
focus loss.
- Shared helpers for control-character checks.
- Layout tables end a pending dead key before they are built, and are built
with Task.Run.
- Remove the unused VkKeyScanExW import.
- Win32 integration tests that send keyboard input, including Alt+Numpad
with a focus change while Alt is pressed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Rename KeyTextIgnoringModifiers to AlternateKeyText
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* control catalog - support seamless changing of theme and window settings
* addressed review. theme variant is now set on app
* fix bindings being lost when theme changes
* Rewrite PointerCanvas page making it more useful and easy to use
(cherry picked from commit aef6fff3965c29d34702db7513b566e289b541de)
* Remove "Clear" button to reduce vertical toolbar space
* Introduced a better opengl context management API on top of existing interop APIs
* Rename ICompositionGlTexture.Texture to TextureInfo
* Wait for potentially pending import and present
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* ControlCatalog - Side bar improvements
* adjust side bar icon to adapt with side bar size
* update sidebar colors
* add custom title bar decorations to control catalog
* share view code between home page and section page
* improve side bar selection state visual
* drop custom search bar in title decorations
* add page navigation using generic type
* add tests
* add default impl to INavigation api
* fix nullable errors
* update api diff
* addressed comment
* update api
* move page externsion to own class
* make parameter overload non-optional
* ControlCatalog: add dashboard home page with animated hero and nav cards
A new Home page (first in the drawer) modeled on the Accelerate demo
dashboard: a gradient hero banner with floating control glyphs animated
via keyframed TranslateTransforms, followed by categorized card sections
for every catalog page. Cards carry an icon badge, title and one-line
description, and clicking one navigates via SelectedPageIndex so the
drawer selection stays in sync. PageItem gains Description/Category and
the view model exposes grouped HomeSections plus NavigateToPageCommand.
Card colors are self-contained theme dictionaries so the page works
across Fluent/Fluent2/Simple in both variants.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* ControlCatalog: use the Accelerate demo hero banner verbatim on the home page
Replaces the gradient/glyph hero with a 1:1 copy of AvaloniaProDemo's
DashboardView banner: banner-bg backdrop, the four 3D logos floating at
the original positions/durations, and the centered Avalonia wordmark.
Assets copied from the Accelerate repo (~4.8 MB of PNGs).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* DataGridPage was removed
* Make Main Window a bit wider to fit 3 full columns instead of 2.5
* Fix ScreenPage not rendering
* Replace Avalonia old icon with a new one
* Update main logo too
* Force Avalonia SyncContext inside of OnSizeChanged callback
* Restructure MainWindowViewModel_PageList, avoid duplication of categories
* Fix screens page invalidation
* Fix minor warnings
* Redo HomePage items layouting
* Add missing pages
* Reuse $(SharedAssetsPath)
* Don't pin exact patch version of DiagnosticsSupport
* Resize new assets
* Include page section in search
* Use expression setters in main view model
* Restore filtered page sorting
* Fix CI build
* Add 1px margin to the UniformGrid to fix cropped border issue
---------
Co-authored-by: Mike James <michael.james6@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* Add new IPlatformSettings APIs
* Add control catalog PlatformSettingsPage
* Windows PreferredApplicationLanguage implementation
* Browser PreferredApplicationLanguage implementation
* Run API suppressions for the IPlatformSettings
* Rebase PlatformSettingsPage on new ContentPage
* Return CultureInfo.InstalledUICulture instead of CultureInfo.CurrentUICulture for default PreferredApplicationLanguage implementation
* Android PreferredApplicationLanguage implementation
* iOS PreferredApplicationLanguage implementation
* Use GetUserPreferredUILanguages for Win32 implementation instead of GetUserDefaultLocaleName
* MacOS implementation of PreferredApplicationLanguage
* Use GlobalizationPreferences for WIn32 prefered language, GetUserPreferredUILanguages doesn't work as expected with Windows settigns
* Avoid AvaloniaLocator in control catalog
* Remove unused method
* Add value/remarks XML docs on the PreferredApplicationLanguage
* Remove MonoMac.NetStandard
(cherry picked from commit 4aac4c4168a73496b579dd28270e8d71764497c7)
* Several AOT compat issues
(cherry picked from commit e9f0a8e6d29da140f3f255e79bd199067981b0fe)
* Add UnconditionalSuppressMessage to the DataValidationViewModel
* Suppress trimming warning on WithDataAnnotationsValidation method
* Unnecessary AvaloniaXaml
* include TrimmingEnable on all sample projects
* Add missing SelfContained to the WinUI projects
* Include TrimmingEnable on DesignerSupport only for warnings analyzer, explicitly disable IsAotCompatible
* Disable trimming warnings for WinUI projects completely
* Enable back runtime marshalling for samples
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* replace hamburger view with drawer page. use ContentPage in control catalog
* Added Icons
* fix listbox and carousel page
* make MainView drawer page
* add PageNavigationHost to control catalog
---------
Co-authored-by: Javier Suárez Ruiz <javiersuarezruiz@hotmail.com>
* Implemented new drawn window decorations API
TODO: check if it works on Win32, bring back titlebar automation peer
* Adjusting naming a bit
* Naming / configuration changes
* Various fixes
* popover fix?
* wip
* Address review
* Extra window roles
* WIP
* Fixed drawn titlebar automation
* Purge ExtendClientAreaChromeHints.
* Fixed dynamically enabling drawn decorations
* api diff
* Add automation IDs for drawn decorations buttons
* Resolved the issues
* build
* Retry a few times when Pager isn't available after test is finished
* Only do faulty test detection if asked
* duplicate package reference
* Try disabling faulty tests on appium1
* Fix ExtendClientAreaWindowTests
* Apply initial button states
* Enable CSD shadow for X11
* net8?
* Address review
* more review comments
* Moar review comments
* Extra hit-test checks
* Moar review
* Prefix integration test app exitfullscreen to avoid clashes
* Disable drawn decorations if parts = None
* Respect SystemDecorations value on mac in extend-client-area mode
* Tidy up logic a bit
* Adjust win32 tests to titlebar not being in the tree when CSD are not enabled
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Extracted IInputRoot out of TopLevel
* Move some input handling out of TopLevel
* Remove old class, make layout manager private
* Removed IRenderRoot
* Make VisualTreeAttachmentEventArgs a bit more sensible
* Move ILayoutRoot to PresentationSource
# Conflicts:
# tests/Avalonia.Controls.UnitTests/TabControlTests.cs
* Updated some VisualRoot / GetVisualRoot usages
* Updated more XxxRoot usages
* More Root usages
* Addressed review
* Hurr-durr xml
* More fixes
* Maybe fix android compilation
* API diff
* Yet another cast
* I had to use MSIL analysis to detect those casts
* Fixed automation
* Fix PointerOverPreProcessor
* Fix?
* Removed yet another cast to Visual
* The amount of random downcasts is astonishing
* Maybe fix mac
* Addressed review
* add SplitViewPanePlacement settings for Top and Bottom.
* remove duplicated styles.
* add missing transparent fills of lightdismiss area.
* add simple theme support for splitview pane placement top/bottom.
* Add CanMinimize and CanMaximize to Window
* Win32 impl for CanMinimize/CanMaximize
* Add CanResize/CanMinimize/CanMaximize samples to control catalog
* X11 impl for CanMinimize/CanMaximize
* macOS impl for CanMinimize/CanMaximize
* Win32: don't allow restore when the window isn't resizable
* Additional documentation for CanMinimize/CanMaximize
* Add CanMinimize/CanMaximize logic to CaptionButtons
* Use START_COM_ARP_CALL
* Added CanMinimize/CanMaximize integration tests
* Fixed CanMaximize tests on macOS
* IsEditable combox box with text bindings
* Update after #18405 api review
* ComboBox tests for IsEditable
* remove unneeded error being throw when combox is editable and doesn't have text binding properties
* Changes after code review
* only do naviagtion check if combo box is editable
* Fix editable ComboBox tab navigation
* combobox code review improvements
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Minimize private API usages
- AvaloniaLocator.Current shouldn't be used unless really needed.
- Add comments where not possible otherwise
* fix wrong if statements
* 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>