mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-05 09:10:50 +08:00
feat: add scroll tab control.
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>11</LangVersion>
|
||||
<Version>11.0.1</Version>
|
||||
<Version>11.0.7</Version>
|
||||
<Authors>IRIHI Technology</Authors>
|
||||
<Description>Avalonia Theme inspired by Semi Design.</Description>
|
||||
<PackageProjectUrl>https://github.com/irihitech/Semi.Avalonia</PackageProjectUrl>
|
||||
<AvaloniaVersion>11.0.0</AvaloniaVersion>
|
||||
<AvaloniaVersion>11.0.7</AvaloniaVersion>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -65,4 +65,90 @@
|
||||
</Style>
|
||||
-->
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="ScrollTabControl" TargetType="TabControl">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Background" Value="{DynamicResource TabControlBackground}" />
|
||||
<Setter Property="ItemsPanel">
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="TabControl">
|
||||
<Border
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<DockPanel>
|
||||
<Panel DockPanel.Dock="{TemplateBinding TabStripPlacement}">
|
||||
<ScrollViewer Name="PART_ScrollViewer">
|
||||
<ItemsPresenter Name="PART_ItemsPresenter" ItemsPanel="{TemplateBinding ItemsPanel}" Margin="0 0 12 12"/>
|
||||
</ScrollViewer>
|
||||
<Border Name="PART_BorderSeparator" Background="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
||||
</Panel>
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding SelectedContent}"
|
||||
ContentTemplate="{TemplateBinding SelectedContentTemplate}" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<Style Selector="^[TabStripPlacement=Left], ^[TabStripPlacement=Right]">
|
||||
<Style Selector="^ /template/ ItemsPresenter">
|
||||
<Setter Property="ItemsPanel">
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel Orientation="Vertical"></VirtualizingStackPanel>
|
||||
</ItemsPanelTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ Border#PART_BorderSeparator">
|
||||
<Setter Property="Width" Value="1" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ ScrollViewer#PART_ScrollViewer">
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Right] /template/ Border#PART_BorderSeparator">
|
||||
<Setter Property="Width" Value="1" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalAlignment" Value="Right" />
|
||||
<Setter Property="Margin" Value="0 0 12 0"></Setter>
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Right] /template/ ScrollViewer#PART_ScrollViewer">
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Top] /template/ Border#PART_BorderSeparator">
|
||||
<Setter Property="Height" Value="1" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Bottom" />
|
||||
<Setter Property="Margin" Value="0 0 0 12"></Setter>
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Top] /template/ ScrollViewer#PART_ScrollViewer">
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Disabled" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Bottom] /template/ Border#PART_BorderSeparator">
|
||||
<Setter Property="Height" Value="1" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
</Style>
|
||||
<Style Selector="^[TabStripPlacement=Bottom] /template/ ScrollViewer#PART_ScrollViewer">
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Disabled" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
|
||||
Reference in New Issue
Block a user