Browse Source

Merge branch 'master' into master

pull/4790/head
Artyom V. Gorchakov 6 years ago
committed by GitHub
parent
commit
8e38c4ee07
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      samples/ControlCatalog/App.xaml.cs
  2. 2
      samples/ControlCatalog/MainView.xaml
  3. 4
      samples/ControlCatalog/MainView.xaml.cs
  4. 12
      src/Avalonia.Base/AvaloniaObject.cs
  5. 2
      src/Avalonia.Themes.Fluent/Accents/Base.xaml
  6. BIN
      src/Avalonia.Themes.Fluent/Assets/Inter-Bold.ttf
  7. BIN
      src/Avalonia.Themes.Fluent/Assets/Inter-ExtraLight.ttf
  8. BIN
      src/Avalonia.Themes.Fluent/Assets/Inter-Light.ttf
  9. BIN
      src/Avalonia.Themes.Fluent/Assets/Inter-Medium.ttf
  10. BIN
      src/Avalonia.Themes.Fluent/Assets/Inter-Regular.ttf
  11. BIN
      src/Avalonia.Themes.Fluent/Assets/Inter-SemiBold.ttf
  12. BIN
      src/Avalonia.Themes.Fluent/Assets/Inter-Thin.ttf
  13. BIN
      src/Avalonia.Themes.Fluent/Assets/Roboto-Black.ttf
  14. BIN
      src/Avalonia.Themes.Fluent/Assets/Roboto-Bold.ttf
  15. BIN
      src/Avalonia.Themes.Fluent/Assets/Roboto-Light.ttf
  16. BIN
      src/Avalonia.Themes.Fluent/Assets/Roboto-Medium.ttf
  17. BIN
      src/Avalonia.Themes.Fluent/Assets/Roboto-Regular.ttf
  18. BIN
      src/Avalonia.Themes.Fluent/Assets/Roboto-Thin.ttf
  19. 85
      src/Avalonia.Themes.Fluent/ListBoxItem.xaml

2
samples/ControlCatalog/App.xaml.cs

@ -81,7 +81,7 @@ namespace ControlCatalog
public override void Initialize() public override void Initialize()
{ {
Styles.Insert(0, FluentDark); Styles.Insert(0, FluentLight);
AvaloniaXamlLoader.Load(this); AvaloniaXamlLoader.Load(this);
} }

2
samples/ControlCatalog/MainView.xaml

@ -77,8 +77,8 @@
<ComboBoxItem>Full Decorations</ComboBoxItem> <ComboBoxItem>Full Decorations</ComboBoxItem>
</ComboBox> </ComboBox>
<ComboBox x:Name="Themes" SelectedIndex="0"> <ComboBox x:Name="Themes" SelectedIndex="0">
<ComboBoxItem>Fluent - Dark</ComboBoxItem>
<ComboBoxItem>Fluent - Light</ComboBoxItem> <ComboBoxItem>Fluent - Light</ComboBoxItem>
<ComboBoxItem>Fluent - Dark</ComboBoxItem>
<ComboBoxItem>Simple - Light</ComboBoxItem> <ComboBoxItem>Simple - Light</ComboBoxItem>
<ComboBoxItem>Simple - Dark</ComboBoxItem> <ComboBoxItem>Simple - Dark</ComboBoxItem>
</ComboBox> </ComboBox>

4
samples/ControlCatalog/MainView.xaml.cs

