feat: add separator support, fix various issues.
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
Margin="8,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource SemiColorText2}"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
DockPanel.Dock="Left"
|
||||
@@ -94,6 +95,7 @@
|
||||
Margin="8,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"
|
||||
Foreground="{DynamicResource SemiColorText2}"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
DockPanel.Dock="Top"
|
||||
@@ -112,7 +114,7 @@
|
||||
IsOpen="{Binding #button.IsChecked, Mode=TwoWay}"
|
||||
Placement="{TemplateBinding PopupPlacement}"
|
||||
PlacementTarget="{Binding #button}">
|
||||
<Border Theme="{DynamicResource CardBorder}">
|
||||
<Border Theme="{DynamicResource CardBorder}" Padding="2">
|
||||
<StackPanel Name="{x:Static u:ToolBar.PART_OverflowPanel}" />
|
||||
</Border>
|
||||
</Popup>
|
||||
@@ -130,4 +132,23 @@
|
||||
<Setter Property="IsVisible" Value="True"></Setter>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type u:ToolBarSeparator}" TargetType="u:ToolBarSeparator">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Rectangle Name="PART_Rect" Margin="4 " Fill="{DynamicResource SemiColorBorder}"></Rectangle>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Rectangle#PART_Rect">
|
||||
<Setter Property="Width" Value="1"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style Selector="^:vertical /template/ Rectangle#PART_Rect">
|
||||
<Setter Property="Height" Value="1"></Setter>
|
||||
<Setter Property="Width" Value="{x:Static x:Double.NaN}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Center"></Setter>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
||||
|
||||
26
src/Ursa.Themes.Semi/Styles/ToolBar.axaml
Normal file
26
src/Ursa.Themes.Semi/Styles/ToolBar.axaml
Normal file
@@ -0,0 +1,26 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:u="https://irihi.tech/ursa">
|
||||
<Design.PreviewWith>
|
||||
<Border Padding="20">
|
||||
<!-- Add Controls for Previewer Here -->
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
<Style Selector="u|ToolBar Button">
|
||||
<Setter Property="Theme" Value="{DynamicResource BorderlessButton}"></Setter>
|
||||
<Setter Property="FontWeight" Value="Regular" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource SemiColorText0}"></Setter>
|
||||
</Style>
|
||||
<Style Selector="u|ToolBar CheckBox">
|
||||
<Setter Property="Margin" Value="8 0" />
|
||||
</Style>
|
||||
<Style Selector="u|ToolBar ToggleButton">
|
||||
<Setter Property="FontWeight" Value="Regular" />
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource SemiColorText0}"/>
|
||||
</Style>
|
||||
<Style Selector="u|ToolBar ComboBox">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
<!-- Add Styles Here -->
|
||||
</Styles>
|
||||
@@ -5,5 +5,6 @@
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
<StyleInclude Source="ButtonGroup.axaml" />
|
||||
<StyleInclude Source="ToolBar.axaml"/>
|
||||
<!-- Add Styles Here -->
|
||||
</Styles>
|
||||
|
||||
Reference in New Issue
Block a user