Browse Source

Merge branch 'master' into perf-inpc

pull/4020/head
Dariusz Komosiński 6 years ago
committed by GitHub
parent
commit
211c4e5aec
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      samples/ControlCatalog/Pages/ComboBoxPage.xaml
  2. 16
      src/Avalonia.Animation/Animatable.cs
  3. 30
      src/Avalonia.Controls/ComboBox.cs
  4. 2
      src/Avalonia.Controls/ListBoxItem.cs
  5. 37
      src/Avalonia.Controls/Mixins/PressedMixin.cs
  6. 2
      src/Avalonia.Controls/Platform/IPopupImpl.cs
  7. 21
      src/Avalonia.Controls/Primitives/Popup.cs
  8. 6
      src/Avalonia.Controls/Primitives/PopupRoot.cs
  9. 22
      src/Avalonia.Controls/TextBlock.cs
  10. 9
      src/Avalonia.Controls/Utils/BorderRenderHelper.cs
  11. 4
      src/Avalonia.DesignerSupport/Remote/Stubs.cs
  12. 2
      src/Avalonia.Input/NavigationDirection.cs
  13. 5
      src/Avalonia.Native/PopupImpl.cs
  14. 14
      src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml
  15. 14
      src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml
  16. 130
      src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml
  17. 130
      src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml
  18. 190
      src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml
  19. 190
      src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml
  20. 69
      src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml
  21. 234
      src/Avalonia.Themes.Fluent/ComboBox.xaml
  22. 34
      src/Avalonia.Themes.Fluent/ComboBoxItem.xaml
  23. 70
      src/Avalonia.Themes.Fluent/ListBox.xaml
  24. 90
      src/Avalonia.Themes.Fluent/ListBoxItem.xaml
  25. 38
      src/Avalonia.Themes.Fluent/PopupRoot.xaml
  26. 207
      src/Avalonia.Themes.Fluent/RadioButton.xaml
  27. 14
      src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs
  28. 4
      src/Avalonia.X11/X11Window.cs
  29. 12
      src/Linux/Avalonia.LinuxFramebuffer/Output/Drm.cs
  30. 23
      src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs
  31. 3
      src/Windows/Avalonia.Win32/Avalonia.Win32.csproj
  32. 34
      src/Windows/Avalonia.Win32/PopupImpl.cs
  33. 2
      src/Windows/Avalonia.Win32/Win32Platform.cs
  34. 65
      tests/Avalonia.Animation.UnitTests/AnimatableTests.cs
  35. 37
      tests/Avalonia.Controls.UnitTests/Mixins/PressedMixinTests.cs
  36. 2
      tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs
  37. 20
      tests/Avalonia.Skia.UnitTests/TextLayoutTests.cs

2
samples/ControlCatalog/Pages/ComboBoxPage.xaml

@ -6,7 +6,7 @@
<TextBlock Classes="h2">A drop-down list.</TextBlock> <TextBlock Classes="h2">A drop-down list.</TextBlock>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 16 0 0" Spacing="8"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 16 0 0" Spacing="8">
<ComboBox SelectedIndex="0"> <ComboBox PlaceholderText="Pick an Item">
<ComboBoxItem>Inline Items</ComboBoxItem> <ComboBoxItem>Inline Items</ComboBoxItem>
<ComboBoxItem>Inline Item 2</ComboBoxItem> <ComboBoxItem>Inline Item 2</ComboBoxItem>
<ComboBoxItem>Inline Item 3</ComboBoxItem> <ComboBoxItem>Inline Item 3</ComboBoxItem>

16
src/Avalonia.Animation/Animatable.cs

@ -93,17 +93,17 @@ namespace Avalonia.Animation
var oldTransitions = change.OldValue.GetValueOrDefault<Transitions>(); var oldTransitions = change.OldValue.GetValueOrDefault<Transitions>();
var newTransitions = change.NewValue.GetValueOrDefault<Transitions>(); var newTransitions = change.NewValue.GetValueOrDefault<Transitions>();
if (oldTransitions is object)
{
oldTransitions.CollectionChanged -= TransitionsCollectionChanged;
RemoveTransitions(oldTransitions);
}
if (newTransitions is object) if (newTransitions is object)
{ {
newTransitions.CollectionChanged += TransitionsCollectionChanged; newTransitions.CollectionChanged += TransitionsCollectionChanged;
AddTransitions(newTransitions); AddTransitions(newTransitions);
} }
if (oldTransitions is object)
{
oldTransitions.CollectionChanged -= TransitionsCollectionChanged;
RemoveTransitions(oldTransitions);
}
} }
else if (_transitionsEnabled && else if (_transitionsEnabled &&
Transitions is object && Transitions is object &&
@ -111,8 +111,10 @@ namespace Avalonia.Animation
!change.Property.IsDirect && !change.Property.IsDirect &&
change.Priority > BindingPriority.Animation) change.Priority > BindingPriority.Animation)
{ {
foreach (var transition in Transitions) for (var i = Transitions.Count -1; i >= 0; --i)
{ {
var transition = Transitions[i];
if (transition.Property == change.Property) if (transition.Property == change.Property)
{ {
var state = _transitionState[transition]; var state = _transitionState[transition];

30
src/Avalonia.Controls/ComboBox.cs

@ -51,6 +51,18 @@ namespace Avalonia.Controls
public static readonly StyledProperty<ItemVirtualizationMode> VirtualizationModeProperty = public static readonly StyledProperty<ItemVirtualizationMode> VirtualizationModeProperty =
ItemsPresenter.VirtualizationModeProperty.AddOwner<ComboBox>(); ItemsPresenter.VirtualizationModeProperty.AddOwner<ComboBox>();
/// <summary>
/// Defines the <see cref="PlaceholderText"/> property.
/// </summary>
public static readonly StyledProperty<string> PlaceholderTextProperty =
AvaloniaProperty.Register<ComboBox, string>(nameof(PlaceholderText));
/// <summary>
/// Defines the <see cref="PlaceholderForeground"/> property.
/// </summary>
public static readonly StyledProperty<IBrush> PlaceholderForegroundProperty =
AvaloniaProperty.Register<ComboBox, IBrush>(nameof(PlaceholderForeground));
private bool _isDropDownOpen; private bool _isDropDownOpen;
private Popup _popup; private Popup _popup;
private object _selectionBoxItem; private object _selectionBoxItem;
@ -94,6 +106,24 @@ namespace Avalonia.Controls
set { SetAndRaise(SelectionBoxItemProperty, ref _selectionBoxItem, value); } set { SetAndRaise(SelectionBoxItemProperty, ref _selectionBoxItem, value); }
} }
/// <summary>
/// Gets or sets the PlaceHolder text.
/// </summary>
public string PlaceholderText
{
get { return GetValue(PlaceholderTextProperty); }
set { SetValue(PlaceholderTextProperty, value); }
}
/// <summary>
/// Gets or sets the Brush that renders the placeholder text.
/// </summary>
public IBrush PlaceholderForeground
{
get { return GetValue(PlaceholderForegroundProperty); }
set { SetValue(PlaceholderForegroundProperty, value); }
}
/// <summary> /// <summary>
/// Gets or sets the virtualization mode for the items. /// Gets or sets the virtualization mode for the items.
/// </summary> /// </summary>

2
src/Avalonia.Controls/ListBoxItem.cs

@ -1,4 +1,5 @@
using Avalonia.Controls.Mixins; using Avalonia.Controls.Mixins;
using Avalonia.Input;
namespace Avalonia.Controls namespace Avalonia.Controls
{ {
@ -19,6 +20,7 @@ namespace Avalonia.Controls
static ListBoxItem() static ListBoxItem()
{ {
SelectableMixin.Attach<ListBoxItem>(IsSelectedProperty); SelectableMixin.Attach<ListBoxItem>(IsSelectedProperty);
PressedMixin.Attach<ListBoxItem>();
FocusableProperty.OverrideDefaultValue<ListBoxItem>(true); FocusableProperty.OverrideDefaultValue<ListBoxItem>(true);
} }

37
src/Avalonia.Controls/Mixins/PressedMixin.cs

@ -0,0 +1,37 @@
using Avalonia.Interactivity;
using Avalonia.Input;
namespace Avalonia.Controls.Mixins
{
/// <summary>
/// Adds pressed functionality to control classes.
///
/// Adds the ':pressed' class when the item is pressed.
/// </summary>
public static class PressedMixin
{
/// <summary>
/// Initializes a new instance of the <see cref="PressedMixin"/> class.
/// </summary>
/// <typeparam name="TControl">The control type.</typeparam>
public static void Attach<TControl>() where TControl : Control
{
InputElement.PointerPressedEvent.AddClassHandler<TControl>((x, e) => HandlePointerPressed(x, e), RoutingStrategies.Tunnel);
InputElement.PointerReleasedEvent.AddClassHandler<TControl>((x, e) => HandlePointerReleased(x), RoutingStrategies.Tunnel);
InputElement.PointerCaptureLostEvent.AddClassHandler<TControl>((x, e) => HandlePointerReleased(x), RoutingStrategies.Tunnel);
}
private static void HandlePointerPressed<TControl>(TControl sender, PointerPressedEventArgs e) where TControl : Control
{
if (e.GetCurrentPoint(sender).Properties.IsLeftButtonPressed)
{
((IPseudoClasses)sender.Classes).Set(":pressed", true);
}
}
private static void HandlePointerReleased<TControl>(TControl sender) where TControl : Control
{
((IPseudoClasses)sender.Classes).Set(":pressed", false);
}
}
}

2
src/Avalonia.Controls/Platform/IPopupImpl.cs

@ -8,5 +8,7 @@ namespace Avalonia.Platform
public interface IPopupImpl : IWindowBaseImpl public interface IPopupImpl : IWindowBaseImpl
{ {
IPopupPositioner PopupPositioner { get; } IPopupPositioner PopupPositioner { get; }
void SetWindowManagerAddShadowHint(bool enabled);
} }
} }

21
src/Avalonia.Controls/Primitives/Popup.cs

@ -19,6 +19,9 @@ namespace Avalonia.Controls.Primitives
/// </summary> /// </summary>
public class Popup : Control, IVisualTreeHost public class Popup : Control, IVisualTreeHost
{ {
public static readonly StyledProperty<bool> WindowManagerAddShadowHintProperty =
AvaloniaProperty.Register<PopupRoot, bool>(nameof(WindowManagerAddShadowHint), true);
/// <summary> /// <summary>
/// Defines the <see cref="Child"/> property. /// Defines the <see cref="Child"/> property.
/// </summary> /// </summary>
@ -89,7 +92,7 @@ namespace Avalonia.Controls.Primitives
{ {
IsHitTestVisibleProperty.OverrideDefaultValue<Popup>(false); IsHitTestVisibleProperty.OverrideDefaultValue<Popup>(false);
ChildProperty.Changed.AddClassHandler<Popup>((x, e) => x.ChildChanged(e)); ChildProperty.Changed.AddClassHandler<Popup>((x, e) => x.ChildChanged(e));
IsOpenProperty.Changed.AddClassHandler<Popup>((x, e) => x.IsOpenChanged((AvaloniaPropertyChangedEventArgs<bool>)e)); IsOpenProperty.Changed.AddClassHandler<Popup>((x, e) => x.IsOpenChanged((AvaloniaPropertyChangedEventArgs<bool>)e));
} }
/// <summary> /// <summary>
@ -104,6 +107,12 @@ namespace Avalonia.Controls.Primitives
public IPopupHost? Host => _openState?.PopupHost; public IPopupHost? Host => _openState?.PopupHost;
public bool WindowManagerAddShadowHint
{
get { return GetValue(WindowManagerAddShadowHintProperty); }
set { SetValue(WindowManagerAddShadowHintProperty, value); }
}
/// <summary> /// <summary>
/// Gets or sets the control to display in the popup. /// Gets or sets the control to display in the popup.
/// </summary> /// </summary>
@ -293,6 +302,8 @@ namespace Avalonia.Controls.Primitives
_openState = new PopupOpenState(topLevel, popupHost, cleanupPopup); _openState = new PopupOpenState(topLevel, popupHost, cleanupPopup);
WindowManagerAddShadowHintChanged(popupHost, WindowManagerAddShadowHint);
popupHost.Show(); popupHost.Show();
using (BeginIgnoringIsOpen()) using (BeginIgnoringIsOpen())
@ -332,6 +343,14 @@ namespace Avalonia.Controls.Primitives
return Disposable.Create((unsubscribe, target, handler), state => state.unsubscribe(state.target, state.handler)); return Disposable.Create((unsubscribe, target, handler), state => state.unsubscribe(state.target, state.handler));
} }
private void WindowManagerAddShadowHintChanged(IPopupHost host, bool hint)
{
if(host is PopupRoot pr)
{
pr.PlatformImpl.SetWindowManagerAddShadowHint(hint);
}
}
/// <summary> /// <summary>
/// Called when the <see cref="IsOpen"/> property changes. /// Called when the <see cref="IsOpen"/> property changes.
/// </summary> /// </summary>

6
src/Avalonia.Controls/Primitives/PopupRoot.cs

@ -17,14 +17,14 @@ namespace Avalonia.Controls.Primitives
public sealed class PopupRoot : WindowBase, IInteractive, IHostedVisualTreeRoot, IDisposable, IStyleHost, IPopupHost public sealed class PopupRoot : WindowBase, IInteractive, IHostedVisualTreeRoot, IDisposable, IStyleHost, IPopupHost
{ {
private readonly TopLevel _parent; private readonly TopLevel _parent;
private PopupPositionerParameters _positionerParameters; private PopupPositionerParameters _positionerParameters;
/// <summary> /// <summary>
/// Initializes static members of the <see cref="PopupRoot"/> class. /// Initializes static members of the <see cref="PopupRoot"/> class.
/// </summary> /// </summary>
static PopupRoot() static PopupRoot()
{ {
BackgroundProperty.OverrideDefaultValue(typeof(PopupRoot), Brushes.White); BackgroundProperty.OverrideDefaultValue(typeof(PopupRoot), Brushes.White);
} }
/// <summary> /// <summary>
@ -53,7 +53,7 @@ namespace Avalonia.Controls.Primitives
/// Gets the platform-specific window implementation. /// Gets the platform-specific window implementation.
/// </summary> /// </summary>
[CanBeNull] [CanBeNull]
public new IPopupImpl PlatformImpl => (IPopupImpl)base.PlatformImpl; public new IPopupImpl PlatformImpl => (IPopupImpl)base.PlatformImpl;
/// <summary> /// <summary>
/// Gets the parent control in the event route. /// Gets the parent control in the event route.

22
src/Avalonia.Controls/TextBlock.cs

@ -70,6 +70,14 @@ namespace Avalonia.Controls
Brushes.Black, Brushes.Black,
inherits: true); inherits: true);
/// <summary>
/// Defines the <see cref="MaxLines"/> property.
/// </summary>
public static readonly StyledProperty<int> MaxLinesProperty =
AvaloniaProperty.Register<TextBlock, int>(
nameof(MaxLines),
validate: IsValidMaxLines);
/// <summary> /// <summary>
/// Defines the <see cref="Text"/> property. /// Defines the <see cref="Text"/> property.
/// </summary> /// </summary>
@ -222,6 +230,15 @@ namespace Avalonia.Controls
set { SetValue(ForegroundProperty, value); } set { SetValue(ForegroundProperty, value); }
} }
/// <summary>
/// Gets or sets the maximum number of text lines.
/// </summary>
public int MaxLines
{
get => GetValue(MaxLinesProperty);
set => SetValue(MaxLinesProperty, value);
}
/// <summary> /// <summary>
/// Gets or sets the control's text wrapping mode. /// Gets or sets the control's text wrapping mode.
/// </summary> /// </summary>
@ -404,7 +421,8 @@ namespace Avalonia.Controls
TextTrimming, TextTrimming,
TextDecorations, TextDecorations,
constraint.Width, constraint.Width,
constraint.Height); constraint.Height,
MaxLines);
} }
/// <summary> /// <summary>
@ -451,5 +469,7 @@ namespace Avalonia.Controls
InvalidateMeasure(); InvalidateMeasure();
} }
private static bool IsValidMaxLines(int maxLines) => maxLines >= 0;
} }
} }