@ -38,10 +38,10 @@ namespace ControlCatalog
switch (themes.SelectedIndex) switch (themes.SelectedIndex)
{ {
case 0: case 0:
Application.Current.Styles[0] = App.FluentDark; Application.Current.Styles[0] = App.FluentLight;
break; break;
case 1: case 1:
Application.Current.Styles[0] = App.FluentLight; Application.Current.Styles[0] = App.FluentDark;
break; break;
case 2: case 2:
Application.Current.Styles[0] = App.DefaultLight; Application.Current.Styles[0] = App.DefaultLight;

12
src/Avalonia.Base/AvaloniaObject.cs

@ -113,16 +113,8 @@ namespace Avalonia
/// <param name="binding">The binding information.</param> /// <param name="binding">The binding information.</param>
public IBinding this[IndexerDescriptor binding] public IBinding this[IndexerDescriptor binding]
{ {
get get { return new IndexerBinding(this, binding.Property, binding.Mode); }
{ set { this.Bind(binding.Property, value); }
return new IndexerBinding(this, binding.Property, binding.Mode);
}
set
{
var sourceBinding = value as IBinding;
this.Bind(binding.Property, sourceBinding);
}
} }
public bool CheckAccess() => Dispatcher.UIThread.CheckAccess(); public bool CheckAccess() => Dispatcher.UIThread.CheckAccess();

2
src/Avalonia.Themes.Fluent/Accents/Base.xaml

@ -12,7 +12,7 @@
<Color x:Key="SystemColorHotlightColor">#FF0066CC</Color> <Color x:Key="SystemColorHotlightColor">#FF0066CC</Color>
<Color x:Key="SystemColorWindowColor">#FFFFFFFF</Color> <Color x:Key="SystemColorWindowColor">#FFFFFFFF</Color>
<Color x:Key="SystemColorWindowTextColor">#FF000000</Color> <Color x:Key="SystemColorWindowTextColor">#FF000000</Color>
<FontFamily x:Key="ContentControlThemeFontFamily">avares://Avalonia.Themes.Fluent/Assets#Roboto</FontFamily> <FontFamily x:Key="ContentControlThemeFontFamily">avares://Avalonia.Themes.Fluent/Assets#Inter</FontFamily>
<sys:Double x:Key="ControlContentThemeFontSize">14</sys:Double> <sys:Double x:Key="ControlContentThemeFontSize">14</sys:Double>
<SolidColorBrush x:Key="SystemControlTransparentBrush" Color="Transparent" /> <SolidColorBrush x:Key="SystemControlTransparentBrush" Color="Transparent" />

BIN
src/Avalonia.Themes.Fluent/Assets/Inter-Bold.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Inter-ExtraLight.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Inter-Light.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Inter-Medium.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Inter-Regular.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Inter-SemiBold.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Inter-Thin.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Roboto-Black.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Roboto-Bold.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Roboto-Light.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Roboto-Medium.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Roboto-Regular.ttf

Binary file not shown.

BIN
src/Avalonia.Themes.Fluent/Assets/Roboto-Thin.ttf

Binary file not shown.

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

@ -1,9 +1,13 @@
<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">
<Design.PreviewWith> <Design.PreviewWith>
<Border Padding="0"> <Border Padding="0">
<ListBox> <ListBox>
<ListBoxItem IsEnabled="False">Disabled</ListBoxItem> <ListBoxItem IsEnabled="False">Disabled</ListBoxItem>
<ListBoxItem>Test</ListBoxItem> <ListBoxItem Background="#66000000"
Padding="20">
Test
</ListBoxItem>
<ListBoxItem>Test</ListBoxItem> <ListBoxItem>Test</ListBoxItem>
</ListBox> </ListBox>
</Border> </Border>
@ -17,11 +21,7 @@
<Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Border x:Name="LayoutRoot" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}"> <ContentPresenter Name="PART_ContentPresenter"
<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}"
@ -29,69 +29,66 @@
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
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"> <Style Selector="ListBoxItem /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="TextBlock.FontWeight" Value="Normal" /> <Setter Property="TextBlock.FontWeight" Value="Normal" />
<Setter Property="TextBlock.FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> <Setter Property="TextBlock.FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
</Style> </Style>
<!-- Disabled State --> <!-- Disabled State -->
<Style Selector="ListBoxItem:disabled /template/ ContentPresenter"> <Style Selector="ListBoxItem:disabled /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlDisabledBaseMediumLowBrush}"/> <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlDisabledBaseMediumLowBrush}" />
</Style> </Style>
<!-- PointerOver State --> <!-- PointerOver State -->
<Style Selector="ListBoxItem:pointerover /template/ Rectangle#PressedBackground"> <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListLowBrush}"/> <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListLowBrush}" />
</Style> </Style>
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter"> <Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/> <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
</Style> </Style>
<!-- Pressed State --> <!-- Pressed State -->
<Style Selector="ListBoxItem:pressed /template/ Rectangle#PressedBackground"> <Style Selector="ListBoxItem:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListMediumBrush}"/> <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListMediumBrush}" />
</Style> </Style>
<Style Selector="ListBoxItem:pressed /template/ ContentPresenter"> <Style Selector="ListBoxItem:pressed /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/> <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
</Style> </Style>
<!-- Selected State --> <!-- Selected State -->
<Style Selector="ListBoxItem:selected /template/ Rectangle#PressedBackground"> <Style Selector="ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}"/> <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}" />
</Style> </Style>
<Style Selector="ListBoxItem:selected /template/ ContentPresenter"> <Style Selector="ListBoxItem:selected /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/> <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
</Style> </Style>
<!-- Selected Unfocused State --> <!-- Selected Unfocused State -->
<Style Selector="ListBoxItem:selected:not(:focus) /template/ Rectangle#PressedBackground"> <Style Selector="ListBoxItem:selected:not(:focus) /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}"/> <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}" />
</Style> </Style>
<Style Selector="ListBoxItem:selected:not(:focus) /template/ ContentPresenter"> <Style Selector="ListBoxItem:selected:not(:focus) /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/> <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
</Style> </Style>
<!-- Selected PointerOver State --> <!-- Selected PointerOver State -->
<Style Selector="ListBoxItem:selected:pointerover /template/ Rectangle#PressedBackground"> <Style Selector="ListBoxItem:selected:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}"/> <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" />
</Style> </Style>
<Style Selector="ListBoxItem:selected:pointerover /template/ ContentPresenter"> <Style Selector="ListBoxItem:selected:pointerover /template/ ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/> <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
</Style> </Style>
<!-- Selected Pressed State --> <!-- Selected Pressed State -->
<Style Selector="ListBoxItem:selected:pressed /template/ Rectangle#PressedBackground"> <Style Selector="ListBoxItem:selected:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Fill" Value="{DynamicResource SystemControlHighlightListAccentHighBrush}"/> <Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentHighBrush}" />
</Style> </Style>
<Style Selector="ListBoxItem:selected:pressed /template/ ContentPresenter"> <Style Selector="ListBoxItem:selected:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}"/> <Setter Property="TextBlock.Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" />
</Style> </Style>
</Styles> </Styles>

Loading…
Cancel
Save