* 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>
* Add Fluent2 theme files
They are the same as Fluent to start.
* Add ColorPicker Fluent2 registrations to ControlCatalog
* Port over initial Fluent2 ColorPicker changes
* Update the ColorViewColorModelRadioButtonTheme
* Update the ColorViewTabItemTheme
* Add back color control base resources with theme dictionaries
* Vertically center text input control content
* Move remaining ColorView resources to the correct file
* Adjust the ColorView tab background
* Fix ColorView background brush resource naming
* Fix ColorControlCheckeredBackground
This again aligns to the Fluent2 naming convention.
* Increase ColorView TabItem selection pill margin
This makes it more visible when opened in a ColorPicker Flyout.
* Unify ColorPreviewerAccentSectionSize
This will allow for changing orientations easier in the future.
* Remove hard-coded Fluent brush from ColorPickerPage
* Fix Flyout content bottom CornerRadius
* Fix centering of Fluent2 DropDownButton chevron
While it was previously corrected to 32px width, it wasn't properly centered.
* Use base Fluent2 brushes directly
* Just use a comment for ColorSpectrum tooltip info
This fixes the IDE warning "The property 'Tip' must have a value"
* Fix spelling
* 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
* Fix the width of the drop down chevron area
This should always be close to 32px (31px in WinUI).
* Make DropDownButton Padding apply only to the content area
* Add missing DropDownButton Fluent2 resources
* Add note on why Padding was moved
* Adjust DropDownButton sample
* Add note on why Padding was moved to Fluent v1 theme
The reason this change was lost in Fluent2 is because it wasn't commented here.
* fix: Support StylableElement for styles inside ContainerQueries
* chore: Add container query sample for TableView columns
Demonstrates a container query that targets a non-visual StyledElement, as requested in the PR review. The option row wraps so that it does not clip while the page is narrowed.
* 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
* feat: Add IsVisible to TableViewColumn
* test: Add TableView IsVisible tests
* feat: Add option to hide a column in the ControlCatalog
* chore: Remove unnecessary remark from property
* docs: An other xml comment cleanup
* fix: Use NaN as a sign that the width is reset and needs recalculation
Also, set the ActualWidth of a hidden column to 0
* chore: Add a comment explaining what NaN means for columns ActualSize
* Add AttachedPropertyAttribute, DirectPropertyAttribute and StyledPropertyAttribute attribtues
* Add shared GeneratedPropertyShape
* Move AvaloniaPropertyAnalyzer ids to DiagnosticIds
* Add generated properties analyzer descriptors
* Implement GeneratedPropertyAnalyzer
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Implement GeneratedProperty code fixers
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Update solution files with new projects
* Enable new diagnostics on Avalonia code itself
* Fix VB project
* Implement actual PropertyGenEmitter
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Replace several manual property declarations in ControlCatalog with new source gen
* Implement basic ConvertToGeneratedProperty analyzer, without code-fixer
* Lower supported C# version to 13
* Misc
* Add AvaloniaPropertyGeneratorIsEnabled msbuild prop
* Fix SetCurrentValue warning
* Use RegisterSyntaxNodeAction instead of RegisterOperationAction for new analyzer
* Fix some of the new CodeFix tests
* Support AddOwner to other generated properties
* Remove `AllowMultiple = false`, it's implied by default
* Remove ChangedMethodName
* Rename new attributes with "Generated" prefix
* Misc improvements
* Enable nullable per each property
* Switch to #nullable enable annotations to not break warnings
* Do not enforce partial callbacks, instead use existing warning if method is missing or incorrect
* Support callbacks defined in the base class
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
* 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>
* Proposal: Add week numbers to Calendar
* FluentTheme for adding CW
* Add sample to ControlCatalog about week numbers
* workaround for XAML not accepting empty strings
* SimpleTheme
* refractor TemplateParts of Calendar
* ensure Calendar updates and improve xml comment
* undo whitespace formatting
* Add some test to CalendarTests
* adress self review
* Introduce a method to show / hide the week numbers panel
since it is not part of the MonthGrid, it can leak into the year view. We solved this by updating IsVisible in code behind just like other template parts.
Moved the header into the panel to show / hide it together with the entire Grid.
* fix typo and redundant cast
* Crush the last moths
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* 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
* fix(SelectableTextBlock): fix SelectableTextBlock selection for centered and right-aligned text
* Fix failing unit tests
* Let TextLayout handle out-of-bounds hit testing
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* 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>
* Use CompiledBinding.Create where possible in sample code
* Avoid "FullyQualifiedName" hacks, use AppContext.BaseDirectory
* Avoid ambigious binding to methods in the sample code
* Use ProcessPath, there are no "dll" in aot
* Disable devtools in release
* Remove "DefineDynamicAssembly" used for persistent assemblies output, we don't target net framework anymore
* Add RequiresDynamicCode to the runtime XAML loader
* Bump XAML
* Bump XAML
* Win32: fix None/BorderOnly maximized position on secondary screens
* Fix WindowCustomizationsPage
* Use correct screen when minimized
* Fallback to nearest monitor
* 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>