9
src/Avalonia.Controls/Utils/BorderRenderHelper.cs

@ -118,12 +118,11 @@ namespace Avalonia.Controls.Utils
pen = new Pen(borderBrush, borderThickness); pen = new Pen(borderBrush, borderThickness);
} }
var rrect = new RoundedRect(new Rect(_size), _cornerRadius.TopLeft, _cornerRadius.TopRight, var rect = new Rect(_size);
_cornerRadius.BottomRight, _cornerRadius.BottomLeft);
if (Math.Abs(borderThickness) > double.Epsilon) if (Math.Abs(borderThickness) > double.Epsilon)
{ rect = rect.Deflate(borderThickness * 0.5);
rrect = rrect.Deflate(borderThickness * 0.5, borderThickness * 0.5); var rrect = new RoundedRect(rect, _cornerRadius.TopLeft, _cornerRadius.TopRight,
} _cornerRadius.BottomRight, _cornerRadius.BottomLeft);
context.PlatformImpl.DrawRectangle(background, pen, rrect, boxShadows); context.PlatformImpl.DrawRectangle(background, pen, rrect, boxShadows);
} }

4
src/Avalonia.DesignerSupport/Remote/Stubs.cs

@ -146,6 +146,10 @@ namespace Avalonia.DesignerSupport.Remote
public void SetTransparencyLevelHint(WindowTransparencyLevel transparencyLevel) { } public void SetTransparencyLevelHint(WindowTransparencyLevel transparencyLevel) { }
public void SetWindowManagerAddShadowHint(bool enabled)
{
}
public WindowTransparencyLevel TransparencyLevel { get; private set; } public WindowTransparencyLevel TransparencyLevel { get; private set; }
} }

2
src/Avalonia.Input/NavigationDirection.cs

@ -102,7 +102,7 @@ namespace Avalonia.Input
switch (key) switch (key)
{ {
case Key.Tab: case Key.Tab:
return (modifiers & KeyModifiers.Shift) != 0 ? return (modifiers & KeyModifiers.Shift) == 0 ?
NavigationDirection.Next : NavigationDirection.Previous; NavigationDirection.Next : NavigationDirection.Previous;
case Key.Up: case Key.Up:
return NavigationDirection.Up; return NavigationDirection.Up;

5
src/Avalonia.Native/PopupImpl.cs

@ -59,6 +59,11 @@ namespace Avalonia.Native
} }
public override IPopupImpl CreatePopup() => new PopupImpl(_factory, _opts, _glFeature, this); public override IPopupImpl CreatePopup() => new PopupImpl(_factory, _opts, _glFeature, this);
public void SetWindowManagerAddShadowHint(bool enabled)
{
}
public IPopupPositioner PopupPositioner { get; } public IPopupPositioner PopupPositioner { get; }
} }
} }

14
src/Avalonia.Themes.Fluent/Accents/BaseDark.xaml

@ -138,7 +138,9 @@
<SolidColorBrush x:Key="SystemControlTransparentBrush" Color="Transparent" /> <SolidColorBrush x:Key="SystemControlTransparentBrush" Color="Transparent" />
<SolidColorBrush x:Key="SystemControlErrorTextForegroundBrush" Color="{StaticResource SystemErrorTextColor}" /> <SolidColorBrush x:Key="SystemControlErrorTextForegroundBrush" Color="{StaticResource SystemErrorTextColor}" />
<SolidColorBrush x:Key="SystemControlTransientBorderBrush" Color="#000000" Opacity="0.36" /> <SolidColorBrush x:Key="SystemControlTransientBorderBrush" Color="#000000" Opacity="0.36" />
<!-- TODO implement AcrylicBrush -->
<!--<AcrylicBrush x:Key="SystemControlTransientBackgroundBrush" BackgroundSource="HostBackdrop" TintColor="{StaticResource SystemChromeAltHighColor}" TintOpacity="0.8" FallbackColor="{StaticResource SystemChromeMediumLowColor}" />--> <!--<AcrylicBrush x:Key="SystemControlTransientBackgroundBrush" BackgroundSource="HostBackdrop" TintColor="{StaticResource SystemChromeAltHighColor}" TintOpacity="0.8" FallbackColor="{StaticResource SystemChromeMediumLowColor}" />-->
<SolidColorBrush x:Key="SystemControlTransientBackgroundBrush" Color="{StaticResource SystemChromeMediumLowColor}" />
<StaticResource x:Key="SystemControlDescriptionTextForegroundBrush" ResourceKey="SystemControlPageTextBaseMediumBrush" /> <StaticResource x:Key="SystemControlDescriptionTextForegroundBrush" ResourceKey="SystemControlPageTextBaseMediumBrush" />
<x:Boolean x:Key="IsApplicationFocusVisualKindReveal">False</x:Boolean> <x:Boolean x:Key="IsApplicationFocusVisualKindReveal">False</x:Boolean>
@ -159,8 +161,8 @@
<x:Double x:Key="AppBarThemeMinimalHeight">24</x:Double> <x:Double x:Key="AppBarThemeMinimalHeight">24</x:Double>
<x:Double x:Key="AppBarThemeCompactHeight">40</x:Double> <x:Double x:Key="AppBarThemeCompactHeight">40</x:Double>
<x:Double x:Key="AppBarExpandButtonCircleDiameter">3</x:Double> <x:Double x:Key="AppBarExpandButtonCircleDiameter">3</x:Double>
<x:Double x:Key="AutoSuggestListMaxHeight">374</x:Double> <x:Double x:Key="AutoCompleteListMaxHeight">374</x:Double>
<x:Double x:Key="AutoSuggestListBorderOpacity">0</x:Double> <x:Double x:Key="AutoCompleteListBorderOpacity">0</x:Double>
<Thickness x:Key="CheckBoxBorderThemeThickness">2</Thickness> <Thickness x:Key="CheckBoxBorderThemeThickness">2</Thickness>
<Thickness x:Key="CheckBoxCheckedStrokeThickness">0</Thickness> <Thickness x:Key="CheckBoxCheckedStrokeThickness">0</Thickness>
<x:Double x:Key="ComboBoxArrowThemeFontSize">21</x:Double> <x:Double x:Key="ComboBoxArrowThemeFontSize">21</x:Double>
@ -258,10 +260,10 @@
<Thickness x:Key="AppBarTopBorderThemeThickness">0,0,0,0</Thickness> <Thickness x:Key="AppBarTopBorderThemeThickness">0,0,0,0</Thickness>
<Thickness x:Key="AppBarTopThemePadding">0,0,0,0</Thickness> <Thickness x:Key="AppBarTopThemePadding">0,0,0,0</Thickness>
<Thickness x:Key="AppBarExpandButtonCircleInnerPadding">3,0,3,0</Thickness> <Thickness x:Key="AppBarExpandButtonCircleInnerPadding">3,0,3,0</Thickness>
<Thickness x:Key="AutoSuggestListBorderThemeThickness">1</Thickness> <Thickness x:Key="AutoCompleteListBorderThemeThickness">1</Thickness>
<Thickness x:Key="AutoSuggestListMargin">0,2,0,2</Thickness> <Thickness x:Key="AutoCompleteListMargin">0,2,0,2</Thickness>
<Thickness x:Key="AutoSuggestListPadding">-1,0,-1,0</Thickness> <Thickness x:Key="AutoCompleteListPadding">-1,0,-1,0</Thickness>
<Thickness x:Key="AutoSuggestListViewItemMargin">12,11,0,13</Thickness> <Thickness x:Key="AutoCompleteListViewItemMargin">12,11,0,13</Thickness>
<Thickness x:Key="ButtonBorderThemeThickness">2</Thickness> <Thickness x:Key="ButtonBorderThemeThickness">2</Thickness>
<Thickness x:Key="CalendarDatePickerBorderThemeThickness">2</Thickness> <Thickness x:Key="CalendarDatePickerBorderThemeThickness">2</Thickness>
<Thickness x:Key="ComboBoxBorderThemeThickness">2</Thickness> <Thickness x:Key="ComboBoxBorderThemeThickness">2</Thickness>

14
src/Avalonia.Themes.Fluent/Accents/BaseLight.xaml

@ -138,7 +138,9 @@
<SolidColorBrush x:Key="SystemControlTransparentBrush" Color="Transparent" /> <SolidColorBrush x:Key="SystemControlTransparentBrush" Color="Transparent" />
<SolidColorBrush x:Key="SystemControlErrorTextForegroundBrush" Color="{StaticResource SystemErrorTextColor}" /> <SolidColorBrush x:Key="SystemControlErrorTextForegroundBrush" Color="{StaticResource SystemErrorTextColor}" />
<SolidColorBrush x:Key="SystemControlTransientBorderBrush" Color="#000000" Opacity="0.14" /> <SolidColorBrush x:Key="SystemControlTransientBorderBrush" Color="#000000" Opacity="0.14" />
<!-- TODO implement AcrylicBrush -->
<!--<AcrylicBrush x:Key="SystemControlTransientBackgroundBrush" BackgroundSource="HostBackdrop" TintColor="{StaticResource SystemChromeAltHighColor}" TintOpacity="0.8" FallbackColor="{StaticResource SystemChromeMediumLowColor}" />--> <!--<AcrylicBrush x:Key="SystemControlTransientBackgroundBrush" BackgroundSource="HostBackdrop" TintColor="{StaticResource SystemChromeAltHighColor}" TintOpacity="0.8" FallbackColor="{StaticResource SystemChromeMediumLowColor}" />-->
<SolidColorBrush x:Key="SystemControlTransientBackgroundBrush" Color="{StaticResource SystemChromeMediumLowColor}" />
<StaticResource x:Key="SystemControlDescriptionTextForegroundBrush" ResourceKey="SystemControlPageTextBaseMediumBrush" /> <StaticResource x:Key="SystemControlDescriptionTextForegroundBrush" ResourceKey="SystemControlPageTextBaseMediumBrush" />
<x:Boolean x:Key="IsApplicationFocusVisualKindReveal">False</x:Boolean> <x:Boolean x:Key="IsApplicationFocusVisualKindReveal">False</x:Boolean>
@ -158,8 +160,8 @@
<x:Double x:Key="AppBarThemeMinimalHeight">24</x:Double> <x:Double x:Key="AppBarThemeMinimalHeight">24</x:Double>
<x:Double x:Key="AppBarThemeCompactHeight">40</x:Double> <x:Double x:Key="AppBarThemeCompactHeight">40</x:Double>
<x:Double x:Key="AppBarExpandButtonCircleDiameter">3</x:Double> <x:Double x:Key="AppBarExpandButtonCircleDiameter">3</x:Double>
<x:Double x:Key="AutoSuggestListMaxHeight">374</x:Double> <x:Double x:Key="AutoCompleteListMaxHeight">374</x:Double>
<x:Double x:Key="AutoSuggestListBorderOpacity">0</x:Double> <x:Double x:Key="AutoCompleteListBorderOpacity">0</x:Double>
<Thickness x:Key="CheckBoxBorderThemeThickness">2</Thickness> <Thickness x:Key="CheckBoxBorderThemeThickness">2</Thickness>
<Thickness x:Key="CheckBoxCheckedStrokeThickness">0</Thickness> <Thickness x:Key="CheckBoxCheckedStrokeThickness">0</Thickness>
<x:Double x:Key="ComboBoxArrowThemeFontSize">21</x:Double> <x:Double x:Key="ComboBoxArrowThemeFontSize">21</x:Double>
@ -257,10 +259,10 @@
<Thickness x:Key="AppBarTopBorderThemeThickness">0,0,0,0</Thickness> <Thickness x:Key="AppBarTopBorderThemeThickness">0,0,0,0</Thickness>
<Thickness x:Key="AppBarTopThemePadding">0,0,0,0</Thickness> <Thickness x:Key="AppBarTopThemePadding">0,0,0,0</Thickness>
<Thickness x:Key="AppBarExpandButtonCircleInnerPadding">3,0,3,0</Thickness> <Thickness x:Key="AppBarExpandButtonCircleInnerPadding">3,0,3,0</Thickness>
<Thickness x:Key="AutoSuggestListBorderThemeThickness">1</Thickness> <Thickness x:Key="AutoCompleteListBorderThemeThickness">1</Thickness>
<Thickness x:Key="AutoSuggestListMargin">0,2,0,2</Thickness> <Thickness x:Key="AutoCompleteListMargin">0,2,0,2</Thickness>
<Thickness x:Key="AutoSuggestListPadding">-1,0,-1,0</Thickness> <Thickness x:Key="AutoCompleteListPadding">-1,0,-1,0</Thickness>
<Thickness x:Key="AutoSuggestListViewItemMargin">12,11,0,13</Thickness> <Thickness x:Key="AutoCompleteListViewItemMargin">12,11,0,13</Thickness>
<Thickness x:Key="ButtonBorderThemeThickness">2</Thickness> <Thickness x:Key="ButtonBorderThemeThickness">2</Thickness>
<Thickness x:Key="CalendarDatePickerBorderThemeThickness">2</Thickness> <Thickness x:Key="CalendarDatePickerBorderThemeThickness">2</Thickness>
<Thickness x:Key="ComboBoxBorderThemeThickness">2</Thickness> <Thickness x:Key="ComboBoxBorderThemeThickness">2</Thickness>

130
src/Avalonia.Themes.Fluent/Accents/FluentBaseDark.xaml

