重命名

This commit is contained in:
GG Z
2026-01-02 17:30:30 +08:00
parent 0e9db9a2b9
commit fa0d280130
245 changed files with 4405 additions and 4236 deletions

View File

@@ -0,0 +1,302 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:assists="clr-namespace:VariaStudio.Assists"
xmlns:controls="clr-namespace:VariaStudio.Controls"
xmlns:decorations="clr-namespace:VariaStudio.Controls.Decorations"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/VariaStudio;component/Controls/Button.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type controls:NumberBox}" x:Key="SlotNumberBoxStyle">
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Padding" Value="2" />
<Setter Property="Focusable" Value="False" />
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:NumberBox}">
<decorations:SlotBorder
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Intensity="0.2"
Padding="{TemplateBinding Padding}"
x:Name="slot">
<Grid>
<Grid.ColumnDefinitions>
<!-- 前缀 -->
<ColumnDefinition Width="Auto" />
<!-- 输入框 -->
<ColumnDefinition Width="*" />
<!-- 后缀 -->
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter
Content="{TemplateBinding assists:InputAssist.Prefix}"
Focusable="False"
Grid.Column="0"
Margin="1,0,5,0"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="Prefix" />
<TextBox
Background="Transparent"
Grid.Column="1"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
Padding="0"
Style="{DynamicResource FlattenTextBoxStyle}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="PART_TextBox">
<!--<TextBox.Text>
<MultiBinding Converter="{StaticResource PrecisionConverter}" UpdateSourceTrigger="PropertyChanged">
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Precision" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</TextBox.Text>-->
</TextBox>
<!-- Suffix -->
<ContentPresenter
Content="{TemplateBinding assists:InputAssist.Suffix}"
Focusable="False"
Grid.Column="2"
Margin="5,0,1,0"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="Suffix" />
<Border
Background="Transparent"
BorderBrush="{DynamicResource BorderNormalBrush}"
BorderThickness="1,0,0,0"
Grid.Column="3"
HorizontalAlignment="Right"
Margin="-2"
x:Name="border">
<Grid Width="15">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="1" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button
FontSize="4"
Grid.Row="0"
IsTabStop="False"
Padding="-3"
Style="{DynamicResource FlattenButtonStyle}"
assists:ControlAssist.CornerRadius="0,4,0,0"
x:Name="PART_IncreaseButton">
<controls:IconElement
Foreground="{DynamicResource TextPrimaryBrush}"
RenderTransformOrigin="0.5,0.5"
SnapsToDevicePixels="false"
Symbol="KeyboardArrowUp"
x:Name="arrowUp">
<controls:IconElement.RenderTransform>
<RotateTransform Angle="0" />
</controls:IconElement.RenderTransform>
</controls:IconElement>
</Button>
<Rectangle
Fill="{DynamicResource BorderNormalBrush}"
Grid.Row="1"
Height="1" />
<Button
FontSize="4"
Grid.Row="2"
IsTabStop="False"
Padding="-3"
Style="{DynamicResource FlattenButtonStyle}"
assists:ControlAssist.CornerRadius="0,0,4,0"
x:Name="PART_DecreaseButton">
<controls:IconElement
Foreground="{DynamicResource TextPrimaryBrush}"
RenderTransformOrigin="0.5,0.5"
SnapsToDevicePixels="false"
Symbol="KeyboardArrowDown"
x:Name="arrowDown">
<controls:IconElement.RenderTransform>
<RotateTransform Angle="0" />
</controls:IconElement.RenderTransform>
</controls:IconElement>
</Button>
</Grid>
</Border>
</Grid>
</decorations:SlotBorder>
<ControlTemplate.Triggers>
<!-- Prefix & Suffix -->
<Trigger Property="Content" SourceName="Prefix" Value="{x:Null}">
<Setter Property="Visibility" TargetName="Prefix" Value="Collapsed" />
</Trigger>
<Trigger Property="Content" SourceName="Suffix" Value="{x:Null}">
<Setter Property="Visibility" TargetName="Suffix" Value="Collapsed" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource BorderCornerLightedGradientBrush}" />
<!--<Setter TargetName="border" Property="Visibility" Value="Visible"/>-->
</Trigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryFocusedBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
<Setter Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
<Setter Property="ShaderEnabled" TargetName="slot" Value="False" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type controls:NumberBox}">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Focusable" Value="False" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:NumberBox}">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}"
Padding="{TemplateBinding Padding}"
x:Name="Border">
<Grid>
<Grid.ColumnDefinitions>
<!-- 前缀 -->
<ColumnDefinition Width="Auto" />
<!-- 输入框 -->
<ColumnDefinition Width="*" />
<!-- 后缀 -->
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter
Content="{TemplateBinding assists:InputAssist.Prefix}"
Focusable="False"
Grid.Column="0"
Margin="1,0,5,0"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="Prefix" />
<TextBox
Background="Transparent"
Grid.Column="1"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
Padding="0"
Style="{DynamicResource FlattenTextBoxStyle}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="PART_TextBox">
<!--<TextBox.Text>
<MultiBinding Converter="{StaticResource PrecisionConverter}" UpdateSourceTrigger="PropertyChanged">
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Path="Precision" RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</TextBox.Text>-->
</TextBox>
<ContentPresenter
Content="{TemplateBinding assists:InputAssist.Suffix}"
Focusable="False"
Grid.Column="2"
Margin="5,0,1,0"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="Suffix" />
<Border
BorderBrush="{DynamicResource BorderNormalBrush}"
Grid.Column="3"
HorizontalAlignment="Right"
Margin="-2"
x:Name="border">
<Grid Margin="2" Width="15">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button
Background="{DynamicResource BackgroundFloatingBrush}"
FontSize="4"
Grid.Row="0"
IsTabStop="False"
Padding="-4"
Style="{DynamicResource FlattenButtonStyle}"
Visibility="Collapsed"
assists:ControlAssist.CornerRadius="2,2,0,0"
x:Name="PART_IncreaseButton">
<controls:IconElement
Foreground="{DynamicResource TextPrimaryBrush}"
RenderTransformOrigin="0.5,0.5"
SnapsToDevicePixels="false"
Symbol="KeyboardArrowUp"
x:Name="arrowUp">
<controls:IconElement.RenderTransform>
<RotateTransform Angle="0" />
</controls:IconElement.RenderTransform>
</controls:IconElement>
</Button>
<Button
Background="{DynamicResource BackgroundFloatingBrush}"
FontSize="4"
Grid.Row="1"
IsTabStop="False"
Padding="-4"
Style="{DynamicResource FlattenButtonStyle}"
Visibility="Collapsed"
assists:ControlAssist.CornerRadius="0,0,2,2"
x:Name="PART_DecreaseButton">
<controls:IconElement
Foreground="{DynamicResource TextPrimaryBrush}"
RenderTransformOrigin="0.5,0.5"
SnapsToDevicePixels="false"
Symbol="KeyboardArrowDown"
x:Name="arrowDown">
<controls:IconElement.RenderTransform>
<RotateTransform Angle="0" />
</controls:IconElement.RenderTransform>
</controls:IconElement>
</Button>
</Grid>
</Border>
</Grid>
</Border>
<ControlTemplate.Triggers>
<!-- Prefix & Suffix -->
<Trigger Property="Content" SourceName="Prefix" Value="{x:Null}">
<Setter Property="Visibility" TargetName="Prefix" Value="Collapsed" />
</Trigger>
<Trigger Property="Content" SourceName="Suffix" Value="{x:Null}">
<Setter Property="Visibility" TargetName="Suffix" Value="Collapsed" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ControlBackgroundHoverBrush}" />
<Setter Property="Visibility" TargetName="PART_IncreaseButton" Value="Visible" />
<Setter Property="Visibility" TargetName="PART_DecreaseButton" Value="Visible" />
</Trigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryNormalBrush}" />
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryNormalBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
<Setter Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
<Setter Property="Cursor" Value="None" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>