mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-21 08:56:35 +08:00
93
demo/Semi.Avalonia.Demo/Pages/TabStripDemo.axaml
Normal file
93
demo/Semi.Avalonia.Demo/Pages/TabStripDemo.axaml
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
<UserControl xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels"
|
||||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="Semi.Avalonia.Demo.Pages.TabStripDemo"
|
||||||
|
x:DataType="vm:TabStripDemoViewModel">
|
||||||
|
<Design.DataContext>
|
||||||
|
<vm:TabStripDemoViewModel />
|
||||||
|
</Design.DataContext>
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel>
|
||||||
|
<TabControl Theme="{StaticResource LineTabControl}">
|
||||||
|
<TabItem Header="Default">
|
||||||
|
<StackPanel>
|
||||||
|
<Border Theme="{StaticResource CardBorder}">
|
||||||
|
<TabStrip>
|
||||||
|
<TabStripItem Content="Tab 1" />
|
||||||
|
<TabStripItem Content="Tab 2" />
|
||||||
|
<TabStripItem Content="Tab 3" />
|
||||||
|
<TabStripItem Content="中文中文" />
|
||||||
|
<TabStripItem Content="Tab 4" IsEnabled="False" />
|
||||||
|
</TabStrip>
|
||||||
|
</Border>
|
||||||
|
<Border Theme="{StaticResource CardBorder}">
|
||||||
|
<TabStrip
|
||||||
|
ItemsSource="{Binding Items}" />
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Line">
|
||||||
|
<StackPanel>
|
||||||
|
<Border Theme="{StaticResource CardBorder}">
|
||||||
|
<TabStrip Theme="{StaticResource LineTabStrip}">
|
||||||
|
<TabStripItem Content="Tab 1" />
|
||||||
|
<TabStripItem Content="Tab 2" />
|
||||||
|
<TabStripItem Content="Tab 3" />
|
||||||
|
<TabStripItem Content="中文中文" />
|
||||||
|
<TabStripItem Content="Tab 4" IsEnabled="False" />
|
||||||
|
</TabStrip>
|
||||||
|
</Border>
|
||||||
|
<Border Theme="{StaticResource CardBorder}">
|
||||||
|
<TabStrip
|
||||||
|
ItemsSource="{Binding Items}"
|
||||||
|
Theme="{StaticResource LineTabStrip}" />
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Card">
|
||||||
|
<StackPanel>
|
||||||
|
<Border
|
||||||
|
Background="Transparent"
|
||||||
|
Theme="{StaticResource CardBorder}">
|
||||||
|
<TabStrip Theme="{StaticResource CardTabStrip}">
|
||||||
|
<TabStripItem Content="Tab 1" />
|
||||||
|
<TabStripItem Content="Tab 2" />
|
||||||
|
<TabStripItem Content="Tab 3" />
|
||||||
|
<TabStripItem Content="中文中文" />
|
||||||
|
<TabStripItem Content="Tab 4" IsEnabled="False" />
|
||||||
|
</TabStrip>
|
||||||
|
</Border>
|
||||||
|
<Border
|
||||||
|
Background="Transparent"
|
||||||
|
Theme="{StaticResource CardBorder}">
|
||||||
|
<TabStrip
|
||||||
|
ItemsSource="{Binding Items}"
|
||||||
|
Theme="{StaticResource CardTabStrip}" />
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="Button">
|
||||||
|
<StackPanel>
|
||||||
|
<Border Theme="{StaticResource CardBorder}">
|
||||||
|
<TabStrip Theme="{StaticResource ButtonTabStrip}">
|
||||||
|
<TabStripItem Content="Tab 1" />
|
||||||
|
<TabStripItem Content="Tab 2" />
|
||||||
|
<TabStripItem Content="Tab 3" />
|
||||||
|
<TabStripItem Content="中文中文" />
|
||||||
|
<TabStripItem Content="Tab 4" IsEnabled="False" />
|
||||||
|
</TabStrip>
|
||||||
|
</Border>
|
||||||
|
<Border Theme="{StaticResource CardBorder}">
|
||||||
|
<TabStrip
|
||||||
|
ItemsSource="{Binding Items}"
|
||||||
|
Theme="{StaticResource ButtonTabStrip}" />
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</UserControl>
|
||||||
13
demo/Semi.Avalonia.Demo/Pages/TabStripDemo.axaml.cs
Normal file
13
demo/Semi.Avalonia.Demo/Pages/TabStripDemo.axaml.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
public partial class TabStripDemo : UserControl
|
||||||
|
{
|
||||||
|
public TabStripDemo()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = new TabStripDemoViewModel();
|
||||||
|
}
|
||||||
|
}
|
||||||
10
demo/Semi.Avalonia.Demo/ViewModels/TabStripDemoViewModel.cs
Normal file
10
demo/Semi.Avalonia.Demo/ViewModels/TabStripDemoViewModel.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
|
namespace Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
|
public class TabStripDemoViewModel : ObservableObject
|
||||||
|
{
|
||||||
|
public ObservableCollection<string> Items => new(Enumerable.Range(1, 10).Select(a => "Tab " + a));
|
||||||
|
}
|
||||||
@@ -219,6 +219,9 @@
|
|||||||
<TabItem Header="TabControl">
|
<TabItem Header="TabControl">
|
||||||
<pages:TabControlDemo />
|
<pages:TabControlDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<TabItem Header="TabStrip">
|
||||||
|
<pages:TabStripDemo />
|
||||||
|
</TabItem>
|
||||||
<TabItem Header="TreeView">
|
<TabItem Header="TreeView">
|
||||||
<pages:TreeViewDemo />
|
<pages:TreeViewDemo />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|||||||
@@ -2,108 +2,215 @@
|
|||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
x:CompileBindings="True">
|
x:CompileBindings="True">
|
||||||
|
<Design.PreviewWith>
|
||||||
|
<StackPanel Width="400" Height="400" Margin="20">
|
||||||
|
<TabStrip Theme="{DynamicResource LineTabStrip}">
|
||||||
|
<TabStripItem Content="文档" />
|
||||||
|
<TabStripItem Content="快速起步" IsEnabled="False" />
|
||||||
|
<TabStripItem Content="帮助" IsSelected="True" />
|
||||||
|
</TabStrip>
|
||||||
|
</StackPanel>
|
||||||
|
</Design.PreviewWith>
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type TabStrip}" TargetType="TabStrip">
|
<ControlTheme x:Key="{x:Type TabStrip}" TargetType="TabStrip">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Top" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate>
|
<ControlTemplate TargetType="TabStrip">
|
||||||
<Border
|
<Border
|
||||||
Padding="{TemplateBinding Padding}"
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||||
|
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
<Panel>
|
<Panel>
|
||||||
<ItemsPresenter Name="PART_ItemsPresenter" ItemsPanel="{TemplateBinding ItemsPanel}" />
|
<ItemsPresenter
|
||||||
<Border
|
Name="PART_ItemsPresenter"
|
||||||
Name="PART_BorderSeparator"
|
ItemsPanel="{TemplateBinding ItemsPanel}" />
|
||||||
Height="1"
|
<Border Name="PART_BorderSeparator" />
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Bottom"
|
|
||||||
Background="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
|
||||||
</Panel>
|
</Panel>
|
||||||
</Border>
|
</Border>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
<Setter Property="ItemsPanel">
|
|
||||||
<ItemsPanelTemplate>
|
<Style Selector="^ /template/ Border#PART_BorderSeparator">
|
||||||
<WrapPanel />
|
<Setter Property="Background" Value="{DynamicResource TabControlSeparatorBorderBrush}" />
|
||||||
</ItemsPanelTemplate>
|
<Setter Property="Height" Value="1" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Bottom" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme
|
||||||
|
x:Key="LineTabStrip"
|
||||||
|
BasedOn="{StaticResource {x:Type TabStrip}}"
|
||||||
|
TargetType="TabStrip">
|
||||||
|
<Setter Property="ItemContainerTheme" Value="{StaticResource LineTabStripItem}" />
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme
|
||||||
|
x:Key="CardTabStrip"
|
||||||
|
BasedOn="{StaticResource {x:Type TabStrip}}"
|
||||||
|
TargetType="TabStrip">
|
||||||
|
<Setter Property="ItemContainerTheme" Value="{StaticResource CardTabStripItem}" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Top" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<ControlTemplate TargetType="TabStrip">
|
||||||
|
<Border
|
||||||
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||||
|
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
|
<Panel>
|
||||||
|
<Border Name="PART_BorderSeparator" />
|
||||||
|
<ItemsPresenter
|
||||||
|
Name="PART_ItemsPresenter"
|
||||||
|
ItemsPanel="{TemplateBinding ItemsPanel}" />
|
||||||
|
</Panel>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="{x:Type TabStripItem}" TargetType="TabStripItem">
|
<ControlTheme
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemLinePipeBackground}" />
|
x:Key="ButtonTabStrip"
|
||||||
|
BasedOn="{StaticResource {x:Type TabStrip}}"
|
||||||
|
TargetType="TabStrip">
|
||||||
|
<Setter Property="ItemContainerTheme" Value="{StaticResource ButtonTabStripItem}" />
|
||||||
|
<Style Selector="^ /template/ Border#PART_BorderSeparator">
|
||||||
|
<Setter Property="IsVisible" Value="False" />
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
|
||||||
|
<ControlTheme x:Key="BaseTabStripItem" TargetType="TabStripItem">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderForeground}" />
|
||||||
<Setter Property="Margin" Value="0" />
|
<Setter Property="Background" Value="{DynamicResource TabItemLinePipeBackground}" />
|
||||||
<Setter Property="Padding" Value="8 4" />
|
|
||||||
<Setter Property="MinHeight" Value="5" />
|
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="TabStripItem">
|
<ControlTemplate TargetType="TabStripItem">
|
||||||
<Border
|
<ContentPresenter
|
||||||
Name="PART_LayoutRoot"
|
Name="PART_ContentPresenter"
|
||||||
|
Padding="{TemplateBinding Padding}"
|
||||||
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
Content="{TemplateBinding Content}"
|
||||||
<Panel>
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
<ContentPresenter
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
Name="PART_ContentPresenter"
|
FontFamily="{TemplateBinding FontFamily}"
|
||||||
Margin="0,0,0,4"
|
FontWeight="{TemplateBinding FontWeight}"
|
||||||
Padding="{TemplateBinding Padding}"
|
Foreground="{TemplateBinding Foreground}" />
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
||||||
Content="{TemplateBinding Content}"
|
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
||||||
FontFamily="{TemplateBinding FontFamily}"
|
|
||||||
FontWeight="{TemplateBinding FontWeight}"
|
|
||||||
Foreground="{TemplateBinding Foreground}" />
|
|
||||||
<Border
|
|
||||||
Name="PART_SelectedPipe"
|
|
||||||
Height="2"
|
|
||||||
Margin="0"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Bottom"
|
|
||||||
Background="{DynamicResource TabItemLinePipeBackground}"
|
|
||||||
IsVisible="True"
|
|
||||||
UseLayoutRounding="False" />
|
|
||||||
</Panel>
|
|
||||||
</Border>
|
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
<!-- Selected state -->
|
|
||||||
<Style Selector="^:selected /template/ ContentPresenter#PART_ContentPresenter">
|
<Style Selector="^:selected /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderSelectedForeground}" />
|
|
||||||
<Setter Property="FontWeight" Value="{DynamicResource TabItemSelectedFontWeight}" />
|
<Setter Property="FontWeight" Value="{DynamicResource TabItemSelectedFontWeight}" />
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderSelectedForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:not(:selected)">
|
<Style Selector="^:not(:selected)">
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Style Selector="^:pointerover /template/ Label#PART_ContentPresenter">
|
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderPointeroverForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource TabItemLineHeaderPointeroverForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^:pointerover /template/ Border#PART_SelectedPipe">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemLinePipePointeroverBorderBrush}" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^:pressed /template/ Border#PART_SelectedPipe">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style Selector="^:selected /template/ Border#PART_SelectedPipe">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemLinePipeSelectedBackground}" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!-- Selected Pressed state -->
|
|
||||||
<Style Selector="^:selected:pressed /template/ Border#PART_LayoutRoot">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPressed}" />
|
|
||||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPressed}" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<!-- Disabled state -->
|
|
||||||
<Style Selector="^:disabled /template/ Border#PART_LayoutRoot">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundDisabled}" />
|
|
||||||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundDisabled}" />
|
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme
|
||||||
|
x:Key="{x:Type TabStripItem}"
|
||||||
|
BasedOn="{StaticResource BaseTabStripItem}"
|
||||||
|
TargetType="TabStripItem">
|
||||||
|
<Setter Property="Padding" Value="8 4" />
|
||||||
|
<Setter Property="BorderThickness" Value="0 0 0 2" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
<Style Selector="^:selected /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipeSelectedBackground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:not(:selected)">
|
||||||
|
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePointeroverBorderBrush}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme
|
||||||
|
x:Key="LineTabStripItem"
|
||||||
|
BasedOn="{StaticResource BaseTabStripItem}"
|
||||||
|
TargetType="TabStripItem">
|
||||||
|
<Setter Property="Margin" Value="0 0 24 0" />
|
||||||
|
<Setter Property="Padding" Value="4 16 4 14" />
|
||||||
|
<Setter Property="BorderThickness" Value="0 0 0 2" />
|
||||||
|
<Style Selector="^:selected /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipeSelectedBackground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:not(:selected)">
|
||||||
|
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePointeroverBorderBrush}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme
|
||||||
|
x:Key="CardTabStripItem"
|
||||||
|
BasedOn="{StaticResource BaseTabStripItem}"
|
||||||
|
TargetType="TabStripItem">
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource TabControlSeparatorBorderBrush}" />
|
||||||
|
<Setter Property="Margin" Value="0 0 8 0" />
|
||||||
|
<Setter Property="MinHeight" Value="{DynamicResource TabItemCardDefaultHeight}" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="Padding" Value="12 0" />
|
||||||
|
<Setter Property="CornerRadius" Value="3 3 0 0" />
|
||||||
|
<Style Selector="^:selected">
|
||||||
|
<Setter Property="BorderThickness" Value="1 1 1 0" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:selected /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderSelectedBackground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:not(:selected)">
|
||||||
|
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderPointeroverBackground}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource TabItemCardHeaderPressedBackground}" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
|
<ControlTheme
|
||||||
|
x:Key="ButtonTabStripItem"
|
||||||
|
BasedOn="{StaticResource BaseTabStripItem}"
|
||||||
|
TargetType="TabStripItem">
|
||||||
|
<Setter Property="Margin" Value="0 0 8 0" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="MinHeight" Value="{DynamicResource TabItemCardDefaultHeight}" />
|
||||||
|
<Setter Property="Padding" Value="12 0" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource SemiBorderRadiusSmall}" />
|
||||||
|
|
||||||
|
<Style Selector="^:selected /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource TabItemButtonHeaderSelectedForeground}" />
|
||||||
|
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderSelectedBackground}" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="^:not(:selected)">
|
||||||
|
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderPointeroverBackground}" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource TabItemButtonHeaderPressedBackground}" />
|
||||||
|
</Style>
|
||||||
|
</Style>
|
||||||
|
</ControlTheme>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
5
src/Semi.Avalonia/Styles/TabStrip.axaml
Normal file
5
src/Semi.Avalonia/Styles/TabStrip.axaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<Style Selector="TabStrip TabStripItem:nth-last-child(1)">
|
||||||
|
<Setter Property="Margin" Value="0" />
|
||||||
|
</Style>
|
||||||
|
</Styles>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
<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">
|
||||||
<StyleInclude Source="avares://Semi.Avalonia/Styles/TabControl.axaml" />
|
<StyleInclude Source="avares://Semi.Avalonia/Styles/TabControl.axaml" />
|
||||||
|
<StyleInclude Source="avares://Semi.Avalonia/Styles/TabStrip.axaml" />
|
||||||
</Styles>
|
</Styles>
|
||||||
Reference in New Issue
Block a user