@ -1,6 +1,4 @@
<Style xmlns="https://github.com/avaloniaui" <Style xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=netstandard">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard">
<Style.Resources> <Style.Resources>
<Color x:Key="SystemAccentColor">#FF0078D7</Color> <Color x:Key="SystemAccentColor">#FF0078D7</Color>
<Color x:Key="SystemAltHighColor">#FF000000</Color> <Color x:Key="SystemAltHighColor">#FF000000</Color>
@ -33,9 +31,11 @@
<Color x:Key="SystemRevealListLowColor">#FF1D1D1D</Color> <Color x:Key="SystemRevealListLowColor">#FF1D1D1D</Color>
<Color x:Key="SystemRevealListMediumColor">#FF333333</Color> <Color x:Key="SystemRevealListMediumColor">#FF333333</Color>
<!--<AcrylicBrush x:Key="SystemControlAcrylicWindowBrush" BackgroundSource="HostBackdrop" TintColor="{ThemeResource SystemChromeAltHighColor}" TintOpacity="0.8" FallbackColor="{ThemeResource SystemChromeMediumColor}" />--> <!--<AcrylicBrush x:Key="SystemControlAcrylicWindowBrush" BackgroundSource="HostBackdrop" TintColor="{ThemeResource SystemChromeAltHighColor}" TintOpacity="0.8" FallbackColor="{ThemeResource SystemChromeMediumColor}" />-->
<!-- Override system shape defaults --> <!-- Override system shape defaults -->
<CornerRadius x:Key="ControlCornerRadius">2,2,2,2</CornerRadius> <CornerRadius x:Key="ControlCornerRadius">2,2,2,2</CornerRadius>
<CornerRadius x:Key="OverlayCornerRadius">4,4,4,4</CornerRadius> <CornerRadius x:Key="OverlayCornerRadius">4,4,4,4</CornerRadius>
<!-- Override system borders --> <!-- Override system borders -->
<Thickness x:Key="MenuBarItemBorderThickness">1,1,1,1</Thickness> <Thickness x:Key="MenuBarItemBorderThickness">1,1,1,1</Thickness>
<Thickness x:Key="GridViewItemMultiselectBorderThickness">1,1,1,1</Thickness> <Thickness x:Key="GridViewItemMultiselectBorderThickness">1,1,1,1</Thickness>
@ -61,6 +61,7 @@
<Thickness x:Key="GridViewItemRevealBorderThemeThickness">1,1,1,1</Thickness> <Thickness x:Key="GridViewItemRevealBorderThemeThickness">1,1,1,1</Thickness>
<Thickness x:Key="ComboBoxItemRevealBorderThemeThickness">1,1,1,1</Thickness> <Thickness x:Key="ComboBoxItemRevealBorderThemeThickness">1,1,1,1</Thickness>
<x:Double x:Key="PersonPictureEllipseBadgeStrokeThickness">1</x:Double> <x:Double x:Key="PersonPictureEllipseBadgeStrokeThickness">1</x:Double>
<!-- Override system generated accent colors --> <!-- Override system generated accent colors -->
<Color x:Key="SystemAccentColorDark1">#FF005A9E</Color> <Color x:Key="SystemAccentColorDark1">#FF005A9E</Color>
<Color x:Key="SystemAccentColorDark2">#FF004275</Color> <Color x:Key="SystemAccentColorDark2">#FF004275</Color>
@ -70,7 +71,7 @@
<Color x:Key="SystemAccentColorLight3">#FFA6D8FF</Color> <Color x:Key="SystemAccentColorLight3">#FFA6D8FF</Color>
<Color x:Key="RegionColor">#FF000000</Color> <Color x:Key="RegionColor">#FF000000</Color>
<SolidColorBrush x:Key="RegionBrush" Color="{StaticResource RegionColor}" /> <SolidColorBrush x:Key="RegionBrush" Color="{StaticResource RegionColor}" />
<!-- BaseResources for Button.xaml --> <!-- BaseResources for Button.xaml -->
<StaticResource x:Key="ButtonBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" /> <StaticResource x:Key="ButtonBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<StaticResource x:Key="ButtonBackgroundPointerOver" ResourceKey="SystemControlBackgroundBaseLowBrush" /> <StaticResource x:Key="ButtonBackgroundPointerOver" ResourceKey="SystemControlBackgroundBaseLowBrush" />
@ -85,6 +86,83 @@
<StaticResource x:Key="ButtonBorderBrushPressed" ResourceKey="SystemControlHighlightTransparentBrush" /> <StaticResource x:Key="ButtonBorderBrushPressed" ResourceKey="SystemControlHighlightTransparentBrush" />
<StaticResource x:Key="ButtonBorderBrushDisabled" ResourceKey="SystemControlDisabledTransparentBrush" /> <StaticResource x:Key="ButtonBorderBrushDisabled" ResourceKey="SystemControlDisabledTransparentBrush" />
<!-- BaseResources for ComboBox.xaml -->
<StaticResource x:Key="ComboBoxItemForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelected" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedUnfocused" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxItemBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPressed" ResourceKey="SystemControlHighlightListMediumBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPointerOver" ResourceKey="SystemControlHighlightListLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelected" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedUnfocused" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPressed" ResourceKey="SystemControlHighlightListAccentHighBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPointerOver" ResourceKey="SystemControlHighlightListAccentMediumBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelected" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedUnfocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackground" ResourceKey="SystemControlBackgroundAltMediumLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundPointerOver" ResourceKey="SystemControlPageBackgroundAltMediumBrush" />
<StaticResource x:Key="ComboBoxBackgroundPressed" ResourceKey="SystemControlBackgroundListMediumBrush" />
<StaticResource x:Key="ComboBoxBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundUnfocused" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundBorderBrushFocused" ResourceKey="SystemControlHighlightTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundBorderBrushUnfocused" ResourceKey="SystemControlHighlightBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxForegroundFocused" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForeground" ResourceKey="SystemControlPageTextBaseHighBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxBorderBrush" ResourceKey="SystemControlForegroundBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPointerOver" ResourceKey="SystemControlHighlightBaseMediumBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPressed" ResourceKey="SystemControlHighlightBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxBorderBrushDisabled" ResourceKey="SystemControlDisabledBaseLowBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerOver" ResourceKey="SystemControlBackgroundListLowBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerPressed" ResourceKey="SystemControlBackgroundListMediumBrush" />
<StaticResource x:Key="ComboBoxFocusedDropDownBackgroundPointerOver" ResourceKey="SystemControlBackgroundChromeBlackLowBrush" />
<StaticResource x:Key="ComboBoxFocusedDropDownBackgroundPointerPressed" ResourceKey="SystemControlBackgroundChromeBlackMediumLowBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForeground" ResourceKey="SystemControlForegroundBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxEditableDropDownGlyphForeground" ResourceKey="SystemControlForegroundAltMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocused" ResourceKey="SystemControlHighlightAltBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownBackground" ResourceKey="SystemControlTransientBackgroundBrush" />
<StaticResource x:Key="ComboBoxDropDownForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxDropDownBorderBrush" ResourceKey="SystemControlTransientBorderBrush" />
<!-- BaseResources for ListBox.xaml -->
<Thickness x:Key="ListBoxBorderThemeThickness">0</Thickness>
<SolidColorBrush x:Key="ListBoxBackgroundThemeBrush" Color="#CCFFFFFF" />
<SolidColorBrush x:Key="ListBoxBorderThemeBrush" Color="Transparent" />
<SolidColorBrush x:Key="ListBoxDisabledForegroundThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="ListBoxFocusBackgroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ListBoxForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemDisabledForegroundThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="ListBoxItemPointerOverBackgroundThemeBrush" Color="#21000000" />
<SolidColorBrush x:Key="ListBoxItemPointerOverForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemPressedBackgroundThemeBrush" Color="#FFD3D3D3" />
<SolidColorBrush x:Key="ListBoxItemPressedForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemSelectedBackgroundThemeBrush" Color="#FF4617B4" />
<SolidColorBrush x:Key="ListBoxItemSelectedDisabledBackgroundThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="ListBoxItemSelectedDisabledForegroundThemeBrush" Color="#99000000" />
<SolidColorBrush x:Key="ListBoxItemSelectedForegroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="ListBoxItemSelectedPointerOverBackgroundThemeBrush" Color="#FF5F37BE" />
<!-- BaseResources for TextBox.xaml --> <!-- BaseResources for TextBox.xaml -->
<StaticResource x:Key="TextControlForeground" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="TextControlForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="TextControlForegroundPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="TextControlForegroundPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" />
@ -117,6 +195,12 @@
<StaticResource x:Key="ContentLinkForegroundColor" ResourceKey="SystemControlHyperlinkTextBrush" /> <StaticResource x:Key="ContentLinkForegroundColor" ResourceKey="SystemControlHyperlinkTextBrush" />
<StaticResource x:Key="ContentLinkBackgroundColor" ResourceKey="SystemControlPageBackgroundChromeLowBrush" /> <StaticResource x:Key="ContentLinkBackgroundColor" ResourceKey="SystemControlPageBackgroundChromeLowBrush" />
<!-- Resources for AutoCompleteBox.xaml -->
<StaticResource x:Key="AutoCompleteBoxLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />
<StaticResource x:Key="AutoCompleteBoxSuggestionsListBackground" ResourceKey="SystemControlBackgroundChromeMediumLowBrush" />
<StaticResource x:Key="AutoCompleteBoxSuggestionsListBorderBrush" ResourceKey="SystemControlForegroundChromeHighBrush" />
<x:Double x:Key="AutoCompleteBoxIconFontSize">12</x:Double>
<!-- BaseResources for CheckBox.xaml --> <!-- BaseResources for CheckBox.xaml -->
<StaticResource x:Key="CheckBoxForegroundUnchecked" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="CheckBoxForegroundUnchecked" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="CheckBoxForegroundUncheckedPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="CheckBoxForegroundUncheckedPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" />
@ -190,5 +274,43 @@
<StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminatePointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminatePointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminatePressed" ResourceKey="SystemControlForegroundBaseMediumBrush" /> <StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminatePressed" ResourceKey="SystemControlForegroundBaseMediumBrush" />
<StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminateDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> <StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminateDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<!-- BaseResources for RadioButton.xaml -->
<StaticResource x:Key="RadioButtonForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundPressed" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStroke" ResourceKey="SystemControlForegroundBaseMediumHighBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokePointerOver" ResourceKey="SystemControlHighlightBaseHighBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokePressed" ResourceKey="SystemControlHighlightBaseMediumBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokeDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFill" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStroke" ResourceKey="SystemControlHighlightAccentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokePointerOver" ResourceKey="SystemControlHighlightAccentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokePressed" ResourceKey="SystemControlHighlightBaseMediumBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokeDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFill" ResourceKey="SystemControlHighlightAltTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillPointerOver" ResourceKey="SystemControlHighlightTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillPressed" ResourceKey="SystemControlHighlightTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFill" ResourceKey="SystemControlHighlightBaseMediumHighBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillPressed" ResourceKey="SystemControlHighlightAltBaseMediumBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStroke" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokePointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokePressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokeDisabled" ResourceKey="SystemControlTransparentBrush" />
</Style.Resources> </Style.Resources>
</Style> </Style>

130
src/Avalonia.Themes.Fluent/Accents/FluentBaseLight.xaml

