@@ -13,7 +13,7 @@
|
||||
<ControlTemplate TargetType="u:NavigationMenu">
|
||||
<Border
|
||||
Name="PART_RootBorder"
|
||||
Width="260"
|
||||
Width="{DynamicResource NavigationMenuExpandWidth}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
@@ -30,12 +30,12 @@
|
||||
Background="{TemplateBinding Background}"
|
||||
RowDefinitions="Auto, *, Auto, Auto">
|
||||
<StackPanel
|
||||
Margin="12"
|
||||
Margin="{DynamicResource NavigationMenuHeaderMargin}"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<ContentPresenter
|
||||
Name="PART_IconPresenter"
|
||||
Margin="0,0,8,0"
|
||||
Margin="{DynamicResource NavigationMenuIconMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Icon}" />
|
||||
<ContentPresenter
|
||||
@@ -61,16 +61,16 @@
|
||||
Theme="{DynamicResource ButtonToggleSwitch}">
|
||||
<ToggleSwitch.OnContent>
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="M5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5C2 3.34315 3.34315 2 5 2ZM6 4C5.44772 4 5 4.44772 5 5V19C5 19.5523 5.44772 20 6 20H9C9.55229 20 10 19.5523 10 19V5C10 4.44772 9.55229 4 9 4H6Z"
|
||||
Width="{DynamicResource NavigationMenuExpandIconWidth}"
|
||||
Height="{DynamicResource NavigationMenuExpandIconHeight}"
|
||||
Data="{DynamicResource NavigationMenuExpandIconGlyph}"
|
||||
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
</ToggleSwitch.OnContent>
|
||||
<ToggleSwitch.OffContent>
|
||||
<PathIcon
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="M5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5C2 3.34315 3.34315 2 5 2ZM6 4C5.44772 4 5 4.44772 5 5V19C5 19.5523 5.44772 20 6 20H9C9.55229 20 10 19.5523 10 19V5C10 4.44772 9.55229 4 9 4H6Z"
|
||||
Width="{DynamicResource NavigationMenuExpandIconWidth}"
|
||||
Height="{DynamicResource NavigationMenuExpandIconHeight}"
|
||||
Data="{DynamicResource NavigationMenuExpandIconGlyph}"
|
||||
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
</ToggleSwitch.OffContent>
|
||||
</ToggleSwitch>
|
||||
@@ -83,7 +83,7 @@
|
||||
<Setter Property="ContentPresenter.IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Border#PART_RootBorder">
|
||||
<Setter Property="Border.Width" Value="80" />
|
||||
<Setter Property="Border.Width" Value="{DynamicResource NavigationMenuClosedWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_IconPresenter">
|
||||
<Setter Property="Grid.HorizontalAlignment" Value="Center" />
|
||||
@@ -99,10 +99,10 @@
|
||||
<StackPanel>
|
||||
<Border
|
||||
Name="PART_HeaderBorder"
|
||||
Margin="0,2"
|
||||
Padding="8"
|
||||
Margin="{DynamicResource NavigationMenuItemDefaultMargin}"
|
||||
Padding="{DynamicResource NavigationMenuItemDefaultPadding}"
|
||||
Background="{DynamicResource NavigationMenuItemDefaultBackground}"
|
||||
CornerRadius="6">
|
||||
CornerRadius="{DynamicResource NavigationMenuItemDefaultCornerRadius}">
|
||||
<Grid
|
||||
Name="PART_RootStackPanel"
|
||||
HorizontalAlignment="Stretch"
|
||||
@@ -110,7 +110,7 @@
|
||||
<ContentPresenter
|
||||
Name="PART_IconPresenter"
|
||||
Grid.Column="1"
|
||||
MinWidth="24"
|
||||
MinWidth="{DynamicResource NavigationMenuItemIconMinWidth}"
|
||||
Content="{TemplateBinding Icon}"
|
||||
ContentTemplate="{TemplateBinding IconTemplate}">
|
||||
<ContentPresenter.Margin>
|
||||
@@ -123,7 +123,7 @@
|
||||
<ContentPresenter
|
||||
Name="PART_HeaderPresenter"
|
||||
Grid.Column="2"
|
||||
Margin="12,0"
|
||||
Margin="{DynamicResource NavigationMenuItemHeaderMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Background="{TemplateBinding Background}"
|
||||
Content="{TemplateBinding Header}"
|
||||
@@ -137,9 +137,9 @@
|
||||
<PathIcon
|
||||
Name="PART_ExpandIcon"
|
||||
Grid.Column="3"
|
||||
Width="8"
|
||||
Height="8"
|
||||
Data="M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z"
|
||||
Width="{DynamicResource NavigationMenuItemExpandIconWidth}"
|
||||
Height="{DynamicResource NavigationMenuItemExpandIconHeight}"
|
||||
Data="{DynamicResource NavigationMenuItemExpandIconGlyph}"
|
||||
Foreground="{DynamicResource NavigationMenuItemExpandIconForeground}">
|
||||
<PathIcon.Transitions>
|
||||
<Transitions>
|
||||
@@ -181,18 +181,18 @@
|
||||
<ControlTemplate TargetType="u:NavigationMenuItem">
|
||||
<Border
|
||||
Name="PART_HeaderBorder"
|
||||
Margin="0,2"
|
||||
Padding="8"
|
||||
Margin="{DynamicResource NavigationMenuItemDefaultMargin}"
|
||||
Padding="{DynamicResource NavigationMenuItemDefaultPadding}"
|
||||
HorizontalAlignment="Center"
|
||||
Background="{DynamicResource NavigationMenuItemDefaultBackground}"
|
||||
CornerRadius="6"
|
||||
CornerRadius="{DynamicResource NavigationMenuItemDefaultCornerRadius}"
|
||||
ToolTip.ShowDelay="0"
|
||||
ToolTip.Tip="{TemplateBinding Header}">
|
||||
<ContentPresenter
|
||||
Name="PART_IconPresenter"
|
||||
Grid.Column="1"
|
||||
MinWidth="24"
|
||||
Margin="0"
|
||||
MinWidth="{DynamicResource NavigationMenuItemIconMinWidth}"
|
||||
Margin="{DynamicResource NavigationMenuItemIconMargin}"
|
||||
Content="{TemplateBinding Icon}"
|
||||
ContentTemplate="{TemplateBinding IconTemplate}" />
|
||||
</Border>
|
||||
@@ -212,22 +212,22 @@
|
||||
<Panel>
|
||||
<Border
|
||||
Name="PART_HeaderBorder"
|
||||
Margin="0,2"
|
||||
Padding="8"
|
||||
Margin="{DynamicResource NavigationMenuItemDefaultMargin}"
|
||||
Padding="{DynamicResource NavigationMenuItemDefaultPadding}"
|
||||
HorizontalAlignment="Center"
|
||||
Background="{DynamicResource NavigationMenuItemDefaultBackground}"
|
||||
CornerRadius="6">
|
||||
CornerRadius="{DynamicResource NavigationMenuItemDefaultCornerRadius}">
|
||||
<Grid HorizontalAlignment="Stretch" ColumnDefinitions="Auto, *, Auto">
|
||||
<ContentPresenter
|
||||
Name="PART_IconPresenter"
|
||||
Grid.Column="0"
|
||||
MinWidth="24"
|
||||
MinWidth="{DynamicResource NavigationMenuItemIconMinWidth}"
|
||||
Content="{TemplateBinding Icon}"
|
||||
ContentTemplate="{TemplateBinding IconTemplate}" />
|
||||
<ContentPresenter
|
||||
Name="PART_HeaderPresenter"
|
||||
Grid.Column="1"
|
||||
Margin="12,0"
|
||||
Margin="{DynamicResource NavigationMenuItemHeaderMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Background="{TemplateBinding Background}"
|
||||
Content="{TemplateBinding Header}"
|
||||
@@ -236,10 +236,10 @@
|
||||
Converter={x:Static BoolConverters.Not}}" />
|
||||
<PathIcon
|
||||
Grid.Column="2"
|
||||
Width="8"
|
||||
Height="8"
|
||||
Margin="12,0"
|
||||
Data="M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z"
|
||||
Width="{DynamicResource NavigationMenuItemExpandIconWidth}"
|
||||
Height="{DynamicResource NavigationMenuItemExpandIconHeight}"
|
||||
Margin="{DynamicResource NavigationMenuItemExpandIconMargin}"
|
||||
Data="{DynamicResource NavigationMenuItemExpandIconGlyph}"
|
||||
Foreground="{DynamicResource NavigationMenuItemExpandIconForeground}"
|
||||
IsVisible="{TemplateBinding IsTopLevelMenuItem,
|
||||
Converter={x:Static BoolConverters.Not}}"
|
||||
@@ -259,7 +259,7 @@
|
||||
MinHeight="{DynamicResource MenuFlyoutMinHeight}"
|
||||
MaxWidth="{DynamicResource MenuFlyoutMaxWidth}"
|
||||
MaxHeight="{DynamicResource MenuFlyoutMaxHeight}"
|
||||
Margin="8"
|
||||
Margin="{DynamicResource NavigationMenuItemFlyoutMargin}"
|
||||
Padding="{DynamicResource MenuFlyoutPadding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{DynamicResource MenuFlyoutBackground}"
|
||||
@@ -287,11 +287,11 @@
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:not(:closed):collapsed /template/ ItemsPresenter#PART_ItemsPresenter">
|
||||
<Setter Property="ItemsPresenter.Height" Value="0" />
|
||||
<Setter Property="ItemsPresenter.Opacity" Value="0" />
|
||||
<Setter Property="ItemsPresenter.Height" Value="{DynamicResource NavigationMenuItemCollapsedHeight}" />
|
||||
<Setter Property="ItemsPresenter.Opacity" Value="{DynamicResource NavigationMenuItemCollapsedOpacity}" />
|
||||
</Style>
|
||||
<Style Selector="^:not(:empty):collapsed /template/ PathIcon#PART_ExpandIcon">
|
||||
<Setter Property="PathIcon.RenderTransform" Value="rotate(180deg)" />
|
||||
<Style Selector="^:not(:empty):not(:collapsed) /template/ PathIcon#PART_ExpandIcon">
|
||||
<Setter Property="PathIcon.RenderTransform" Value="rotate(-180deg)" />
|
||||
</Style>
|
||||
<Style Selector="^:empty /template/ PathIcon#PART_ExpandIcon">
|
||||
<Setter Property="PathIcon.IsVisible" Value="False" />
|
||||
@@ -301,10 +301,10 @@
|
||||
<ControlTheme x:Key="{x:Type u:NavigationMenuSeparator}" TargetType="u:NavigationMenuSeparator">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="u:NavigationMenuSeparator">
|
||||
<StackPanel Name="PART_RootPanel" Margin="4,0">
|
||||
<StackPanel Name="PART_RootPanel" Margin="{DynamicResource NavigationMenuSeparatorMargin}">
|
||||
<ContentPresenter
|
||||
Name="PART_HeaderPresenter"
|
||||
Margin="4,0"
|
||||
Margin="{DynamicResource NavigationMenuSeparatorHeaderMargin}"
|
||||
HorizontalAlignment="Left"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
@@ -313,13 +313,13 @@
|
||||
Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||
<ContentPresenter.Styles>
|
||||
<Style Selector="TextBlock">
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource NavigationMenuSeparatorHeaderFontSize}" />
|
||||
</Style>
|
||||
</ContentPresenter.Styles>
|
||||
</ContentPresenter>
|
||||
<Rectangle
|
||||
Height="1"
|
||||
Margin="0,2"
|
||||
Height="{DynamicResource NavigationMenuSeparatorBorderHeight}"
|
||||
Margin="{DynamicResource NavigationMenuSeparatorBorderMargin}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Fill="{DynamicResource SemiColorBorder}" />
|
||||
</StackPanel>
|
||||
@@ -327,7 +327,7 @@
|
||||
</Setter>
|
||||
<Style Selector="^:closed /template/ StackPanel#PART_RootPanel">
|
||||
<Setter Property="StackPanel.HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="StackPanel.Width" Value="32" />
|
||||
<Setter Property="StackPanel.Width" Value="{DynamicResource NavigationMenuSeparatorClosedWidth}" />
|
||||
</Style>
|
||||
<Style Selector="^:closed /template/ ContentPresenter#PART_HeaderPresenter">
|
||||
<Setter Property="ContentPresenter.IsVisible" Value="False" />
|
||||
|
||||
36
src/Ursa.Themes.Semi/Themes/Shared/NavigationMenu.axaml
Normal file
36
src/Ursa.Themes.Semi/Themes/Shared/NavigationMenu.axaml
Normal file
@@ -0,0 +1,36 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=netstandard">
|
||||
<Geometry x:Key="NavigationMenuExpandIconGlyph">M5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5C2 3.34315 3.34315 2 5 2ZM6 4C5.44772 4 5 4.44772 5 5V19C5 19.5523 5.44772 20 6 20H9C9.55229 20 10 19.5523 10 19V5C10 4.44772 9.55229 4 9 4H6Z</Geometry>
|
||||
<Geometry x:Key="NavigationMenuItemExpandIconGlyph">M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z</Geometry>
|
||||
|
||||
<sys:Double x:Key="NavigationMenuExpandWidth">260</sys:Double>
|
||||
<sys:Double x:Key="NavigationMenuClosedWidth">80</sys:Double>
|
||||
<sys:Double x:Key="NavigationMenuExpandIconWidth">16</sys:Double>
|
||||
<sys:Double x:Key="NavigationMenuExpandIconHeight">16</sys:Double>
|
||||
|
||||
<sys:Double x:Key="NavigationMenuItemIconMinWidth">24</sys:Double>
|
||||
<sys:Double x:Key="NavigationMenuItemExpandIconWidth">8</sys:Double>
|
||||
<sys:Double x:Key="NavigationMenuItemExpandIconHeight">8</sys:Double>
|
||||
<sys:Double x:Key="NavigationMenuItemIconMargin">0</sys:Double>
|
||||
<sys:Double x:Key="NavigationMenuItemCollapsedHeight">0</sys:Double>
|
||||
<sys:Double x:Key="NavigationMenuItemCollapsedOpacity">0</sys:Double>
|
||||
|
||||
<sys:Double x:Key="NavigationMenuSeparatorHeaderFontSize">12</sys:Double>
|
||||
<sys:Double x:Key="NavigationMenuSeparatorBorderHeight">1</sys:Double>
|
||||
<sys:Double x:Key="NavigationMenuSeparatorClosedWidth">32</sys:Double>
|
||||
|
||||
|
||||
<Thickness x:Key="NavigationMenuHeaderMargin">12</Thickness>
|
||||
<Thickness x:Key="NavigationMenuIconMargin">0,0,8,0</Thickness>
|
||||
|
||||
<Thickness x:Key="NavigationMenuItemDefaultMargin">0,2</Thickness>
|
||||
<Thickness x:Key="NavigationMenuItemDefaultPadding">8</Thickness>
|
||||
<Thickness x:Key="NavigationMenuItemDefaultCornerRadius">6</Thickness>
|
||||
<Thickness x:Key="NavigationMenuItemHeaderMargin">12,0</Thickness>
|
||||
<Thickness x:Key="NavigationMenuItemExpandIconMargin">12,0</Thickness>
|
||||
<Thickness x:Key="NavigationMenuItemFlyoutMargin">8</Thickness>
|
||||
|
||||
<Thickness x:Key="NavigationMenuSeparatorMargin">4,0</Thickness>
|
||||
<Thickness x:Key="NavigationMenuSeparatorHeaderMargin">4,0</Thickness>
|
||||
<Thickness x:Key="NavigationMenuSeparatorBorderMargin">0,2</Thickness>
|
||||
</ResourceDictionary>
|
||||
@@ -5,6 +5,7 @@
|
||||
<MergeResourceInclude Source="Banner.axaml" />
|
||||
<MergeResourceInclude Source="Divider.axaml" />
|
||||
<MergeResourceInclude Source="IPv4Box.axaml" />
|
||||
<MergeResourceInclude Source="NavigationMenu.axaml" />
|
||||
<MergeResourceInclude Source="Pagination.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
Reference in New Issue
Block a user