modified Controls - added new controls
This commit is contained in:
@@ -33,6 +33,48 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ======================= Button ======================= -->
|
||||
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource Theme.Foreground}" />
|
||||
<Setter Property="Padding" Value="12,5" />
|
||||
<Setter Property="MinHeight" Value="28" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border x:Name="Border"
|
||||
Background="{DynamicResource Theme.ControlBackground}"
|
||||
BorderBrush="{DynamicResource Theme.ControlBorder}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
SnapsToDevicePixels="True">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Border" Property="Background"
|
||||
Value="{DynamicResource Theme.ControlHoverBackground}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsKeyboardFocused" Value="True">
|
||||
<Setter TargetName="Border" Property="BorderBrush"
|
||||
Value="{DynamicResource Theme.Accent}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="Border" Property="Background"
|
||||
Value="{DynamicResource Theme.SelectionBackground}" />
|
||||
<Setter TargetName="Border" Property="BorderBrush"
|
||||
Value="{DynamicResource Theme.Accent}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value="0.5" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ======================= ComboBox ======================= -->
|
||||
|
||||
<Style x:Key="ComboBoxToggleStyle" TargetType="ToggleButton">
|
||||
@@ -107,7 +149,7 @@
|
||||
<Style TargetType="ComboBox">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource Theme.Foreground}" />
|
||||
<!-- Правый отступ оставляет место под стрелку -->
|
||||
<!-- Right padding leaves space for the arrow -->
|
||||
<Setter Property="Padding" Value="9,5,28,5" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -161,8 +203,14 @@
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="CheckBox">
|
||||
<!-- Прозрачный фон делает щелчок по подписи попаданием в галочку -->
|
||||
<StackPanel Orientation="Horizontal" Background="Transparent">
|
||||
<!-- Transparent background makes clicking on the label register as a click on the checkbox.
|
||||
The label lies in a column of limited width: long translations wrap by words
|
||||
instead of being cut off -->
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border x:Name="Box"
|
||||
Width="18" Height="18"
|
||||
CornerRadius="4"
|
||||
@@ -179,8 +227,15 @@
|
||||
StrokeStartLineCap="Round" StrokeEndLineCap="Round"
|
||||
Visibility="Collapsed" />
|
||||
</Border>
|
||||
<ContentPresenter Margin="8,0,0,0" VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
<ContentPresenter Grid.Column="1" Margin="8,0,0,0"
|
||||
VerticalAlignment="Center">
|
||||
<ContentPresenter.Resources>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
</Style>
|
||||
</ContentPresenter.Resources>
|
||||
</ContentPresenter>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Box" Property="Background"
|
||||
@@ -225,7 +280,7 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Пройденная часть шкалы: закрашивается акцентом -->
|
||||
<!-- Completed part of the scale: filled with accent color -->
|
||||
<Style x:Key="SliderDecreaseStyle" TargetType="RepeatButton">
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="Focusable" Value="False" />
|
||||
@@ -284,6 +339,65 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ======================= ProgressBar ======================= -->
|
||||
|
||||
<Style TargetType="ProgressBar">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ProgressBar">
|
||||
<Border Background="{DynamicResource Theme.SliderTrack}"
|
||||
CornerRadius="2"
|
||||
SnapsToDevicePixels="True">
|
||||
<Grid x:Name="PART_Track" ClipToBounds="True">
|
||||
<Border x:Name="PART_Indicator"
|
||||
HorizontalAlignment="Left"
|
||||
Background="{DynamicResource Theme.Accent}"
|
||||
CornerRadius="2"
|
||||
RenderTransformOrigin="0,0">
|
||||
<Border.RenderTransform>
|
||||
<ScaleTransform ScaleX="1" />
|
||||
</Border.RenderTransform>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<!-- The share downloaded is unknown: the bar fills over and over instead -->
|
||||
<Trigger Property="IsIndeterminate" Value="True">
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard x:Name="Running">
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Storyboard.TargetName="PART_Indicator"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
|
||||
From="0" To="1"
|
||||
Duration="0:0:1.2"
|
||||
RepeatBehavior="Forever" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<StopStoryboard BeginStoryboardName="Running" />
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ======================= Hyperlink ======================= -->
|
||||
|
||||
<!-- The underline is left for the pointer: a line under every link is noise -->
|
||||
<Style TargetType="Hyperlink">
|
||||
<Setter Property="Foreground" Value="{DynamicResource Theme.Accent}" />
|
||||
<Setter Property="TextDecorations" Value="{x:Null}" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="TextDecorations" Value="Underline" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- ======================= ScrollBar ======================= -->
|
||||
|
||||
<Style x:Key="ScrollBarThumbStyle" TargetType="Thumb">
|
||||
@@ -323,7 +437,7 @@
|
||||
</Track>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<!-- У горизонтальной полосы направление трека обычное -->
|
||||
<!-- For the horizontal bar, the track direction is normal -->
|
||||
<Trigger Property="Orientation" Value="Horizontal">
|
||||
<Setter TargetName="PART_Track" Property="IsDirectionReversed" Value="False" />
|
||||
</Trigger>
|
||||
@@ -341,4 +455,26 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- ======================= ToolTip ======================= -->
|
||||
|
||||
<Style TargetType="ToolTip">
|
||||
<Setter Property="Foreground" Value="{DynamicResource Theme.Foreground}" />
|
||||
<Setter Property="MaxWidth" Value="360" />
|
||||
<Setter Property="HasDropShadow" Value="False" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToolTip">
|
||||
<Border Background="{DynamicResource Theme.PopupBackground}"
|
||||
BorderBrush="{DynamicResource Theme.ControlBorder}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4"
|
||||
Padding="10,6"
|
||||
SnapsToDevicePixels="True">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
Reference in New Issue
Block a user