@ -1,6 +1,4 @@
<Style xmlns="https://github.com/avaloniaui" <Style xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=netstandard">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard">
<Style.Resources> <Style.Resources>
<Color x:Key="SystemAccentColor">#FF0078D7</Color> <Color x:Key="SystemAccentColor">#FF0078D7</Color>
<Color x:Key="SystemAltHighColor">#FFFFFFFF</Color> <Color x:Key="SystemAltHighColor">#FFFFFFFF</Color>
@ -33,9 +31,11 @@
<Color x:Key="SystemRevealListLowColor">#FFE6E6E6</Color> <Color x:Key="SystemRevealListLowColor">#FFE6E6E6</Color>
<Color x:Key="SystemRevealListMediumColor">#FFCCCCCC</Color> <Color x:Key="SystemRevealListMediumColor">#FFCCCCCC</Color>
<!--<AcrylicBrush x:Key="SystemControlAcrylicWindowBrush" BackgroundSource="HostBackdrop" TintColor="{ThemeResource SystemChromeAltHighColor}" TintOpacity="0.8" FallbackColor="{ThemeResource SystemChromeMediumColor}" />--> <!--<AcrylicBrush x:Key="SystemControlAcrylicWindowBrush" BackgroundSource="HostBackdrop" TintColor="{ThemeResource SystemChromeAltHighColor}" TintOpacity="0.8" FallbackColor="{ThemeResource SystemChromeMediumColor}" />-->
<!-- Override system shape defaults --> <!-- Override system shape defaults -->
<CornerRadius x:Key="ControlCornerRadius">2,2,2,2</CornerRadius> <CornerRadius x:Key="ControlCornerRadius">2,2,2,2</CornerRadius>
<CornerRadius x:Key="OverlayCornerRadius">4,4,4,4</CornerRadius> <CornerRadius x:Key="OverlayCornerRadius">4,4,4,4</CornerRadius>
<!-- Override system borders --> <!-- Override system borders -->
<Thickness x:Key="MenuBarItemBorderThickness">1,1,1,1</Thickness> <Thickness x:Key="MenuBarItemBorderThickness">1,1,1,1</Thickness>
<Thickness x:Key="GridViewItemMultiselectBorderThickness">1,1,1,1</Thickness> <Thickness x:Key="GridViewItemMultiselectBorderThickness">1,1,1,1</Thickness>
@ -61,6 +61,7 @@
<Thickness x:Key="GridViewItemRevealBorderThemeThickness">1,1,1,1</Thickness> <Thickness x:Key="GridViewItemRevealBorderThemeThickness">1,1,1,1</Thickness>
<Thickness x:Key="ComboBoxItemRevealBorderThemeThickness">1,1,1,1</Thickness> <Thickness x:Key="ComboBoxItemRevealBorderThemeThickness">1,1,1,1</Thickness>
<x:Double x:Key="PersonPictureEllipseBadgeStrokeThickness">1</x:Double> <x:Double x:Key="PersonPictureEllipseBadgeStrokeThickness">1</x:Double>
<!-- Override system generated accent colors --> <!-- Override system generated accent colors -->
<Color x:Key="SystemAccentColorDark1">#FF005A9E</Color> <Color x:Key="SystemAccentColorDark1">#FF005A9E</Color>
<Color x:Key="SystemAccentColorDark2">#FF004275</Color> <Color x:Key="SystemAccentColorDark2">#FF004275</Color>
@ -71,7 +72,7 @@
<!--<RevealBackgroundBrush x:Key="SystemControlHighlightListLowRevealBackgroundBrush" TargetTheme="Light" Color="{ThemeResource SystemRevealListMediumColor}" FallbackColor="{ StaticResource SystemListMediumColor}" />--> <!--<RevealBackgroundBrush x:Key="SystemControlHighlightListLowRevealBackgroundBrush" TargetTheme="Light" Color="{ThemeResource SystemRevealListMediumColor}" FallbackColor="{ StaticResource SystemListMediumColor}" />-->
<Color x:Key="RegionColor">#FFFFFFFF</Color> <Color x:Key="RegionColor">#FFFFFFFF</Color>
<SolidColorBrush x:Key="RegionBrush" Color="{StaticResource RegionColor}" /> <SolidColorBrush x:Key="RegionBrush" Color="{StaticResource RegionColor}" />
<!-- BaseResources for Button.xaml --> <!-- BaseResources for Button.xaml -->
<StaticResource x:Key="ButtonBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" /> <StaticResource x:Key="ButtonBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<StaticResource x:Key="ButtonBackgroundPointerOver" ResourceKey="SystemControlBackgroundBaseLowBrush" /> <StaticResource x:Key="ButtonBackgroundPointerOver" ResourceKey="SystemControlBackgroundBaseLowBrush" />
@ -86,6 +87,83 @@
<StaticResource x:Key="ButtonBorderBrushPressed" ResourceKey="SystemControlHighlightTransparentBrush" /> <StaticResource x:Key="ButtonBorderBrushPressed" ResourceKey="SystemControlHighlightTransparentBrush" />
<StaticResource x:Key="ButtonBorderBrushDisabled" ResourceKey="SystemControlDisabledTransparentBrush" /> <StaticResource x:Key="ButtonBorderBrushDisabled" ResourceKey="SystemControlDisabledTransparentBrush" />
<!-- BaseResources for ComboBox.xaml -->
<StaticResource x:Key="ComboBoxItemForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelected" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedUnfocused" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxItemBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPressed" ResourceKey="SystemControlHighlightListMediumBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPointerOver" ResourceKey="SystemControlHighlightListLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelected" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedUnfocused" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPressed" ResourceKey="SystemControlHighlightListAccentHighBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPointerOver" ResourceKey="SystemControlHighlightListAccentMediumBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelected" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedUnfocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackground" ResourceKey="SystemControlBackgroundAltMediumLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundPointerOver" ResourceKey="SystemControlPageBackgroundAltMediumBrush" />
<StaticResource x:Key="ComboBoxBackgroundPressed" ResourceKey="SystemControlBackgroundListMediumBrush" />
<StaticResource x:Key="ComboBoxBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundUnfocused" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundBorderBrushFocused" ResourceKey="SystemControlHighlightTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundBorderBrushUnfocused" ResourceKey="SystemControlHighlightBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxForegroundFocused" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForeground" ResourceKey="SystemControlPageTextBaseHighBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxBorderBrush" ResourceKey="SystemControlForegroundBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPointerOver" ResourceKey="SystemControlHighlightBaseMediumBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPressed" ResourceKey="SystemControlHighlightBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxBorderBrushDisabled" ResourceKey="SystemControlDisabledBaseLowBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerOver" ResourceKey="SystemControlBackgroundListLowBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerPressed" ResourceKey="SystemControlBackgroundListMediumBrush" />
<StaticResource x:Key="ComboBoxFocusedDropDownBackgroundPointerOver" ResourceKey="SystemControlBackgroundChromeBlackLowBrush" />
<StaticResource x:Key="ComboBoxFocusedDropDownBackgroundPointerPressed" ResourceKey="SystemControlBackgroundChromeBlackMediumLowBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForeground" ResourceKey="SystemControlForegroundBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxEditableDropDownGlyphForeground" ResourceKey="SystemControlForegroundBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocused" ResourceKey="SystemControlHighlightAltBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownBackground" ResourceKey="SystemControlTransientBackgroundBrush" />
<StaticResource x:Key="ComboBoxDropDownForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxDropDownBorderBrush" ResourceKey="SystemControlTransientBorderBrush" />
<!-- BaseResources for Listbox.xaml -->
<Thickness x:Key="ListBoxBorderThemeThickness">0</Thickness>
<SolidColorBrush x:Key="ListBoxBackgroundThemeBrush" Color="#CCFFFFFF" />
<SolidColorBrush x:Key="ListBoxBorderThemeBrush" Color="#45000000" />
<SolidColorBrush x:Key="ListBoxDisabledForegroundThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="ListBoxFocusBackgroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ListBoxForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemDisabledForegroundThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="ListBoxItemPointerOverBackgroundThemeBrush" Color="#21000000" />
<SolidColorBrush x:Key="ListBoxItemPointerOverForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemPressedBackgroundThemeBrush" Color="#FFD3D3D3" />
<SolidColorBrush x:Key="ListBoxItemPressedForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemSelectedBackgroundThemeBrush" Color="#FF4617B4" />
<SolidColorBrush x:Key="ListBoxItemSelectedDisabledBackgroundThemeBrush" Color="#8C000000" />
<SolidColorBrush x:Key="ListBoxItemSelectedDisabledForegroundThemeBrush" Color="#99FFFFFF" />
<SolidColorBrush x:Key="ListBoxItemSelectedForegroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="ListBoxItemSelectedPointerOverBackgroundThemeBrush" Color="#FF5F37BE" />
<!-- BaseResources for TextBox.xaml --> <!-- BaseResources for TextBox.xaml -->
<StaticResource x:Key="TextControlForeground" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="TextControlForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="TextControlForegroundPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="TextControlForegroundPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" />
@ -118,6 +196,12 @@
<StaticResource x:Key="ContentLinkForegroundColor" ResourceKey="SystemControlHyperlinkTextBrush" /> <StaticResource x:Key="ContentLinkForegroundColor" ResourceKey="SystemControlHyperlinkTextBrush" />
<StaticResource x:Key="ContentLinkBackgroundColor" ResourceKey="SystemControlPageBackgroundChromeLowBrush" /> <StaticResource x:Key="ContentLinkBackgroundColor" ResourceKey="SystemControlPageBackgroundChromeLowBrush" />
<!-- Resources for AutoCompleteBox.xaml -->
<StaticResource x:Key="AutoCompleteBoxLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />
<StaticResource x:Key="AutoCompleteBoxSuggestionsListBackground" ResourceKey="SystemControlBackgroundChromeMediumLowBrush" />
<StaticResource x:Key="AutoCompleteBoxSuggestionsListBorderBrush" ResourceKey="SystemControlForegroundChromeHighBrush" />
<x:Double x:Key="AutoCompleteBoxIconFontSize">12</x:Double>
<!-- BaseResources for CheckBox.xaml --> <!-- BaseResources for CheckBox.xaml -->
<StaticResource x:Key="CheckBoxForegroundUnchecked" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="CheckBoxForegroundUnchecked" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="CheckBoxForegroundUncheckedPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="CheckBoxForegroundUncheckedPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" />
@ -191,5 +275,43 @@
<StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminatePointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminatePointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminatePressed" ResourceKey="SystemControlForegroundBaseMediumBrush" /> <StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminatePressed" ResourceKey="SystemControlForegroundBaseMediumBrush" />
<StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminateDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" /> <StaticResource x:Key="CheckBoxCheckGlyphForegroundIndeterminateDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<!-- BaseResources for RadioButton.xaml -->
<StaticResource x:Key="RadioButtonForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundPressed" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStroke" ResourceKey="SystemControlForegroundBaseMediumHighBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokePointerOver" ResourceKey="SystemControlHighlightBaseHighBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokePressed" ResourceKey="SystemControlHighlightBaseMediumBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokeDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFill" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStroke" ResourceKey="SystemControlHighlightAccentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokePointerOver" ResourceKey="SystemControlHighlightAccentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokePressed" ResourceKey="SystemControlHighlightBaseMediumBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokeDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFill" ResourceKey="SystemControlHighlightAltTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillPointerOver" ResourceKey="SystemControlHighlightTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillPressed" ResourceKey="SystemControlHighlightTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFill" ResourceKey="SystemControlHighlightBaseMediumHighBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillPressed" ResourceKey="SystemControlHighlightAltBaseMediumBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStroke" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokePointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokePressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokeDisabled" ResourceKey="SystemControlTransparentBrush" />
</Style.Resources> </Style.Resources>
</Style> </Style>

190
src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml

@ -39,6 +39,136 @@
<SolidColorBrush x:Key="ButtonPressedBackgroundThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="ButtonPressedBackgroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ButtonPressedForegroundThemeBrush" Color="#FF000000" /> <SolidColorBrush x:Key="ButtonPressedForegroundThemeBrush" Color="#FF000000" />
<!-- Resources for ComboBox.xaml -->
<x:Double x:Key="ComboBoxArrowThemeFontSize">21</x:Double>
<x:Double x:Key="ComboBoxThemeMinWidth">64</x:Double>
<x:Double x:Key="ComboBoxPopupThemeMinWidth">80</x:Double>
<x:Double x:Key="ComboBoxPopupThemeTouchMinWidth">240</x:Double>
<Thickness x:Key="ComboBoxBorderThemeThickness">1</Thickness>
<Thickness x:Key="ComboBoxDropdownBorderThickness">1</Thickness>
<Thickness x:Key="ComboBoxHeaderThemeMargin">0,0,0,4</Thickness>
<Thickness x:Key="ComboBoxPopupBorderThemeThickness">2</Thickness>
<Thickness x:Key="ComboBoxItemThemePadding">11,5,11,7</Thickness>
<Thickness x:Key="ComboBoxItemThemeTouchPadding">11,11,11,13</Thickness>
<Thickness x:Key="ComboBoxItemThemeGameControllerPadding">11,11,11,13</Thickness>
<FontWeight x:Key="ComboBoxHeaderThemeFontWeight">Normal</FontWeight>
<FontWeight x:Key="ComboBoxPlaceholderTextThemeFontWeight">SemiLight</FontWeight>
<StaticResource x:Key="ComboBoxItemForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelected" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedUnfocused" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxItemBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPressed" ResourceKey="SystemControlHighlightListMediumBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPointerOver" ResourceKey="SystemControlHighlightListLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelected" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedUnfocused" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPressed" ResourceKey="SystemControlHighlightListAccentHighBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPointerOver" ResourceKey="SystemControlHighlightListAccentMediumBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelected" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedUnfocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackground" ResourceKey="SystemControlBackgroundAltMediumLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundPointerOver" ResourceKey="SystemControlPageBackgroundAltMediumBrush" />
<StaticResource x:Key="ComboBoxBackgroundPressed" ResourceKey="SystemControlBackgroundListMediumBrush" />
<StaticResource x:Key="ComboBoxBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundUnfocused" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundBorderBrushFocused" ResourceKey="SystemControlHighlightTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundBorderBrushUnfocused" ResourceKey="SystemControlHighlightBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxForegroundFocused" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForeground" ResourceKey="SystemControlPageTextBaseHighBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxBorderBrush" ResourceKey="SystemControlForegroundBaseMediumBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPointerOver" ResourceKey="SystemControlHighlightBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPressed" ResourceKey="SystemControlHighlightBaseMediumBrush" />
<StaticResource x:Key="ComboBoxBorderBrushDisabled" ResourceKey="SystemControlDisabledBaseLowBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForeground" ResourceKey="SystemControlForegroundBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocused" ResourceKey="SystemControlHighlightAltBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxDropDownBackground" ResourceKey="SystemControlTransientBackgroundBrush" />
<StaticResource x:Key="ComboBoxDropDownBorderBrush" ResourceKey="SystemControlTransientBorderBrush" />
<StaticResource x:Key="ComboBoxLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />
<SolidColorBrush x:Key="ComboBoxArrowDisabledForegroundThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="ComboBoxArrowForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxArrowPressedForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxBackgroundThemeBrush" Color="#CCFFFFFF" />
<SolidColorBrush x:Key="ComboBoxBorderThemeBrush" Color="#CCFFFFFF" />
<SolidColorBrush x:Key="ComboBoxDisabledBackgroundThemeBrush" Color="Transparent" />
<SolidColorBrush x:Key="ComboBoxDisabledBorderThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="ComboBoxDisabledForegroundThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="ComboBoxFocusedBackgroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="ComboBoxFocusedBorderThemeBrush" Color="White" />
<SolidColorBrush x:Key="ComboBoxFocusedForegroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="ComboBoxForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxHeaderForegroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ComboBoxItemDisabledForegroundThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="ComboBoxItemPointerOverBackgroundThemeBrush" Color="#21000000" />
<SolidColorBrush x:Key="ComboBoxItemPointerOverForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxItemPressedBackgroundThemeBrush" Color="#FFD3D3D3" />
<SolidColorBrush x:Key="ComboBoxItemPressedForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxItemSelectedBackgroundThemeBrush" Color="#FF4617B4" />
<SolidColorBrush x:Key="ComboBoxItemSelectedDisabledBackgroundThemeBrush" Color="#8C000000" />
<SolidColorBrush x:Key="ComboBoxItemSelectedDisabledForegroundThemeBrush" Color="#99FFFFFF" />
<SolidColorBrush x:Key="ComboBoxItemSelectedForegroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="ComboBoxItemSelectedPointerOverBackgroundThemeBrush" Color="#FF5F37BE" />
<SolidColorBrush x:Key="ComboBoxPlaceholderTextForegroundThemeBrush" Color="#88000000" />
<SolidColorBrush x:Key="ComboBoxPointerOverBackgroundThemeBrush" Color="#DEFFFFFF" />
<SolidColorBrush x:Key="ComboBoxPointerOverBorderThemeBrush" Color="#DEFFFFFF" />
<SolidColorBrush x:Key="ComboBoxPopupBackgroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ComboBoxPopupBorderThemeBrush" Color="#FF212121" />
<SolidColorBrush x:Key="ComboBoxPopupForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxPressedBackgroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ComboBoxPressedBorderThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ComboBoxPressedHighlightThemeBrush" Color="#FFD3D3D3" />
<SolidColorBrush x:Key="ComboBoxPressedForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxSelectedBackgroundThemeBrush" Color="#FF4617B4" />
<SolidColorBrush x:Key="ComboBoxSelectedPointerOverBackgroundThemeBrush" Color="#FF5F37BE" />
<Thickness x:Key="ComboBoxDropdownBorderPadding">0</Thickness>
<Thickness x:Key="ComboBoxDropdownContentMargin">0,4,0,4</Thickness>
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerOver" ResourceKey="SystemControlBackgroundListLowBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerPressed" ResourceKey="SystemControlBackgroundListMediumBrush" />
<StaticResource x:Key="ComboBoxFocusedDropDownBackgroundPointerOver" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<StaticResource x:Key="ComboBoxFocusedDropDownBackgroundPointerPressed" ResourceKey="SystemControlBackgroundBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxEditableDropDownGlyphForeground" ResourceKey="SystemControlForegroundBaseMediumHighBrush" />
<!-- Resources for ListBox.xaml -->
<Thickness x:Key="ListBoxBorderThemeThickness">0</Thickness>
<SolidColorBrush x:Key="ListBoxBackgroundThemeBrush" Color="#CCFFFFFF" />
<SolidColorBrush x:Key="ListBoxBorderThemeBrush" Color="Transparent" />
<SolidColorBrush x:Key="ListBoxDisabledForegroundThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="ListBoxFocusBackgroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ListBoxForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemDisabledForegroundThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="ListBoxItemPointerOverBackgroundThemeBrush" Color="#21000000" />
<SolidColorBrush x:Key="ListBoxItemPointerOverForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemPressedBackgroundThemeBrush" Color="#FFD3D3D3" />
<SolidColorBrush x:Key="ListBoxItemPressedForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemSelectedBackgroundThemeBrush" Color="#FF4617B4" />
<SolidColorBrush x:Key="ListBoxItemSelectedDisabledBackgroundThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="ListBoxItemSelectedDisabledForegroundThemeBrush" Color="#99000000" />
<SolidColorBrush x:Key="ListBoxItemSelectedForegroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="ListBoxItemSelectedPointerOverBackgroundThemeBrush" Color="#FF5F37BE" />
<!-- Resources for TextBox.xaml --> <!-- Resources for TextBox.xaml -->
<SolidColorBrush x:Key="TextBoxForegroundHeaderThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="TextBoxForegroundHeaderThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="#AB000000" /> <SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="#AB000000" />
@ -64,6 +194,12 @@
<StaticResource x:Key="TextControlForegroundFocused" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="TextControlForegroundFocused" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="TextControlPlaceholderForegroundFocused" ResourceKey="SystemControlForegroundBaseMediumLowBrush" /> <StaticResource x:Key="TextControlPlaceholderForegroundFocused" ResourceKey="SystemControlForegroundBaseMediumLowBrush" />
<!-- Resources for AutoCompleteBox.xaml -->
<StaticResource x:Key="AutoCompleteBoxSuggestionsListBackground" ResourceKey="SystemControlTransientBackgroundBrush" />
<StaticResource x:Key="AutoCompleteBoxSuggestionsListBorderBrush" ResourceKey="SystemControlTransientBorderBrush" />
<StaticResource x:Key="AutoCompleteBoxLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />
<x:Double x:Key="AutoCompleteBoxIconFontSize">12</x:Double>
<!-- Resources for Checkbox.xaml --> <!-- Resources for Checkbox.xaml -->
<Thickness x:Key="CheckBoxBorderThemeThickness">1</Thickness> <Thickness x:Key="CheckBoxBorderThemeThickness">1</Thickness>
<Thickness x:Key="CheckBoxCheckedStrokeThickness">0</Thickness> <Thickness x:Key="CheckBoxCheckedStrokeThickness">0</Thickness>
@ -153,5 +289,59 @@
<SolidColorBrush x:Key="CheckBoxPressedBackgroundThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="CheckBoxPressedBackgroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="CheckBoxPressedBorderThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="CheckBoxPressedBorderThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="CheckBoxPressedForegroundThemeBrush" Color="#FF000000" /> <SolidColorBrush x:Key="CheckBoxPressedForegroundThemeBrush" Color="#FF000000" />
<!-- Resources for RadioButton.xaml -->
<x:Double x:Key="RadioButtonBorderThemeThickness">1</x:Double>
<StaticResource x:Key="RadioButtonForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundPressed" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStroke" ResourceKey="SystemControlForegroundBaseMediumBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokePointerOver" ResourceKey="SystemControlHighlightBaseMediumHighBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokePressed" ResourceKey="SystemControlHighlightBaseHighBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokeDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFill" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillPressed" ResourceKey="SystemControlBackgroundBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStroke" ResourceKey="SystemControlHighlightAccentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokePointerOver" ResourceKey="SystemAccentColorLight1" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokePressed" ResourceKey="SystemAccentColorDark1" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokeDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFill" ResourceKey="SystemControlHighlightAccentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillPointerOver" ResourceKey="SystemAccentColorLight1" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillPressed" ResourceKey="SystemAccentColorDark1" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillDisabled" ResourceKey="SystemControlBackgroundBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFill" ResourceKey="SystemControlForegroundChromeWhiteBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillPointerOver" ResourceKey="SystemControlForegroundChromeWhiteBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillPressed" ResourceKey="SystemControlForegroundChromeWhiteBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillDisabled" ResourceKey="SystemControlForegroundChromeWhiteBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStroke" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokePointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokePressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokeDisabled" ResourceKey="SystemControlTransparentBrush" />
<SolidColorBrush x:Key="RadioButtonBackgroundThemeBrush" Color="#CCFFFFFF" />
<SolidColorBrush x:Key="RadioButtonBorderThemeBrush" Color="#CCFFFFFF" />
<SolidColorBrush x:Key="RadioButtonContentDisabledForegroundThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="RadioButtonContentForegroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="RadioButtonDisabledBackgroundThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="RadioButtonDisabledBorderThemeBrush" Color="#66FFFFFF" />
<SolidColorBrush x:Key="RadioButtonDisabledForegroundThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="RadioButtonForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="RadioButtonPointerOverBackgroundThemeBrush" Color="#DEFFFFFF" />
<SolidColorBrush x:Key="RadioButtonPointerOverBorderThemeBrush" Color="#DEFFFFFF" />
<SolidColorBrush x:Key="RadioButtonPointerOverForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="RadioButtonPressedBackgroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="RadioButtonPressedBorderThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="RadioButtonPressedForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="RadioButtonContentPointerOverForegroundThemeBrush" Color="{DynamicResource SystemColorHighlightTextColor}" />
</Style.Resources> </Style.Resources>
</Style> </Style>

