parent
f14aac14a9
commit
4757fd5b68
@ -0,0 +1,9 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/STranslate;component/Style/Dark/DictionaryButtonDark.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/STranslate;component/Style/Dark/DictionaryComboBoxDark.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/STranslate;component/Style/Dark/DictionaryCommonDark.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
@ -0,0 +1,71 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ControlTemplate x:Key="ButtonTemplate" TargetType="Button">
|
||||
<Border x:Name="border"
|
||||
CornerRadius="5"
|
||||
Padding="4"
|
||||
MaxHeight="25">
|
||||
<Image Source="pack://application:,,,/STranslate;component/Images/Button_Default/copy_default.png"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="#47484c"></Setter>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="#35333c"></Setter>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="ButtonTemplateSnakeCopy" TargetType="Button">
|
||||
<Border x:Name="border"
|
||||
CornerRadius="5"
|
||||
Padding="4"
|
||||
MaxHeight="25">
|
||||
<Image Source="pack://application:,,,/STranslate;component/Images/Button_Default/copy_snake.png"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="#47484c"></Setter>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="#35333c"></Setter>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="ButtonTemplateSmallHumpCopy" TargetType="Button">
|
||||
<Border x:Name="border"
|
||||
CornerRadius="5"
|
||||
Padding="4"
|
||||
MaxHeight="25">
|
||||
<Image Source="pack://application:,,,/STranslate;component/Images/Button_Default/copy_small_hump.png"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="#47484c"></Setter>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="#35333c"></Setter>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="ButtonTemplateLargeHumpCopy" TargetType="Button">
|
||||
<Border x:Name="border"
|
||||
CornerRadius="5"
|
||||
Padding="4"
|
||||
MaxHeight="25">
|
||||
<Image Source="pack://application:,,,/STranslate;component/Images/Button_Default/copy_large_hump.png"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="#47484c"></Setter>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter TargetName="border" Property="Background" Value="#35333c"></Setter>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</ResourceDictionary>
|
@ -0,0 +1,176 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<!--引入字体文件-->
|
||||
<Style x:Key="IconStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontFamily" Value="/STranslate;component/Images/#iconfont"/>
|
||||
</Style>
|
||||
|
||||
<!--Combox-->
|
||||
<Style TargetType="{x:Type ComboBox}" x:Key="cmbstyle">
|
||||
<Setter Property="Background" Value="#282c34"/>
|
||||
<Setter Property="Foreground" Value="WhiteSmoke"/>
|
||||
<Setter Property="ItemContainerStyle">
|
||||
<Setter.Value>
|
||||
<!--ComBoxItem-->
|
||||
<Style TargetType="ComboBoxItem">
|
||||
<Setter Property="MinHeight" Value="22"/>
|
||||
<Setter Property="MinWidth" Value="40"/>
|
||||
<Setter Property="Foreground" Value="WhiteSmoke"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBoxItem">
|
||||
<Border Name="Back"
|
||||
CornerRadius="2"
|
||||
Background="Transparent"
|
||||
BorderThickness="0">
|
||||
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0"></ContentPresenter>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Back" Property="Background" Value="#47484c"></Setter>
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter TargetName="Back" Property="Background" Value="#47484c"></Setter>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ComboBox}">
|
||||
<Border BorderThickness="0" CornerRadius="5" Width="80" Height="30" Background="{TemplateBinding Background}" >
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Column="0" x:Name="grid">
|
||||
<ToggleButton
|
||||
Width="{Binding ElementName=grid,Path=ActualWidth}"
|
||||
Height="{Binding ElementName=grid, Path=ActualHeight}"
|
||||
Content="{TemplateBinding Text}" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left" Margin="5,0,0,0"
|
||||
BorderThickness="0"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Background="{TemplateBinding Background}"
|
||||
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press">
|
||||
<ToggleButton.Style >
|
||||
<Style TargetType="ToggleButton">
|
||||
<Setter Property="Background" Value="#282c34"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Border Background="{TemplateBinding Background}" BorderThickness="0" >
|
||||
<TextBlock Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" Margin="4 0 0 0" HorizontalAlignment="Left" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="White"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="False">
|
||||
<Setter Property="Background" Value="White"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</ToggleButton.Style>
|
||||
</ToggleButton>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="1" >
|
||||
<ToggleButton IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
ClickMode="Press">
|
||||
<ToggleButton.Style>
|
||||
<Style TargetType="ToggleButton">
|
||||
<Setter Property="Background" Value="#282c34"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<Grid>
|
||||
<TextBlock Foreground="{TemplateBinding Foreground}" x:Name="arrow_tb" Text="" Style="{StaticResource IconStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
||||
<TextBlock.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform/>
|
||||
<SkewTransform/>
|
||||
<RotateTransform/>
|
||||
<TranslateTransform/>
|
||||
</TransformGroup>
|
||||
</TextBlock.RenderTransform>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
|
||||
</Trigger>
|
||||
<EventTrigger RoutedEvent="Checked">
|
||||
<BeginStoryboard>
|
||||
<Storyboard >
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="180"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
|
||||
<EventTrigger RoutedEvent="Unchecked">
|
||||
<BeginStoryboard>
|
||||
<Storyboard >
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="180"/>
|
||||
<EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ToggleButton.Style>
|
||||
</ToggleButton>
|
||||
</Grid>
|
||||
<Popup IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
Placement="Bottom" x:Name="Popup"
|
||||
Focusable="False"
|
||||
AllowsTransparency="True"
|
||||
PopupAnimation="Slide">
|
||||
<Border x:Name="DropDown"
|
||||
CornerRadius="5"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
||||
MinWidth="{TemplateBinding ActualWidth}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Color="Black" BlurRadius="2" ShadowDepth="0" Opacity="0.5"/>
|
||||
</Border.Effect>
|
||||
<ScrollViewer Margin="4,6,4,6" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" CanContentScroll="True">
|
||||
<!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
|
||||
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="#282c34"/>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
|
||||
|
||||
<Border.Effect>
|
||||
<DropShadowEffect ShadowDepth="-1" Opacity="0.3" Color="#FF969696" BlurRadius="2"/>
|
||||
</Border.Effect>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
|
||||
</Style>
|
||||
</ResourceDictionary>
|
@ -0,0 +1,68 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:model="clr-namespace:STranslate.Model"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<model:VisibilityConverter x:Key="String2VisibilityConverter"/>
|
||||
<Style x:Key="BorderMainStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="Background" Value="#2e323a"/>
|
||||
<Setter Property="BorderBrush" Value="Gray"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="10"/>
|
||||
</Style>
|
||||
<Style x:Key="BorderInOutputStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="Background" Value="#282c34"/>
|
||||
<Setter Property="BorderBrush" Value="{x:Null}"/>
|
||||
<Setter Property="CornerRadius" Value="4"/>
|
||||
<Setter Property="Margin" Value="5"/>
|
||||
</Style>
|
||||
<Style x:Key="TextBoxInputStyle"
|
||||
TargetType="TextBox">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="WhiteSmoke"/>
|
||||
<Setter Property="BorderBrush" Value="{x:Null}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="MinHeight" Value="70"/>
|
||||
<Setter Property="MaxHeight" Value="200"/>
|
||||
<Setter Property="AcceptsReturn" Value="True"/>
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/>
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Hidden"/>
|
||||
</Style>
|
||||
<Style x:Key="LanguageMarkBorderStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="Background" Value="#999999"/>
|
||||
<Setter Property="Margin" Value="10,0,0,2"/>
|
||||
<Setter Property="CornerRadius" Value="8"/>
|
||||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||||
</Style>
|
||||
<Style x:Key="LanguageMarkTextBlockStyle"
|
||||
TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#eaeaea"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TextBoxOutputStyle"
|
||||
TargetType="TextBox">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Foreground" Value="WhiteSmoke"/>
|
||||
<Setter Property="BorderBrush" Value="{x:Null}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="IsReadOnly" Value="True"/>
|
||||
<Setter Property="Margin" Value="10,10,5,35"/>
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="MaxHeight" Value="400"/>
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/>
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Hidden"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MidStyle"
|
||||
TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground" Value="WhiteSmoke"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
@ -0,0 +1,9 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/STranslate;component/Style/Default/DictionaryButtonDefault.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/STranslate;component/Style/Default/DictionaryComboBoxDefault.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/STranslate;component/Style/Default/DictionaryCommonDefault.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
@ -0,0 +1,64 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:model="clr-namespace:STranslate.Model"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<model:VisibilityConverter x:Key="String2VisibilityConverter"/>
|
||||
<Style x:Key="BorderMainStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="Background" Value="#ffffff"/>
|
||||
<Setter Property="BorderBrush" Value="#acacac"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="10"/>
|
||||
</Style>
|
||||
<Style x:Key="BorderInOutputStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="Background" Value="#f6f6f6"/>
|
||||
<Setter Property="BorderBrush" Value="{x:Null}"/>
|
||||
<Setter Property="CornerRadius" Value="4"/>
|
||||
<Setter Property="Margin" Value="5"/>
|
||||
</Style>
|
||||
<Style x:Key="TextBoxInputStyle"
|
||||
TargetType="TextBox">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="{x:Null}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="MinHeight" Value="70"/>
|
||||
<Setter Property="MaxHeight" Value="200"/>
|
||||
<Setter Property="AcceptsReturn" Value="True"/>
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/>
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Hidden"/>
|
||||
</Style>
|
||||
<Style x:Key="LanguageMarkBorderStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="Background" Value="#eaeaea"/>
|
||||
<Setter Property="Margin" Value="10,0,0,2"/>
|
||||
<Setter Property="CornerRadius" Value="8"/>
|
||||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||||
</Style>
|
||||
<Style x:Key="LanguageMarkTextBlockStyle"
|
||||
TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#999999"/>
|
||||
</Style>
|
||||
<Style x:Key="TextBoxOutputStyle"
|
||||
TargetType="TextBox">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="{x:Null}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="IsReadOnly" Value="True"/>
|
||||
<Setter Property="Margin" Value="10,10,5,35"/>
|
||||
<Setter Property="FontSize" Value="16"/>
|
||||
<Setter Property="MaxHeight" Value="400"/>
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/>
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Hidden"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MidStyle"
|
||||
TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
Loading…
Reference in new issue