-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #992 from kenjiuno/fix-new-checkbox
Apply an alternative CheckBox default style to ModsManager Closes
- Loading branch information
Showing
3 changed files
with
131 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
<Style TargetType="{x:Type CheckBox}"> | ||
<Setter Property="SnapsToDevicePixels" | ||
Value="true" /> | ||
<Setter Property="OverridesDefaultStyle" | ||
Value="true" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type CheckBox}"> | ||
<BulletDecorator Background="Transparent"> | ||
<BulletDecorator.Bullet> | ||
<Border x:Name="Border" | ||
Width="13" | ||
Height="13" | ||
BorderBrush="{TemplateBinding Foreground}" | ||
CornerRadius="0" | ||
BorderThickness="1"> | ||
<Grid> | ||
<Path Visibility="Collapsed" | ||
Width="7" | ||
Height="7" | ||
x:Name="CheckMark" | ||
SnapsToDevicePixels="False" | ||
StrokeThickness="2" | ||
Stroke="{TemplateBinding Foreground}" | ||
Data="M 0 0 L 7 7 M 0 7 L 7 0"> | ||
</Path> | ||
<Path Visibility="Collapsed" | ||
Width="7" | ||
Height="7" | ||
x:Name="InderminateMark" | ||
SnapsToDevicePixels="False" | ||
StrokeThickness="2" | ||
Stroke="{TemplateBinding Foreground}" | ||
Data="M 0 7 L 7 0"> | ||
</Path> | ||
</Grid> | ||
</Border> | ||
</BulletDecorator.Bullet> | ||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup x:Name="CommonStates"> | ||
<VisualState x:Name="Normal" /> | ||
<VisualState x:Name="MouseOver"> | ||
<Storyboard> | ||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Border" | ||
Storyboard.TargetProperty="Opacity"> | ||
<EasingDoubleKeyFrame KeyTime="0" | ||
Value="0.7" /> | ||
</DoubleAnimationUsingKeyFrames> | ||
</Storyboard> | ||
</VisualState> | ||
<VisualState x:Name="Pressed"> | ||
<Storyboard> | ||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Border" | ||
Storyboard.TargetProperty="Opacity"> | ||
<EasingDoubleKeyFrame KeyTime="0" | ||
Value="0.6" /> | ||
</DoubleAnimationUsingKeyFrames> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background)" | ||
Storyboard.TargetName="Border"> | ||
<DiscreteObjectKeyFrame KeyTime="0"> | ||
<DiscreteObjectKeyFrame.Value> | ||
<SolidColorBrush Color="LightGray" /> | ||
</DiscreteObjectKeyFrame.Value> | ||
</DiscreteObjectKeyFrame> | ||
</ObjectAnimationUsingKeyFrames> | ||
</Storyboard> | ||
</VisualState> | ||
<VisualState x:Name="Disabled"> | ||
<Storyboard> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background)" | ||
Storyboard.TargetName="Border"> | ||
<DiscreteObjectKeyFrame KeyTime="0"> | ||
<DiscreteObjectKeyFrame.Value> | ||
<SolidColorBrush Color="LightGray" /> | ||
</DiscreteObjectKeyFrame.Value> | ||
</DiscreteObjectKeyFrame> | ||
</ObjectAnimationUsingKeyFrames> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Path.Stroke)" | ||
Storyboard.TargetName="CheckMark"> | ||
<DiscreteObjectKeyFrame KeyTime="0"> | ||
<DiscreteObjectKeyFrame.Value> | ||
<SolidColorBrush Color="Black" /> | ||
</DiscreteObjectKeyFrame.Value> | ||
</DiscreteObjectKeyFrame> | ||
</ObjectAnimationUsingKeyFrames> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Path.Stroke)" | ||
Storyboard.TargetName="InderminateMark"> | ||
<DiscreteObjectKeyFrame KeyTime="0"> | ||
<DiscreteObjectKeyFrame.Value> | ||
<SolidColorBrush Color="Black" /> | ||
</DiscreteObjectKeyFrame.Value> | ||
</DiscreteObjectKeyFrame> | ||
</ObjectAnimationUsingKeyFrames> | ||
</Storyboard> | ||
</VisualState> | ||
</VisualStateGroup> | ||
<VisualStateGroup x:Name="CheckStates"> | ||
<VisualState x:Name="Checked"> | ||
<Storyboard> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" | ||
Storyboard.TargetName="CheckMark"> | ||
<DiscreteObjectKeyFrame KeyTime="0" | ||
Value="{x:Static Visibility.Visible}" /> | ||
</ObjectAnimationUsingKeyFrames> | ||
</Storyboard> | ||
</VisualState> | ||
<VisualState x:Name="Unchecked" /> | ||
<VisualState x:Name="Indeterminate"> | ||
<Storyboard> | ||
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" | ||
Storyboard.TargetName="InderminateMark"> | ||
<DiscreteObjectKeyFrame KeyTime="0" | ||
Value="{x:Static Visibility.Visible}" /> | ||
</ObjectAnimationUsingKeyFrames> | ||
</Storyboard> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
<ContentPresenter Margin="4,0,0,0" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Left" | ||
RecognizesAccessKey="True" /> | ||
</BulletDecorator> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters