This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathButtons.xaml
More file actions
124 lines (119 loc) · 7.71 KB
/
Copy pathButtons.xaml
File metadata and controls
124 lines (119 loc) · 7.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ui="clr-namespace:GitHub.UI"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
<!--
Buttons in various forms
-->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Controls/Buttons/OcticonCircleButton.xaml" />
<ResourceDictionary Source="../Controls/Buttons/OcticonLinkButton.xaml" />
<ResourceDictionary Source="../Controls/Buttons/OcticonButton.xaml" />
<ResourceDictionary Source="../Controls/ToggleButtons/OcticonCircleToggleButton.xaml" />
<ResourceDictionary Source="../Controls/ToggleButtons/OcticonLinkToggleButton.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- LinkButton -->
<SolidColorBrush x:Key="GitHubLinkButtonBrush" Color="#FF999999" />
<SolidColorBrush x:Key="GitHubLinkButtonMouseOverBrush" Color="#FF666666" />
<Style x:Key="GitHubLinkButton" TargetType="{x:Type ButtonBase}">
<Setter Property="Foreground" Value="{StaticResource GitHubLinkButtonBrush}" />
<Setter Property="BorderBrush" Value="{StaticResource GitHubLinkButtonMouseOverBrush}" />
<Setter Property="FontFamily" Value="{DynamicResource GitHubFontFamilyNormal}" />
<Setter Property="FontSize" Value="14" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="ToolTipService.ShowDuration" Value="30000" />
<Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<Grid Background="Transparent" Margin="{TemplateBinding Margin}">
<ContentPresenter x:Name="Text" Grid.Column="0" Margin="{TemplateBinding Padding}" VerticalAlignment="Stretch" HorizontalAlignment="Left" RecognizesAccessKey="True" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="TextBlock.Foreground" TargetName="Text"
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="GitHubImageLinkButton" TargetType="{x:Type ButtonBase}">
<Setter Property="Foreground" Value="{DynamicResource GitHubLinkButtonBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource GitHubLinkButtonMouseOverBrush}" />
<Setter Property="FontFamily" Value="{DynamicResource GitHubFontFamilyNormal}" />
<Setter Property="FontSize" Value="14" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Padding" Value="0,0,0,2" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="ToolTipService.ShowDuration" Value="30000" />
<Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<Grid Background="Transparent" Margin="{TemplateBinding Margin}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image x:Name="Normal" Opacity="1" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center"
Source="{Binding Path=(ui:ImageButton.Image), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ButtonBase}}}" />
<Image x:Name="Hover" Grid.Column="0" Opacity="0" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center"
Source="{Binding Path=(ui:ImageButton.ImageMouseOver), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ButtonBase}}}" />
<Image x:Name="Pressed" Grid.Column="0" Opacity="0" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center"
Source="{Binding Path=(ui:ImageButton.ImagePressed), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ButtonBase}}}" />
<TextBlock x:Name="Text" Text="{TemplateBinding Content}" HorizontalAlignment="Center"
VerticalAlignment="Center" Margin="{TemplateBinding Padding}" Grid.Column="1" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" TargetName="Normal" Value="0" />
<Setter Property="Opacity" TargetName="Hover" Value="1" />
<Setter Property="Foreground" TargetName="Text"
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Opacity" TargetName="Normal" Value="0" />
<Setter Property="Opacity" TargetName="Hover" Value="0" />
<Setter Property="Opacity" TargetName="Pressed" Value="1" />
<Setter Property="Foreground" TargetName="Text"
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Foreground}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- End LinkButton -->
<!-- Tab Button -->
<Style x:Key="GitHubTabButton" TargetType="{x:Type ButtonBase}" BasedOn="{StaticResource GitHubImageLinkButton}">
<Setter Property="FontSize" Value="12" />
<Setter Property="Margin" Value="-10,-12,0,10" />
<Setter Property="Foreground" Value="{DynamicResource GHLinkButtonTextBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource GHLinkButtonTextBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ButtonBase}">
<TextBlock
x:Name="Text"
Text="{TemplateBinding Content}"
Margin="{TemplateBinding Padding}"
Padding="10"/>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" TargetName="Text" Value="{DynamicResource GHLinkButtonHoverBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Foreground" TargetName="Text" Value="{DynamicResource GHLinkButtonPressedBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="#333" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>