190
src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml

@ -39,6 +39,136 @@
<SolidColorBrush x:Key="ButtonPressedBackgroundThemeBrush" Color="#FF000000" /> <SolidColorBrush x:Key="ButtonPressedBackgroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ButtonPressedForegroundThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="ButtonPressedForegroundThemeBrush" Color="#FFFFFFFF" />
<!-- Resources for ComboBox.xaml -->
<x:Double x:Key="ComboBoxArrowThemeFontSize">21</x:Double>
<x:Double x:Key="ComboBoxThemeMinWidth">64</x:Double>
<x:Double x:Key="ComboBoxPopupThemeMinWidth">80</x:Double>
<x:Double x:Key="ComboBoxPopupThemeTouchMinWidth">240</x:Double>
<Thickness x:Key="ComboBoxBorderThemeThickness">1</Thickness>
<Thickness x:Key="ComboBoxDropdownBorderThickness">1</Thickness>
<Thickness x:Key="ComboBoxHeaderThemeMargin">0,0,0,4</Thickness>
<Thickness x:Key="ComboBoxPopupBorderThemeThickness">2</Thickness>
<Thickness x:Key="ComboBoxItemThemePadding">11,5,11,7</Thickness>
<Thickness x:Key="ComboBoxItemThemeTouchPadding">11,11,11,13</Thickness>
<Thickness x:Key="ComboBoxItemThemeGameControllerPadding">11,11,11,13</Thickness>
<FontWeight x:Key="ComboBoxHeaderThemeFontWeight">Normal</FontWeight>
<FontWeight x:Key="ComboBoxPlaceholderTextThemeFontWeight">SemiLight</FontWeight>
<StaticResource x:Key="ComboBoxItemForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelected" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedUnfocused" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedPointerOver" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxItemForegroundSelectedDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxItemBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPressed" ResourceKey="SystemControlHighlightListMediumBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundPointerOver" ResourceKey="SystemControlHighlightListLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelected" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedUnfocused" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPressed" ResourceKey="SystemControlHighlightListAccentHighBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedPointerOver" ResourceKey="SystemControlHighlightListAccentMediumBrush" />
<StaticResource x:Key="ComboBoxItemBackgroundSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelected" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedUnfocused" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxItemBorderBrushSelectedDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="ComboBoxBackground" ResourceKey="SystemControlBackgroundAltMediumLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundPointerOver" ResourceKey="SystemControlPageBackgroundAltMediumBrush" />
<StaticResource x:Key="ComboBoxBackgroundPressed" ResourceKey="SystemControlBackgroundListMediumBrush" />
<StaticResource x:Key="ComboBoxBackgroundDisabled" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundUnfocused" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ComboBoxBackgroundBorderBrushFocused" ResourceKey="SystemControlHighlightTransparentBrush" />
<StaticResource x:Key="ComboBoxBackgroundBorderBrushUnfocused" ResourceKey="SystemControlHighlightBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxForegroundFocused" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForeground" ResourceKey="SystemControlPageTextBaseHighBrush" />
<StaticResource x:Key="ComboBoxPlaceHolderForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseHighBrush" />
<StaticResource x:Key="ComboBoxBorderBrush" ResourceKey="SystemControlForegroundBaseMediumBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPointerOver" ResourceKey="SystemControlHighlightBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxBorderBrushPressed" ResourceKey="SystemControlHighlightBaseMediumBrush" />
<StaticResource x:Key="ComboBoxBorderBrushDisabled" ResourceKey="SystemControlDisabledBaseLowBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForeground" ResourceKey="SystemControlForegroundBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocused" ResourceKey="SystemControlHighlightAltBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownGlyphForegroundFocusedPressed" ResourceKey="SystemControlHighlightAltBaseMediumHighBrush" />
<StaticResource x:Key="ComboBoxDropDownForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ComboBoxDropDownBackground" ResourceKey="SystemControlTransientBackgroundBrush" />
<StaticResource x:Key="ComboBoxDropDownBorderBrush" ResourceKey="SystemControlTransientBorderBrush" />
<StaticResource x:Key="ComboBoxLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />
<SolidColorBrush x:Key="ComboBoxArrowDisabledForegroundThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="ComboBoxArrowForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxArrowPressedForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxBackgroundThemeBrush" Color="#CCFFFFFF" />
<SolidColorBrush x:Key="ComboBoxBorderThemeBrush" Color="#45000000" />
<SolidColorBrush x:Key="ComboBoxDisabledBackgroundThemeBrush" Color="#66CACACA" />
<SolidColorBrush x:Key="ComboBoxDisabledBorderThemeBrush" Color="#26000000" />
<SolidColorBrush x:Key="ComboBoxDisabledForegroundThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="ComboBoxFocusedBackgroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="ComboBoxFocusedBorderThemeBrush" Color="#70000000" />
<SolidColorBrush x:Key="ComboBoxFocusedForegroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="ComboBoxForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxHeaderForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxItemDisabledForegroundThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="ComboBoxItemPointerOverBackgroundThemeBrush" Color="#21000000" />
<SolidColorBrush x:Key="ComboBoxItemPointerOverForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxItemPressedBackgroundThemeBrush" Color="#FFD3D3D3" />
<SolidColorBrush x:Key="ComboBoxItemPressedForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxItemSelectedBackgroundThemeBrush" Color="#FF4617B4" />
<SolidColorBrush x:Key="ComboBoxItemSelectedForegroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="ComboBoxItemSelectedDisabledBackgroundThemeBrush" Color="#8C000000" />
<SolidColorBrush x:Key="ComboBoxItemSelectedDisabledForegroundThemeBrush" Color="#99FFFFFF" />
<SolidColorBrush x:Key="ComboBoxItemSelectedPointerOverBackgroundThemeBrush" Color="#FF5F37BE" />
<SolidColorBrush x:Key="ComboBoxPlaceholderTextForegroundThemeBrush" Color="#88000000" />
<SolidColorBrush x:Key="ComboBoxPointerOverBackgroundThemeBrush" Color="#DEFFFFFF" />
<SolidColorBrush x:Key="ComboBoxPointerOverBorderThemeBrush" Color="#70000000" />
<SolidColorBrush x:Key="ComboBoxPopupBackgroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ComboBoxPopupBorderThemeBrush" Color="#FF212121" />
<SolidColorBrush x:Key="ComboBoxPopupForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxPressedBackgroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ComboBoxPressedBorderThemeBrush" Color="#A3000000" />
<SolidColorBrush x:Key="ComboBoxPressedHighlightThemeBrush" Color="#FFD3D3D3" />
<SolidColorBrush x:Key="ComboBoxPressedForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ComboBoxSelectedBackgroundThemeBrush" Color="#FF4617B4" />
<SolidColorBrush x:Key="ComboBoxSelectedPointerOverBackgroundThemeBrush" Color="#FF5F37BE" />
<Thickness x:Key="ComboBoxDropdownBorderPadding">0</Thickness>
<Thickness x:Key="ComboBoxDropdownContentMargin">0,4,0,4</Thickness>
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerOver" ResourceKey="SystemControlBackgroundListLowBrush" />
<StaticResource x:Key="ComboBoxDropDownBackgroundPointerPressed" ResourceKey="SystemControlBackgroundListMediumBrush" />
<StaticResource x:Key="ComboBoxFocusedDropDownBackgroundPointerOver" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<StaticResource x:Key="ComboBoxFocusedDropDownBackgroundPointerPressed" ResourceKey="SystemControlBackgroundBaseMediumLowBrush" />
<StaticResource x:Key="ComboBoxEditableDropDownGlyphForeground" ResourceKey="SystemControlForegroundBaseMediumHighBrush" />
<!-- Resources for ListBox.xaml -->
<Thickness x:Key="ListBoxBorderThemeThickness">0</Thickness>
<SolidColorBrush x:Key="ListBoxBackgroundThemeBrush" Color="#CCFFFFFF" />
<SolidColorBrush x:Key="ListBoxBorderThemeBrush" Color="#45000000" />
<SolidColorBrush x:Key="ListBoxDisabledForegroundThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="ListBoxFocusBackgroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="ListBoxForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemDisabledForegroundThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="ListBoxItemPointerOverBackgroundThemeBrush" Color="#21000000" />
<SolidColorBrush x:Key="ListBoxItemPointerOverForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemPressedBackgroundThemeBrush" Color="#FFD3D3D3" />
<SolidColorBrush x:Key="ListBoxItemPressedForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="ListBoxItemSelectedBackgroundThemeBrush" Color="#FF4617B4" />
<SolidColorBrush x:Key="ListBoxItemSelectedDisabledBackgroundThemeBrush" Color="#8C000000" />
<SolidColorBrush x:Key="ListBoxItemSelectedDisabledForegroundThemeBrush" Color="#99FFFFFF" />
<SolidColorBrush x:Key="ListBoxItemSelectedForegroundThemeBrush" Color="White" />
<SolidColorBrush x:Key="ListBoxItemSelectedPointerOverBackgroundThemeBrush" Color="#FF5F37BE" />
<!-- Resources for TextBox.xaml --> <!-- Resources for TextBox.xaml -->
<SolidColorBrush x:Key="TextBoxForegroundHeaderThemeBrush" Color="#FF000000" /> <SolidColorBrush x:Key="TextBoxForegroundHeaderThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="#AB000000" /> <SolidColorBrush x:Key="TextBoxPlaceholderTextThemeBrush" Color="#AB000000" />
@ -64,6 +194,12 @@
<StaticResource x:Key="TextControlForegroundFocused" ResourceKey="SystemControlForegroundBaseHighBrush" /> <StaticResource x:Key="TextControlForegroundFocused" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="TextControlPlaceholderForegroundFocused" ResourceKey="SystemControlForegroundBaseMediumLowBrush" /> <StaticResource x:Key="TextControlPlaceholderForegroundFocused" ResourceKey="SystemControlForegroundBaseMediumLowBrush" />
<!-- Resources for AutoCompleteBox.xaml -->
<StaticResource x:Key="AutoCompleteBoxSuggestionsListBackground" ResourceKey="SystemControlTransientBackgroundBrush" />
<StaticResource x:Key="AutoCompleteBoxSuggestionsListBorderBrush" ResourceKey="SystemControlTransientBorderBrush" />
<StaticResource x:Key="AutoCompleteBoxLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />
<x:Double x:Key="AutoCompleteBoxIconFontSize">12</x:Double>
<!-- Resources for CheckBox.xaml --> <!-- Resources for CheckBox.xaml -->
<x:Double x:Key="CheckBoxBorderThemeThickness">1</x:Double> <x:Double x:Key="CheckBoxBorderThemeThickness">1</x:Double>
<x:Double x:Key="CheckBoxCheckedStrokeThickness">0</x:Double> <x:Double x:Key="CheckBoxCheckedStrokeThickness">0</x:Double>
@ -153,5 +289,59 @@
<SolidColorBrush x:Key="CheckBoxPressedBackgroundThemeBrush" Color="#FF000000" /> <SolidColorBrush x:Key="CheckBoxPressedBackgroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="CheckBoxPressedBorderThemeBrush" Color="#FF000000" /> <SolidColorBrush x:Key="CheckBoxPressedBorderThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="CheckBoxPressedForegroundThemeBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="CheckBoxPressedForegroundThemeBrush" Color="#FFFFFFFF" />
<!-- Resources for RadioButton.xaml -->
<x:Double x:Key="RadioButtonBorderThemeThickness">1</x:Double>
<StaticResource x:Key="RadioButtonForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundPointerOver" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundPressed" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="RadioButtonForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonBackground" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushPressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonBorderBrushDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStroke" ResourceKey="SystemControlForegroundBaseMediumBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokePointerOver" ResourceKey="SystemControlHighlightBaseMediumHighBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokePressed" ResourceKey="SystemControlHighlightBaseHighBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseStrokeDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFill" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillPointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillPressed" ResourceKey="SystemControlBackgroundBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseFillDisabled" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStroke" ResourceKey="SystemControlHighlightAccentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokePointerOver" ResourceKey="SystemAccentColorLight1" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokePressed" ResourceKey="SystemAccentColorDark1" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedStrokeDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFill" ResourceKey="SystemControlHighlightAccentBrush" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillPointerOver" ResourceKey="SystemAccentColorLight1" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillPressed" ResourceKey="SystemAccentColorDark1" />
<StaticResource x:Key="RadioButtonOuterEllipseCheckedFillDisabled" ResourceKey="SystemControlBackgroundBaseMediumLowBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFill" ResourceKey="SystemControlForegroundChromeWhiteBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillPointerOver" ResourceKey="SystemControlForegroundChromeWhiteBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillPressed" ResourceKey="SystemControlForegroundChromeWhiteBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphFillDisabled" ResourceKey="SystemControlForegroundChromeWhiteBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStroke" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokePointerOver" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokePressed" ResourceKey="SystemControlTransparentBrush" />
<StaticResource x:Key="RadioButtonCheckGlyphStrokeDisabled" ResourceKey="SystemControlTransparentBrush" />
<SolidColorBrush x:Key="RadioButtonBackgroundThemeBrush" Color="#CCFFFFFF" />
<SolidColorBrush x:Key="RadioButtonBorderThemeBrush" Color="#45000000" />
<SolidColorBrush x:Key="RadioButtonContentDisabledForegroundThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="RadioButtonContentForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="RadioButtonDisabledBackgroundThemeBrush" Color="#66CACACA" />
<SolidColorBrush x:Key="RadioButtonDisabledBorderThemeBrush" Color="#26000000" />
<SolidColorBrush x:Key="RadioButtonDisabledForegroundThemeBrush" Color="#66000000" />
<SolidColorBrush x:Key="RadioButtonForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="RadioButtonPointerOverBackgroundThemeBrush" Color="#DEFFFFFF" />
<SolidColorBrush x:Key="RadioButtonPointerOverBorderThemeBrush" Color="#70000000" />
<SolidColorBrush x:Key="RadioButtonPointerOverForegroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="RadioButtonPressedBackgroundThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="RadioButtonPressedBorderThemeBrush" Color="#FF000000" />
<SolidColorBrush x:Key="RadioButtonPressedForegroundThemeBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="RadioButtonContentPointerOverForegroundThemeBrush" Color="{DynamicResource SystemColorHighlightTextColor}" />
</Style.Resources> </Style.Resources>
</Style> </Style>

