Files
2024-07-18 18:00:01 +01:00

224 lines
15 KiB
XML

<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Toolkit.UI.Controls.Avalonia">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<StaticResource x:Key="OverflowItemBackgroundSelected" ResourceKey="SubtleFillColorTransparentBrush" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<StaticResource x:Key="OverflowItemBackgroundSelected" ResourceKey="SubtleFillColorTransparentBrush" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<x:Double x:Key="OverflowItemSpacing">6</x:Double>
<x:Double x:Key="OverflowItemSize">40</x:Double>
<CornerRadius x:Key="OverflowItemCornerRadius">40</CornerRadius>
<ControlTheme x:Key="{x:Type OverflowList}" TargetType="OverflowList">
<Setter Property="Foreground" Value="{DynamicResource ListBoxForeground}" />
<Setter Property="Background" Value="{DynamicResource ListBoxBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ListBoxBorder}" />
<Setter Property="BorderThickness" Value="{DynamicResource ListBoxBorderThemeThickness}" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
<Setter Property="ScrollViewer.IsScrollInertiaEnabled" Value="True" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="Template">
<ControlTemplate>
<Border
Name="border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer
Name="PART_ScrollViewer"
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
Background="{TemplateBinding Background}"
BringIntoViewOnFocusChange="{TemplateBinding (ScrollViewer.BringIntoViewOnFocusChange)}"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
HorizontalSnapPointsType="{TemplateBinding (ScrollViewer.HorizontalSnapPointsType)}"
IsDeferredScrollingEnabled="{TemplateBinding (ScrollViewer.IsDeferredScrollingEnabled)}"
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
IsScrollInertiaEnabled="{TemplateBinding (ScrollViewer.IsScrollInertiaEnabled)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"
VerticalSnapPointsType="{TemplateBinding (ScrollViewer.VerticalSnapPointsType)}">
<ItemsPresenter
Name="PART_ItemsPresenter"
Margin="{TemplateBinding Padding}"
ItemsPanel="{TemplateBinding ItemsPanel}" />
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme x:Key="{x:Type controls:OverflowItem}" TargetType="controls:OverflowItem">
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="Background" Value="{DynamicResource ListViewItemBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ListViewItemForeground}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Width" Value="{StaticResource OverflowItemSize}" />
<Setter Property="Height" Value="{StaticResource OverflowItemSize}" />
<Setter Property="MinHeight" Value="{StaticResource OverflowItemSize}" />
<Setter Property="MinWidth" Value="{StaticResource OverflowItemSize}" />
<Setter Property="CornerRadius" Value="{StaticResource OverflowItemCornerRadius}" />
<Setter Property="Template">
<ControlTemplate>
<Panel>
<Border
x:Name="PART_ContentBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<controls:ContentBadge
BadgePath="{TemplateBinding BadgePath}"
BadgePlacement="{TemplateBinding BadgePlacement}"
BadgeSize="{TemplateBinding BadgeSize}"
Foreground="{TemplateBinding BadgeBrush}"
IsBadgeVisible="{TemplateBinding IsBadgeVisible}">
<Grid>
<ContentPresenter
Name="PART_ContentPresenter"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}" />
<Border
Name="SelectionIndicator"
BorderBrush="{DynamicResource AccentFillColorDefaultBrush}"
BorderThickness="3"
CornerRadius="{TemplateBinding CornerRadius}"
IsVisible="False"
UseLayoutRounding="False" />
</Grid>
</controls:ContentBadge>
</Border>
</Panel>
</ControlTemplate>
</Setter>
<Style Selector="^:disabled">
<Setter Property="Opacity" Value="0.5" />
</Style>
<Style Selector="^:pointerover">
<Style Selector="^ /template/ Border#PART_ContentBorder">
<Setter Property="Background" Value="{DynamicResource ListViewItemBackgroundPointerOver}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ListViewItemForegroundPointerOver}" />
</Style>
</Style>
<Style Selector="^:pressed">
<Style Selector="^ /template/ Border#PART_ContentBorder">
<Setter Property="Background" Value="{DynamicResource ListViewItemBackgroundPressed}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ListViewItemForegroundPressed}" />
</Style>
</Style>
<Style Selector="^:selected">
<Style Selector="^ /template/ Border#PART_ContentBorder">
<Setter Property="Background" Value="{DynamicResource OverflowItemBackgroundSelected}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ListViewItemForegroundSelected}" />
</Style>
<Style Selector="^ /template/ Border#SelectionIndicator">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^:not(:focus) /template/ Border#PART_ContentBorder">
<Setter Property="Background" Value="{DynamicResource OverflowItemBackgroundSelected}" />
</Style>
<Style Selector="^:not(:focus) /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ListViewItemForegroundSelected}" />
</Style>
<Style Selector="^:pointerover">
<Style Selector="^ /template/ Border#PART_ContentBorder">
<Setter Property="Background" Value="{DynamicResource OverflowItemBackgroundSelectedPointerOver}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ListViewItemForegroundSelectedPointerOver}" />
</Style>
<Style Selector="^ /template/ Border#SelectionIndicator">
<Setter Property="BorderBrush" Value="{DynamicResource ListViewItemSelectionIndicatorPointerOverBrush}" />
</Style>
</Style>
<Style Selector="^:pressed">
<Style Selector="^ /template/ Border#PART_ContentBorder">
<Setter Property="Background" Value="{DynamicResource OverflowItemBackgroundSelectedPressed}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Foreground" Value="{DynamicResource ListViewItemForegroundSelectedPressed}" />
</Style>
</Style>
<Style Selector="^:disabled /template/ Border#SelectionIndicator">
<Setter Property="BorderBrush" Value="{DynamicResource ListViewItemSelectionIndicatorDisabledBrush}" />
</Style>
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type controls:Overflow}" TargetType="controls:Overflow">
<Setter Property="Template">
<ControlTemplate>
<StackPanel Margin="{TemplateBinding Margin}">
<controls:OverflowList
x:Name="PrimaryListBox"
Grid.Column="0"
ItemContainerTemplateSelector="{TemplateBinding ItemContainerTemplateSelector}"
ItemTemplate="{TemplateBinding ItemTemplate}"
SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PrimarySelection, Mode=TwoWay}">
<controls:OverflowList.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="{StaticResource OverflowItemSpacing}" />
</ItemsPanelTemplate>
</controls:OverflowList.ItemsPanel>
</controls:OverflowList>
<Grid
x:Name="Spacer"
Grid.Column="1"
Width="{StaticResource OverflowItemSpacing}"
Height="{StaticResource OverflowItemSpacing}"
IsVisible="False" />
<Button
x:Name="OverflowButton"
Grid.Column="2"
MinWidth="{StaticResource OverflowItemSize}"
MinHeight="{StaticResource OverflowItemSize}"
Padding="0"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
CornerRadius="{StaticResource OverflowItemCornerRadius}"
Focusable="False"
IsVisible="False">
<Viewbox Width="14" Height="14">
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 6.24 11.799999 C 6.239999 12.146667 6.119999 12.440001 5.88 12.679999 C 5.64 12.92 5.346666 13.039999 5 13.039999 C 4.653333 13.039999 4.36 12.92 4.12 12.679999 C 3.88 12.440001 3.76 12.146667 3.76 11.799999 C 3.76 11.453333 3.88 11.16 4.12 10.919999 C 4.36 10.679999 4.653333 10.559999 5 10.559999 C 5.346666 10.559999 5.64 10.679999 5.88 10.919999 C 6.119999 11.16 6.239999 11.453333 6.24 11.799999 Z M 11.24 11.799999 C 11.24 12.146667 11.12 12.440001 10.88 12.679999 C 10.639999 12.92 10.346666 13.039999 10 13.039999 C 9.653333 13.039999 9.359999 12.92 9.12 12.679999 C 8.879999 12.440001 8.76 12.146667 8.76 11.799999 C 8.76 11.453333 8.879999 11.16 9.12 10.919999 C 9.359999 10.679999 9.653333 10.559999 10 10.559999 C 10.346666 10.559999 10.639999 10.679999 10.88 10.919999 C 11.12 11.16 11.24 11.453333 11.24 11.799999 Z M 15 13.039999 C 15.346665 13.039999 15.639999 12.92 15.88 12.679999 C 16.119999 12.440001 16.24 12.146667 16.24 11.799999 C 16.24 11.453333 16.119999 11.16 15.88 10.919999 C 15.639999 10.679999 15.346665 10.559999 15 10.559999 C 14.653333 10.559999 14.36 10.679999 14.12 10.919999 C 13.879999 11.16 13.759998 11.453333 13.759999 11.799999 C 13.759998 12.146667 13.879999 12.440001 14.12 12.679999 C 14.36 12.92 14.653333 13.039999 15 13.039999 Z " />
</Viewbox>
<Button.Flyout>
<Flyout>
<controls:OverflowList
x:Name="SecondaryListBox"
ItemContainerTemplateSelector="{TemplateBinding ItemContainerTemplateSelector}"
ItemTemplate="{TemplateBinding ItemTemplate}"
SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.SecondarySelection, Mode=TwoWay}">
<controls:OverflowList.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="{StaticResource OverflowItemSpacing}" />
</ItemsPanelTemplate>
</controls:OverflowList.ItemsPanel>
</controls:OverflowList>
</Flyout>
</Button.Flyout>
</Button>
</StackPanel>
</ControlTemplate>
</Setter>
<Style Selector="^:overflow /template/ Button#OverflowButton">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="^:overflow /template/ Grid#Spacer">
<Setter Property="IsVisible" Value="True" />
</Style>
</ControlTheme>
</ResourceDictionary>