69
src/Avalonia.Themes.Fluent/AutoCompleteBox.xaml

@ -1,37 +1,70 @@
<Styles xmlns="https://github.com/avaloniaui"> <Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith>
<Border Padding="20">
<AutoCompleteBox Width="200">
<AutoCompleteBox.Items>
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
</AutoCompleteBox.Items>
</AutoCompleteBox>
</Border>
</Design.PreviewWith>
<Style Selector="AutoCompleteBox"> <Style Selector="AutoCompleteBox">
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/> <Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/> <Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/> <Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
<Setter Property="Padding" Value="4"/> <Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" />
<Setter Property="MaxDropDownHeight" Value="{DynamicResource AutoCompleteListMaxHeight}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Panel> <Grid Name="PART_LayoutRoot">
<TextBox Name="PART_TextBox" <TextBox Name="PART_TextBox"
Background="{TemplateBinding Background}" Watermark="{TemplateBinding Watermark}"
BorderBrush="{TemplateBinding BorderBrush}" Width="{TemplateBinding Width}"
Foreground="{TemplateBinding Foreground}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
FontSize="{TemplateBinding FontSize}"
FontFamily="{TemplateBinding FontFamily}"
FontWeight="{TemplateBinding FontWeight}"
Padding="{TemplateBinding Padding}" Padding="{TemplateBinding Padding}"
Watermark="{TemplateBinding Watermark}" Margin="0"
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" /> DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" />
<Popup Name="PART_Popup" <Popup Name="PART_Popup"
WindowManagerAddShadowHint="False"
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
MaxHeight="{TemplateBinding MaxDropDownHeight}" MaxHeight="{TemplateBinding MaxDropDownHeight}"
PlacementTarget="{TemplateBinding}" StaysOpen="False"
StaysOpen="False"> PlacementTarget="{TemplateBinding}">
<Border BorderBrush="{DynamicResource ThemeBorderMidBrush}" <Border Name="PART_SuggestionsContainer"
BorderThickness="1"> Padding="{DynamicResource AutoCompleteListMargin}"
BorderThickness="{DynamicResource AutoCompleteListBorderThemeThickness}"
BorderBrush="{DynamicResource AutoSuggestBoxSuggestionsListBorderBrush}"
Background="{DynamicResource AutoCompleteBoxSuggestionsListBackground}"
CornerRadius="{DynamicResource OverlayCornerRadius}">
<ListBox Name="PART_SelectingItemsControl" <ListBox Name="PART_SelectingItemsControl"
BorderThickness="0" BorderThickness="0"
Background="{TemplateBinding Background}" Background="Transparent"
Foreground="{TemplateBinding Foreground}" Foreground="{DynamicResource AutoCompleteBoxSuggestionsListForeground}"
ItemTemplate="{TemplateBinding ItemTemplate}" ItemTemplate="{TemplateBinding ItemTemplate}"
ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="{DynamicResource AutoCompleteListPadding}" />
ScrollViewer.VerticalScrollBarVisibility="Auto" />
</Border> </Border>
</Popup> </Popup>
</Panel> </Grid>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>

234
src/Avalonia.Themes.Fluent/ComboBox.xaml

@ -1,64 +1,192 @@
<Styles xmlns="https://github.com/avaloniaui"> <Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith>
<Border Padding="20">
<StackPanel Spacing="10">
<ComboBox PlaceholderText="Select an item">
<ComboBoxItem>Item 1</ComboBoxItem>
<ComboBoxItem>Item 2</ComboBoxItem>
</ComboBox>
<ComboBox IsEnabled="False">
<ComboBoxItem>Item 1</ComboBoxItem>
<ComboBoxItem>Item 2</ComboBoxItem>
</ComboBox>
</StackPanel>
</Border>
</Design.PreviewWith>
<Styles.Resources>
<Thickness x:Key="ComboBoxTopHeaderMargin">0,0,0,4</Thickness>
<x:Int32 x:Key="ComboBoxPopupMaxNumberOfItems">15</x:Int32>
<x:Int32 x:Key="ComboBoxPopupMaxNumberOfItemsThatCanBeShownOnOneSide">7</x:Int32>
<Thickness x:Key="ComboBoxPadding">12,5,0,7</Thickness>
<Thickness x:Key="ComboBoxEditableTextPadding">11,5,32,6</Thickness>
<x:Double x:Key="ComboBoxMinHeight">32</x:Double>
</Styles.Resources>
<Style Selector="ComboBox"> <Style Selector="ComboBox">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Padding" Value="{DynamicResource ComboBoxPadding}" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/> <Setter Property="MaxDropDownHeight" Value="504" />
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/> <Setter Property="Foreground" Value="{DynamicResource ComboBoxForeground}" />
<Setter Property="Padding" Value="4"/> <Setter Property="Background" Value="{DynamicResource ComboBoxBackground}" />
<Setter Property="MinHeight" Value="20"/> <Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ComboBoxBorderThemeThickness}" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="PlaceholderForeground" Value="{DynamicResource ComboBoxPlaceHolderForeground}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Border Name="border" <Grid RowDefinitions="Auto, *, Auto" ColumnDefinitions="*,32">
Background="{TemplateBinding Background}" <ContentPresenter x:Name="HeaderContentPresenter"
BorderBrush="{TemplateBinding BorderBrush}" Grid.Row="0"
BorderThickness="{TemplateBinding BorderThickness}"> Grid.Column="0"
<Grid ColumnDefinitions="*,Auto"> Grid.ColumnSpan="2"
<ContentControl Content="{TemplateBinding SelectionBoxItem}" TextBlock.FontWeight="{DynamicResource ComboBoxHeaderThemeFontWeight}"
ContentTemplate="{TemplateBinding ItemTemplate}" Margin="{DynamicResource ComboBoxTopHeaderMargin}"
Margin="{TemplateBinding Padding}" VerticalAlignment="Top" />
HorizontalAlignment="Left" <Border x:Name="Background"
VerticalAlignment="Center"/> Grid.Row="1"
<ToggleButton Name="toggle" Grid.Column="0"
BorderThickness="0" Grid.ColumnSpan="2"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{DynamicResource ControlCornerRadius}"
MinWidth="{DynamicResource ComboBoxThemeMinWidth}" />
<Border x:Name="HighlightBackground"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
Background="{DynamicResource ComboBoxBackgroundUnfocused}"
BorderBrush="{DynamicResource ComboBoxBackgroundBorderBrushUnfocused}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{DynamicResource ControlCornerRadius}"
Opacity="0" />
<TextBlock x:Name="PlaceholderTextBlock"
Grid.Row="1"
Grid.Column="0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Margin="{TemplateBinding Padding}"
Foreground="{TemplateBinding PlaceholderForeground}"
Text="{TemplateBinding PlaceholderText}" IsVisible="{TemplateBinding SelectionBoxItem, Converter={x:Static ObjectConverters.IsNull}}"/>
<ContentControl x:Name="ContentPresenter"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding ItemTemplate}"
Grid.Row="1"
Grid.Column="0"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="Left"
VerticalAlignment="Center">
</ContentControl>
<Border x:Name="DropDownOverlay"
Grid.Row="1"
Grid.Column="1"
Background="Transparent" Background="Transparent"
ClickMode="Press" Margin="0,1,1,1"
Focusable="False" Width="30" IsVisible="False"
IsChecked="{TemplateBinding IsDropDownOpen, Mode=TwoWay}" HorizontalAlignment="Right" />
Grid.Column="1">
<Path Fill="{DynamicResource ThemeForegroundBrush}" <Viewbox UseLayoutRounding="False"
Width="8" MinHeight="{DynamicResource ComboBoxMinHeight}"
Height="4" Grid.Row="1"
Stretch="Uniform" Grid.Column="1"
HorizontalAlignment="Center" IsHitTestVisible="False"
VerticalAlignment="Center" Margin="0,0,10,0" Height="12" Width="12"
Data="F1 M 301.14,-189.041L 311.57,-189.041L 306.355,-182.942L 301.14,-189.041 Z"/> HorizontalAlignment="Right"
</ToggleButton> VerticalAlignment="Center">
<Popup Name="PART_Popup" <Panel>
IsOpen="{TemplateBinding IsDropDownOpen, Mode=TwoWay}" <Panel Height="12" Width="12" />
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" <Path x:Name="DropDownGlyph" Stretch="Uniform" VerticalAlignment="Center" Data="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z" />
MaxHeight="{TemplateBinding MaxDropDownHeight}" </Panel>
PlacementTarget="{TemplateBinding}" </Viewbox>
StaysOpen="False"> <Popup Name="PART_Popup"
<Border BorderBrush="{DynamicResource ThemeBorderMidBrush}" WindowManagerAddShadowHint="False"
BorderThickness="1"> IsOpen="{TemplateBinding IsDropDownOpen, Mode=TwoWay}"
<ScrollViewer> MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
<ItemsPresenter Name="PART_ItemsPresenter" MaxHeight="{TemplateBinding MaxDropDownHeight}"
Items="{TemplateBinding Items}" PlacementTarget="{TemplateBinding}"
ItemsPanel="{TemplateBinding ItemsPanel}" StaysOpen="False">
ItemTemplate="{TemplateBinding ItemTemplate}" <Border x:Name="PopupBorder"
VirtualizationMode="{TemplateBinding VirtualizationMode}" Background="{DynamicResource ComboBoxDropDownBackground}"
BorderBrush="{DynamicResource ComboBoxDropDownBorderBrush}"
BorderThickness="{DynamicResource ComboBoxDropdownBorderThickness}"
Margin="0,-1,0,-1"
Padding="{DynamicResource ComboBoxDropdownBorderPadding}"
HorizontalAlignment="Stretch"
CornerRadius="{DynamicResource OverlayCornerRadius}">
<ScrollViewer>
<ItemsPresenter Name="PART_ItemsPresenter"
Items="{TemplateBinding Items}"
Margin="{DynamicResource ComboBoxDropdownContentMargin}"
ItemsPanel="{TemplateBinding ItemsPanel}"
ItemTemplate="{TemplateBinding ItemTemplate}"
VirtualizationMode="{TemplateBinding VirtualizationMode}"
/> />
</ScrollViewer> </ScrollViewer>
</Border> </Border>
</Popup> </Popup>
</Grid> </Grid>
</Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>
<Style Selector="ComboBox:pointerover /template/ Border#border">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}"/> <!-- NormalState -->
<Style Selector="ComboBox /template/ TextBlock#PlaceholderTextBlock">
<Setter Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForeground}"/>
</Style> </Style>
<Style Selector="ComboBox:disabled /template/ Border#border">
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" /> <Style Selector="ComboBox /template/ Path#DropDownGlyph">
<Setter Property="Fill" Value="{DynamicResource ComboBoxDropDownGlyphForeground}"/>
</Style> </Style>
<!-- PointerOver State -->
<Style Selector="ComboBox:pointerover /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource ComboBoxBackgroundPointerOver}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushPointerOver}" />
</Style>
<!-- Pressed State -->
<Style Selector="ComboBox:pressed /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource ComboBoxBackgroundPressed}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushPressed}" />
</Style>
<!-- Disabled State -->
<Style Selector="ComboBox:disabled /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource ComboBoxBackgroundDisabled}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushDisabled}" />
</Style>
<Style Selector="ComboBox:disabled /template/ ContentPresenter#HeaderContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}"/>
</Style>
<Style Selector="ComboBox:disabled /template/ ContentControl#ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}"/>
</Style>
<Style Selector="ComboBox:disabled /template/ TextBlock#PlaceholderTextBlock">
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}"/>
</Style>
<Style Selector="ComboBox:disabled /template/ TextBlock#PlaceholderTextBlock">
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}"/>
</Style>
<Style Selector="ComboBox:disabled /template/ Path#DropDownGlyph">
<Setter Property="Fill" Value="{DynamicResource ComboBoxDropDownGlyphForegroundDisabled}"/>
</Style>
<!-- Focused State -->
<!-- Focus Pressed State -->
<!-- Unfocused State -->
</Styles> </Styles>

34
src/Avalonia.Themes.Fluent/ComboBoxItem.xaml

@ -1,9 +1,27 @@
<Styles xmlns="https://github.com/avaloniaui"> <Styles xmlns="https://github.com/avaloniaui">
<Design.PreviewWith>
<Border Padding="20">
<StackPanel Spacing="10">
<ComboBox>
<ComboBoxItem>Item 1</ComboBoxItem>
<ComboBoxItem>Item 2</ComboBoxItem>
</ComboBox>
<ComboBox IsEnabled="False">
<ComboBoxItem>Item 1</ComboBoxItem>
<ComboBoxItem>Item 2</ComboBoxItem>
</ComboBox>
</StackPanel>
</Border>
</Design.PreviewWith>
<Style Selector="ComboBoxItem"> <Style Selector="ComboBoxItem">
<Setter Property="Background" Value="Transparent"/> <Setter Property="TextBlock.Foreground" Value="{DynamicResource ComboBoxItemForeground}" />
<Setter Property="Padding" Value="2"/> <Setter Property="Background" Value="{DynamicResource ComboBoxItemBackground}" />
<Setter Property="HorizontalAlignment" Value="Stretch"/> <Setter Property="Padding" Value="{DynamicResource ComboBoxItemThemePadding}" />
<Setter Property="HorizontalContentAlignment" Value="Left"/> <Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemRevealBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ComboBoxItemRevealBorderThemeThickness}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<ContentPresenter Name="PART_ContentPresenter" <ContentPresenter Name="PART_ContentPresenter"
@ -18,19 +36,19 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>
<Style Selector="ComboBoxItem:pointerover /template/ ContentPresenter"> <Style Selector="ComboBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeControlHighlightMidBrush}"/> <Setter Property="Background" Value="{DynamicResource ThemeControlHighlightMidBrush}"/>
</Style> </Style>
<Style Selector="ComboBoxItem:selected /template/ ContentPresenter"> <Style Selector="ComboBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush4}"/> <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush4}"/>
</Style> </Style>
<Style Selector="ComboBoxItem:selected:focus /template/ ContentPresenter"> <Style Selector="ComboBoxItem:selected:focus /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush3}"/> <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush3}"/>
</Style> </Style>
<Style Selector="ComboBoxItem:selected:pointerover /template/ ContentPresenter"> <Style Selector="ComboBoxItem:selected:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush3}"/> <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush3}"/>
</Style> </Style>

70
src/Avalonia.Themes.Fluent/ListBox.xaml

@ -1,31 +1,43 @@
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style Selector="ListBox"> <Design.PreviewWith>
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/> <Border Padding="20">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/> <ListBox>
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/> <ListBoxItem>Test</ListBoxItem>
<Setter Property="Padding" Value="4"/> <ListBoxItem>Test</ListBoxItem>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> <ListBoxItem>Test</ListBoxItem>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <ListBoxItem>Test</ListBoxItem>
<Setter Property="Template"> </ListBox>
<ControlTemplate> </Border>
<Border Name="border" BorderBrush="{TemplateBinding BorderBrush}" </Design.PreviewWith>
BorderThickness="{TemplateBinding BorderThickness}"> <Style Selector="ListBox">
<ScrollViewer Name="PART_ScrollViewer" <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
Background="{TemplateBinding Background}" <Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" />
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" <Setter Property="BorderBrush" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"> <Setter Property="BorderThickness" Value="{DynamicResource ListBoxBorderThemeThickness}" />
<ItemsPresenter Name="PART_ItemsPresenter" <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
Items="{TemplateBinding Items}" <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
ItemsPanel="{TemplateBinding ItemsPanel}" <Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
ItemTemplate="{TemplateBinding ItemTemplate}" <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
Margin="{TemplateBinding Padding}" <Setter Property="Template">
VirtualizationMode="{TemplateBinding VirtualizationMode}"/> <ControlTemplate>
</ScrollViewer> <Border Name="border" BorderBrush="{TemplateBinding BorderBrush}"
</Border> BorderThickness="{TemplateBinding BorderThickness}">
</ControlTemplate> <ScrollViewer Name="PART_ScrollViewer"
</Setter> Background="{TemplateBinding Background}"
</Style> HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
<Style Selector="ListBox:disabled /template/ Border#border"> VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" /> <ItemsPresenter Name="PART_ItemsPresenter"
</Style> Items="{TemplateBinding Items}"
ItemsPanel="{TemplateBinding ItemsPanel}"
ItemTemplate="{TemplateBinding ItemTemplate}"
Margin="{TemplateBinding Padding}"
VirtualizationMode="{TemplateBinding VirtualizationMode}"/>
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="ListBox:disabled /template/ Border#border">
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
</Style>
</Styles> </Styles>

90
src/Avalonia.Themes.Fluent/ListBoxItem.xaml

@ -1,12 +1,27 @@
<Styles xmlns="https://github.com/avaloniaui"> <Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith>
<Border Padding="0">
<ListBox>
<ListBoxItem IsEnabled="False">Disabled</ListBoxItem>
<ListBoxItem>Test</ListBoxItem>
<ListBoxItem>Test</ListBoxItem>
</ListBox>
</Border>
</Design.PreviewWith>
<Styles.Resources>
<Thickness x:Key="ListBoxItemPadding">12,9,12,12</Thickness>
</Styles.Resources>
<Style Selector="ListBoxItem"> <Style Selector="ListBoxItem">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent"/> <Setter Property="Padding" Value="{StaticResource ListBoxItemPadding}" />
<Setter Property="BorderThickness" Value="0"/> <Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="Padding" Value="2 1"/>
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<ContentPresenter Name="PART_ContentPresenter" <Border x:Name="LayoutRoot" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
<Panel>
<Rectangle x:Name="PressedBackground" IsHitTestVisible="False" />
<ContentPresenter Name="PART_ContentPresenter"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
@ -15,27 +30,68 @@
Padding="{TemplateBinding Padding}" Padding="{TemplateBinding Padding}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/> HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</Panel>
</Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>
<Style Selector="ListBoxItem /template/ ContentPresenter">
<Setter Property="TextBlock.FontWeight" Value="Normal" />
<Setter Property="TextBlock.FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
</Style>
<!-- Disabled State -->
<Style Selector="ListBoxItem:disabled /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlDisabledBaseMediumLowBrush}"/>
</Style>
<!-- PointerOver State -->
<Style Selector="ListBoxItem:pointerover /template/ Rectangle#PressedBackground">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListLowBrush}"/>
</Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter"> <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeControlHighlightMidBrush}"/> <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/>
</Style>
<!-- Pressed State -->
<Style Selector="ListBoxItem:pressed /template/ Rectangle#PressedBackground">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListMediumBrush}"/>
</Style>
<Style Selector="ListBoxItem:pressed /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/>
</Style>
<!-- Selected State -->
<Style Selector="ListBoxItem:selected /template/ Rectangle#PressedBackground">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}"/>
</Style> </Style>
<Style Selector="ListBoxItem:selected /template/ ContentPresenter"> <Style Selector="ListBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush4}"/> <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/>
</Style> </Style>
<Style Selector="ListBoxItem:selected:focus /template/ ContentPresenter"> <!-- Selected Unfocused State -->
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush3}"/> <Style Selector="ListBoxItem:selected:not(:focus) /template/ Rectangle#PressedBackground">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}"/>
</Style>
<Style Selector="ListBoxItem:selected:not(:focus) /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/>
</Style>
<!-- Selected PointerOver State -->
<Style Selector="ListBoxItem:selected:pointerover /template/ Rectangle#PressedBackground">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}"/>
</Style> </Style>
<Style Selector="ListBoxItem:selected:pointerover /template/ ContentPresenter"> <Style Selector="ListBoxItem:selected:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush3}"/> <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/>
</Style> </Style>
<Style Selector="ListBoxItem:selected:focus:pointerover /template/ ContentPresenter"> <!-- Selected Pressed State -->
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush2}"/> <Style Selector="ListBoxItem:selected:pressed /template/ Rectangle#PressedBackground">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListAccentHighBrush}"/>
</Style>
<Style Selector="ListBoxItem:selected:pressed /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/>
</Style> </Style>
</Styles> </Styles>

38
src/Avalonia.Themes.Fluent/PopupRoot.xaml

@ -1,17 +1,21 @@
<Style xmlns="https://github.com/avaloniaui" Selector="PopupRoot"> <Styles xmlns="https://github.com/avaloniaui"
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Setter Property="Template"> <Style Selector="PopupRoot">
<ControlTemplate> <Setter Property="TransparencyLevelHint" Value="Transparent" />
<Panel> <Setter Property="Background" Value="{x:Null}" />
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" /> <Setter Property="Template">
<VisualLayerManager IsPopup="True"> <ControlTemplate>
<ContentPresenter Name="PART_ContentPresenter" <Panel>
Background="{TemplateBinding Background}" <Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
ContentTemplate="{TemplateBinding ContentTemplate}" <VisualLayerManager IsPopup="True">
Content="{TemplateBinding Content}" <ContentPresenter Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"/> Background="{TemplateBinding Background}"
</VisualLayerManager> ContentTemplate="{TemplateBinding ContentTemplate}"
</Panel> Content="{TemplateBinding Content}"
</ControlTemplate> Padding="{TemplateBinding Padding}"/>
</Setter> </VisualLayerManager>
</Style> </Panel>
</ControlTemplate>
</Setter>
</Style>
</Styles>

207
src/Avalonia.Themes.Fluent/RadioButton.xaml

@ -1,60 +1,173 @@
<Styles xmlns="https://github.com/avaloniaui"> <Styles xmlns="https://github.com/avaloniaui">
<Design.PreviewWith>
<Border Padding="20">
<StackPanel Spacing="10">
<RadioButton Content="Option 1" />
<RadioButton Content="Option 2" />
<RadioButton IsEnabled="False" Content="Option 3" />
<RadioButton Content="Option 2" />
</StackPanel>
</Border>
</Design.PreviewWith>
<Style Selector="RadioButton"> <Style Selector="RadioButton">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/> <Setter Property="Foreground" Value="{DynamicResource RadioButtonForeground}" />
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/> <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrush}" />
<Setter Property="Padding" Value="8,6,0,0" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Top" />
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="MinWidth" Value="120" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate TargetType="RadioButton">
<Grid ColumnDefinitions="Auto,*" Background="{TemplateBinding Background}"> <Border Name="RootBorder"
<Ellipse Name="border" Background="{TemplateBinding Background}"
Stroke="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
StrokeThickness="1" BorderThickness="{TemplateBinding BorderThickness}"
Width="18" CornerRadius="{DynamicResource ControlCornerRadius}">
Height="18" <Grid ColumnDefinitions="20,*">
VerticalAlignment="Center"/> <Grid VerticalAlignment="Top"
<Ellipse Name="checkMark" Height="32">
Width="10"
Height="10" <Ellipse Name="OuterEllipse"
Stretch="Uniform" Width="20" Height="20"
UseLayoutRounding="False" UseLayoutRounding="False"
HorizontalAlignment="Center" StrokeThickness="{DynamicResource RadioButtonBorderThemeThickness}" />
VerticalAlignment="Center"/>
<Ellipse Name="indeterminateMark" <Ellipse Name="CheckOuterEllipse"
Fill="{DynamicResource ThemeAccentBrush}" Width="20" Height="20"
Width="10" UseLayoutRounding="False"
Height="10" StrokeThickness="{DynamicResource RadioButtonBorderThemeThickness}" />
Stretch="Uniform"
UseLayoutRounding="False" <Ellipse Name="CheckGlyph"
HorizontalAlignment="Center" Width="8" Height="8"
VerticalAlignment="Center"/> UseLayoutRounding="False" />
<ContentPresenter Name="PART_ContentPresenter" </Grid>
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}" <ContentPresenter Name="PART_ContentPresenter"
Margin="4,0,0,0" Content="{TemplateBinding Content}"
VerticalAlignment="Center" ContentTemplate="{TemplateBinding ContentTemplate}"
Grid.Column="1"/> TextBlock.Foreground="{TemplateBinding Foreground}"
</Grid> Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Grid.Column="1" />
</Grid>
</Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>
<Style Selector="RadioButton:pointerover /template/ Ellipse#border"> <!-- Normal State -->
<Setter Property="Stroke" Value="{DynamicResource ThemeBorderHighBrush}"/> <Style Selector="RadioButton /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStroke}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFill}" />
</Style> </Style>
<Style Selector="RadioButton /template/ Ellipse#checkMark">
<Setter Property="Fill" Value="{DynamicResource HighlightBrush}"/> <Style Selector="RadioButton /template/ Ellipse#CheckOuterEllipse">
<Setter Property="IsVisible" Value="False"/> <Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStroke}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFill}" />
<Setter Property="Opacity" Value="0" />
</Style> </Style>
<Style Selector="RadioButton /template/ Ellipse#indeterminateMark">
<Setter Property="IsVisible" Value="False"/> <Style Selector="RadioButton /template/ Ellipse#CheckGlyph">
<Setter Property="Opacity" Value="0" />
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphStroke}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphFill}" />
</Style> </Style>
<Style Selector="RadioButton:checked /template/ Ellipse#checkMark">
<Setter Property="IsVisible" Value="True"/>
<!-- PointerOver State -->
<Style Selector="RadioButton:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="(TextBlock.Foreground)" Value="{DynamicResource RadioButtonForegroundPointerOver}" />
</Style> </Style>
<Style Selector="RadioButton:indeterminate /template/ Ellipse#indeterminateMark">
<Setter Property="IsVisible" Value="True"/> <Style Selector="RadioButton:pointerover /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource RadioButtonBackgroundPointerOver}" />
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushPointerOver}" />
</Style> </Style>
<Style Selector="RadioButton:disabled /template/ Ellipse#border">
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}"/> <Style Selector="RadioButton:pointerover /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStrokePointerOver}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillPointerOver}" />
</Style>
<Style Selector="RadioButton:pointerover /template/ Ellipse#CheckOuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokePointerOver}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFillPointerOver}" />
</Style>
<Style Selector="RadioButton:pointerover /template/ Ellipse#CheckGlyph">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphStrokePointerOver}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphFillPointerOver}" />
</Style>
<!-- Pressed State -->
<Style Selector="RadioButton:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="(TextBlock.Foreground)" Value="{DynamicResource RadioButtonForegroundPressed}" />
</Style>
<Style Selector="RadioButton:pressed /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource RadioButtonBackgroundPressed}" />
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushPressed}" />
</Style>
<Style Selector="RadioButton:pressed /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStrokePressed}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillPressed}" />
</Style>
<Style Selector="RadioButton:pressed /template/ Ellipse#CheckOuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokePressed}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFillPressed}" />
</Style>
<Style Selector="RadioButton:pressed /template/ Ellipse#CheckGlyph">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphStrokePressed}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphFillPressed}" />
</Style>
<!-- Disabled State -->
<Style Selector="RadioButton:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="(TextBlock.Foreground)" Value="{DynamicResource RadioButtonForegroundDisabled}" />
</Style>
<Style Selector="RadioButton:disabled /template/ Border#RootBorder">
<Setter Property="Background" Value="{DynamicResource RadioButtonBackgroundDisabled}" />
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushDisabled}" />
</Style>
<Style Selector="RadioButton:disabled /template/ Ellipse#OuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStrokeDisabled}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillDisabled}" />
</Style>
<Style Selector="RadioButton:disabled /template/ Ellipse#CheckOuterEllipse">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokeDisabled}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFillDisabled}" />
</Style>
<Style Selector="RadioButton:disabled /template/ Ellipse#CheckGlyph">
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphFillDisabled}" />
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphStrokeDisabled}" />
</Style>
<!-- Checked State -->
<Style Selector="RadioButton:checked /template/ Ellipse#CheckGlyph">
<Setter Property="Opacity" Value="1" />
</Style>
<Style Selector="RadioButton:checked /template/ Ellipse#OuterEllipse">
<Setter Property="Opacity" Value="0" />
</Style>
<Style Selector="RadioButton:checked /template/ Ellipse#CheckOuterEllipse">
<Setter Property="Opacity" Value="1" />
</Style> </Style>
</Styles> </Styles>

14
src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs

@ -32,6 +32,7 @@ namespace Avalonia.Media.TextFormatting
/// <param name="textDecorations">The text decorations.</param> /// <param name="textDecorations">The text decorations.</param>
/// <param name="maxWidth">The maximum width.</param> /// <param name="maxWidth">The maximum width.</param>
/// <param name="maxHeight">The maximum height.</param> /// <param name="maxHeight">The maximum height.</param>
/// <param name="maxLines">The maximum number of text lines.</param>
/// <param name="textStyleOverrides">The text style overrides.</param> /// <param name="textStyleOverrides">The text style overrides.</param>
public TextLayout( public TextLayout(
string text, string text,
@ -44,6 +45,7 @@ namespace Avalonia.Media.TextFormatting
TextDecorationCollection textDecorations = null, TextDecorationCollection textDecorations = null,
double maxWidth = double.PositiveInfinity, double maxWidth = double.PositiveInfinity,
double maxHeight = double.PositiveInfinity, double maxHeight = double.PositiveInfinity,
int maxLines = 0,
IReadOnlyList<TextStyleRun> textStyleOverrides = null) IReadOnlyList<TextStyleRun> textStyleOverrides = null)
{ {
_text = string.IsNullOrEmpty(text) ? _text = string.IsNullOrEmpty(text) ?
@ -59,6 +61,8 @@ namespace Avalonia.Media.TextFormatting
MaxHeight = maxHeight; MaxHeight = maxHeight;
MaxLines = maxLines;
UpdateLayout(); UpdateLayout();
} }
@ -73,6 +77,12 @@ namespace Avalonia.Media.TextFormatting
/// </summary> /// </summary>
public double MaxHeight { get; } public double MaxHeight { get; }
/// <summary>
/// Gets the maximum number of text lines.
/// </summary>
public double MaxLines { get; }
/// <summary> /// <summary>
/// Gets the text lines. /// Gets the text lines.
/// </summary> /// </summary>
@ -192,7 +202,7 @@ namespace Avalonia.Media.TextFormatting
var currentPosition = 0; var currentPosition = 0;
while (currentPosition < _text.Length) while (currentPosition < _text.Length && (MaxLines == 0 || textLines.Count < MaxLines))
{ {
int length; int length;
@ -222,7 +232,7 @@ namespace Avalonia.Media.TextFormatting
var remainingLength = length; var remainingLength = length;
while (remainingLength > 0) while (remainingLength > 0 && (MaxLines == 0 || textLines.Count < MaxLines))
{ {
var textSlice = _text.AsSlice(currentPosition, remainingLength); var textSlice = _text.AsSlice(currentPosition, remainingLength);

4
src/Avalonia.X11/X11Window.cs

@ -1098,6 +1098,10 @@ namespace Avalonia.X11
public void SetTransparencyLevelHint(WindowTransparencyLevel transparencyLevel) => public void SetTransparencyLevelHint(WindowTransparencyLevel transparencyLevel) =>
_transparencyHelper.SetTransparencyRequest(transparencyLevel); _transparencyHelper.SetTransparencyRequest(transparencyLevel);
public void SetWindowManagerAddShadowHint(bool enabled)
{
}
public WindowTransparencyLevel TransparencyLevel => _transparencyHelper.CurrentLevel; public WindowTransparencyLevel TransparencyLevel => _transparencyHelper.CurrentLevel;
} }
} }

12
src/Linux/Avalonia.LinuxFramebuffer/Output/Drm.cs

@ -176,7 +176,13 @@ namespace Avalonia.LinuxFramebuffer.Output
[DllImport(libdrm, SetLastError = true)] [DllImport(libdrm, SetLastError = true)]
public static extern int drmModeAddFB(int fd, uint width, uint height, byte depth, public static extern int drmModeAddFB(int fd, uint width, uint height, byte depth,
byte bpp, uint pitch, uint bo_handle, byte bpp, uint pitch, uint bo_handle,
out uint buf_id); out uint buf_id);
[DllImport(libdrm, SetLastError = true)]
public static extern int drmModeAddFB2(int fd, uint width, uint height,
uint pixel_format, uint[] bo_handles, uint[] pitches,
uint[] offsets, out uint buf_id, uint flags);
[DllImport(libdrm, SetLastError = true)] [DllImport(libdrm, SetLastError = true)]
public static extern int drmModeSetCrtc(int fd, uint crtcId, uint bufferId, public static extern int drmModeSetCrtc(int fd, uint crtcId, uint bufferId,
uint x, uint y, uint *connectors, int count, uint x, uint y, uint *connectors, int count,
@ -261,6 +267,8 @@ namespace Avalonia.LinuxFramebuffer.Output
[DllImport(libgbm, SetLastError = true)] [DllImport(libgbm, SetLastError = true)]
public static extern uint gbm_bo_get_stride(IntPtr bo); public static extern uint gbm_bo_get_stride(IntPtr bo);
[DllImport(libgbm, SetLastError = true)]
public static extern uint gbm_bo_get_format(IntPtr bo);
[StructLayout(LayoutKind.Explicit)] [StructLayout(LayoutKind.Explicit)]
public struct GbmBoHandle public struct GbmBoHandle
@ -278,7 +286,7 @@ namespace Avalonia.LinuxFramebuffer.Output
} }
[DllImport(libgbm, SetLastError = true)] [DllImport(libgbm, SetLastError = true)]
public static extern ulong gbm_bo_get_handle(IntPtr bo); public static extern GbmBoHandle gbm_bo_get_handle(IntPtr bo);
public static class GbmColorFormats public static class GbmColorFormats
{ {

23
src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs

@ -7,6 +7,8 @@ using Avalonia.OpenGL;
using Avalonia.Platform.Interop; using Avalonia.Platform.Interop;
using static Avalonia.LinuxFramebuffer.NativeUnsafeMethods; using static Avalonia.LinuxFramebuffer.NativeUnsafeMethods;
using static Avalonia.LinuxFramebuffer.Output.LibDrm; using static Avalonia.LinuxFramebuffer.Output.LibDrm;
using static Avalonia.LinuxFramebuffer.Output.LibDrm.GbmColorFormats;
namespace Avalonia.LinuxFramebuffer.Output namespace Avalonia.LinuxFramebuffer.Output
{ {
public unsafe class DrmOutput : IOutputBackend, IGlPlatformSurface, IWindowingPlatformGlFeature public unsafe class DrmOutput : IOutputBackend, IGlPlatformSurface, IWindowingPlatformGlFeature
@ -71,11 +73,26 @@ namespace Avalonia.LinuxFramebuffer.Output
var w = gbm_bo_get_width(bo); var w = gbm_bo_get_width(bo);
var h = gbm_bo_get_height(bo); var h = gbm_bo_get_height(bo);
var stride = gbm_bo_get_stride(bo); var stride = gbm_bo_get_stride(bo);
var handle = gbm_bo_get_handle(bo); var handle = gbm_bo_get_handle(bo).u32;
var format = gbm_bo_get_format(bo);
// prepare for the new ioctl call
var handles = new uint[] {handle, 0, 0, 0};
var pitches = new uint[] {stride, 0, 0, 0};
var offsets = new uint[] {};
var ret = drmModeAddFB2(_card.Fd, w, h, format, handles, pitches,
offsets, out var fbHandle, 0);
var ret = drmModeAddFB(_card.Fd, w, h, 24, 32, stride, (uint)handle, out var fbHandle);
if (ret != 0) if (ret != 0)
throw new Win32Exception(ret, "drmModeAddFb failed"); {
// legacy fallback
ret = drmModeAddFB(_card.Fd, w, h, 24, 32, stride, (uint)handle,
out fbHandle);
if (ret != 0)
throw new Win32Exception(ret, $"drmModeAddFb failed {ret}");
}
gbm_bo_set_user_data(bo, new IntPtr((int)fbHandle), FbDestroyDelegate); gbm_bo_set_user_data(bo, new IntPtr((int)fbHandle), FbDestroyDelegate);

3
src/Windows/Avalonia.Win32/Avalonia.Win32.csproj

@ -6,6 +6,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\packages\Avalonia\Avalonia.csproj" /> <ProjectReference Include="..\..\..\packages\Avalonia\Avalonia.csproj" />
<PackageReference Include="Avalonia.Angle.Windows.Natives" Version="2.1.0.2019013001" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)\..\..\..\build\System.Drawing.Common.props" /> <Import Project="$(MSBuildThisFileDirectory)\..\..\..\build\System.Drawing.Common.props" />
</Project> </Project>

34
src/Windows/Avalonia.Win32/PopupImpl.cs

@ -7,6 +7,8 @@ namespace Avalonia.Win32
{ {
class PopupImpl : WindowImpl, IPopupImpl class PopupImpl : WindowImpl, IPopupImpl
{ {
private bool _dropShadowHint = true;
public override void Show() public override void Show()
{ {
UnmanagedMethods.ShowWindow(Handle.Handle, UnmanagedMethods.ShowWindowCommand.ShowNoActivate); UnmanagedMethods.ShowWindow(Handle.Handle, UnmanagedMethods.ShowWindowCommand.ShowNoActivate);
@ -36,11 +38,7 @@ namespace Avalonia.Win32
IntPtr.Zero, IntPtr.Zero,
IntPtr.Zero); IntPtr.Zero);
var classes = (int)UnmanagedMethods.GetClassLongPtr(result, (int)UnmanagedMethods.ClassLongIndex.GCL_STYLE); EnableBoxShadow(result, _dropShadowHint);
classes |= (int)UnmanagedMethods.ClassStyles.CS_DROPSHADOW;
UnmanagedMethods.SetClassLong(result, UnmanagedMethods.ClassLongIndex.GCL_STYLE, new IntPtr(classes));
return result; return result;
} }
@ -68,6 +66,32 @@ namespace Avalonia.Win32
//TODO: We ignore the scaling override for now //TODO: We ignore the scaling override for now
} }
private void EnableBoxShadow (IntPtr hwnd, bool enabled)
{
var classes = (int)UnmanagedMethods.GetClassLongPtr(hwnd, (int)UnmanagedMethods.ClassLongIndex.GCL_STYLE);
if (enabled)
{
classes |= (int)UnmanagedMethods.ClassStyles.CS_DROPSHADOW;
}
else
{
classes &= ~(int)UnmanagedMethods.ClassStyles.CS_DROPSHADOW;
}
UnmanagedMethods.SetClassLong(hwnd, UnmanagedMethods.ClassLongIndex.GCL_STYLE, new IntPtr(classes));
}
public void SetWindowManagerAddShadowHint(bool enabled)
{
_dropShadowHint = enabled;
if (Handle != null)
{
EnableBoxShadow(Handle.Handle, enabled);
}
}
public IPopupPositioner PopupPositioner { get; } public IPopupPositioner PopupPositioner { get; }
} }
} }

2
src/Windows/Avalonia.Win32/Win32Platform.cs

@ -36,7 +36,7 @@ namespace Avalonia
public class Win32PlatformOptions public class Win32PlatformOptions
{ {
public bool UseDeferredRendering { get; set; } = true; public bool UseDeferredRendering { get; set; } = true;
public bool AllowEglInitialization { get; set; } public bool AllowEglInitialization { get; set; } = true;
public bool? EnableMultitouch { get; set; } public bool? EnableMultitouch { get; set; }
public bool OverlayPopups { get; set; } public bool OverlayPopups { get; set; }
} }

65
tests/Avalonia.Animation.UnitTests/AnimatableTests.cs

@ -2,6 +2,7 @@
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Data; using Avalonia.Data;
using Avalonia.Layout; using Avalonia.Layout;
using Avalonia.Media;
using Avalonia.Styling; using Avalonia.Styling;
using Avalonia.UnitTests; using Avalonia.UnitTests;
using Moq; using Moq;
@ -265,6 +266,70 @@ namespace Avalonia.Animation.UnitTests
} }
} }
[Fact]
public void Replacing_Transitions_During_Animation_Does_Not_Throw_KeyNotFound()
{
// Issue #4059
using (UnitTestApplication.Start(TestServices.RealStyler))
{
Border target;
var clock = new TestClock();
var root = new TestRoot
{
Clock = clock,
Styles =
{
new Style(x => x.OfType<Border>())
{
Setters =
{
new Setter(Border.TransitionsProperty,
new Transitions
{
new DoubleTransition
{
Property = Border.OpacityProperty,
Duration = TimeSpan.FromSeconds(1),
},
}),
},
},
new Style(x => x.OfType<Border>().Class("foo"))
{
Setters =
{
new Setter(Border.TransitionsProperty,
new Transitions
{
new DoubleTransition
{
Property = Border.OpacityProperty,
Duration = TimeSpan.FromSeconds(1),
},
}),
new Setter(Border.OpacityProperty, 0.0),
},
},
},
Child = target = new Border
{
Background = Brushes.Red,
}
};
root.Measure(Size.Infinity);
root.Arrange(new Rect(root.DesiredSize));
target.Classes.Add("foo");
clock.Step(TimeSpan.FromSeconds(0));
clock.Step(TimeSpan.FromSeconds(0.5));
Assert.Equal(0.5, target.Opacity);
target.Classes.Remove("foo");
}
}
private static Mock<ITransition> CreateTarget() private static Mock<ITransition> CreateTarget()
{ {
return CreateTransition(Visual.OpacityProperty); return CreateTransition(Visual.OpacityProperty);

37
tests/Avalonia.Controls.UnitTests/Mixins/PressedMixinTests.cs

@ -0,0 +1,37 @@
using Avalonia.Controls.Mixins;
using Avalonia.UnitTests;
using Xunit;
namespace Avalonia.Controls.UnitTests.Mixins
{
public class PressedMixinTests
{
private MouseTestHelper _mouse = new MouseTestHelper();
[Fact]
public void Selected_Class_Should_Not_Initially_Be_Added()
{
var target = new TestControl();
Assert.Empty(target.Classes);
}
[Fact]
public void Setting_IsSelected_Should_Add_Selected_Class()
{
var target = new TestControl();
_mouse.Down(target);
Assert.Equal(new[] { ":pressed" }, target.Classes);
}
private class TestControl : Control
{
static TestControl()
{
PressedMixin.Attach<TestControl>();
}
}
}
}

2
tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs

@ -994,7 +994,7 @@ namespace Avalonia.Controls.UnitTests.Primitives
target.Presenter.ApplyTemplate(); target.Presenter.ApplyTemplate();
_helper.Down((Interactive)target.Presenter.Panel.Children[3]); _helper.Down((Interactive)target.Presenter.Panel.Children[3]);
Assert.Equal(new[] { ":selected" }, target.Presenter.Panel.Children[3].Classes); Assert.Equal(new[] { ":pressed", ":selected" }, target.Presenter.Panel.Children[3].Classes);
} }
[Fact] [Fact]

20
tests/Avalonia.Skia.UnitTests/TextLayoutTests.cs

@ -506,6 +506,26 @@ namespace Avalonia.Skia.UnitTests
} }
} }
[InlineData("0123456789\r\n0123456789\r\n0123456789", 0, 3)]
[InlineData("0123456789\r\n0123456789\r\n0123456789", 1, 1)]
[InlineData("0123456789\r\n0123456789\r\n0123456789", 4, 3)]
[Theory]
public void Should_Not_Exceed_MaxLines(string text, int maxLines, int expectedLines)
{
using (Start())
{
var layout = new TextLayout(
text,
Typeface.Default,
12,
Brushes.Black,
maxWidth: 50,
maxLines: maxLines);
Assert.Equal(expectedLines, layout.TextLines.Count);
}
}
private const string Text = "日本でTest一番読まれている英字新聞・ジャパンタイムズが発信する国内外ニュースと、様々なジャンルの特集記事。"; private const string Text = "日本でTest一番読まれている英字新聞・ジャパンタイムズが発信する国内外ニュースと、様々なジャンルの特集記事。";
[Fact(Skip= "Only used for profiling.")] [Fact(Skip= "Only used for profiling.")]

Loading…
Cancel
Save