|
| 1 | +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 2 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | + xmlns:sharedControls="clr-namespace:Microsoft.Git.CredentialManager.UI.Controls"> |
| 4 | + |
| 5 | + <Color x:Key="AccentColor">#0078d7</Color> |
| 6 | + <Color x:Key="AccentHoverColor">#429ce3</Color> |
| 7 | + <Color x:Key="AccentActiveColor">#005a9e</Color> |
| 8 | + <Color x:Key="DisabledBackgroundColor">#cccccc</Color> |
| 9 | + <Color x:Key="DisabledForegroundColor">#7e7e7e</Color> |
| 10 | + <Color x:Key="ControlBorderColor">#666666</Color> |
| 11 | + <Color x:Key="PromptTextColor">#989898</Color> |
| 12 | + |
| 13 | + <SolidColorBrush x:Key="AccentBrush" Color="{StaticResource AccentColor}" /> |
| 14 | + <SolidColorBrush x:Key="AccentHoverBrush" Color="{StaticResource AccentHoverColor}" /> |
| 15 | + <SolidColorBrush x:Key="AccentActiveBrush" Color="{StaticResource AccentActiveColor}" /> |
| 16 | + <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="{StaticResource DisabledBackgroundColor}" /> |
| 17 | + <SolidColorBrush x:Key="DisabledForegroundBrush" Color="{StaticResource DisabledForegroundColor}" /> |
| 18 | + <SolidColorBrush x:Key="ControlBorderBrush" Color="{StaticResource ControlBorderColor}" /> |
| 19 | + |
| 20 | + <SolidColorBrush x:Key="AccentButtonDefaultBackgroundBrush" Color="{StaticResource AccentColor}" /> |
| 21 | + <SolidColorBrush x:Key="AccentButtonHoverBackgroundBrush" Color="{StaticResource AccentHoverColor}" /> |
| 22 | + <SolidColorBrush x:Key="AccentButtonPressedBackgroundBrush" Color="{StaticResource AccentActiveColor}" /> |
| 23 | + <SolidColorBrush x:Key="AccentButtonDisabledBackgroundBrush" Color="{StaticResource DisabledBackgroundColor}" /> |
| 24 | + <SolidColorBrush x:Key="AccentButtonDisabledForegroundBrush" Color="{StaticResource DisabledForegroundColor}" /> |
| 25 | + <SolidColorBrush x:Key="PromptTextBrush" Color="{StaticResource PromptTextColor}" /> |
| 26 | + |
| 27 | + <Style x:Key="PromptRoundTextBox" TargetType="sharedControls:PromptTextBox"> |
| 28 | + <Setter Property="FontSize" Value="14"/> |
| 29 | + <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}"/> |
| 30 | + <Setter Property="Padding" Value="6"/> |
| 31 | + <Setter Property="Template"> |
| 32 | + <Setter.Value> |
| 33 | + <ControlTemplate TargetType="sharedControls:PromptTextBox"> |
| 34 | + <Grid> |
| 35 | + <Border x:Name="Bd" |
| 36 | + Background="{TemplateBinding Background}" |
| 37 | + Margin="1" |
| 38 | + CornerRadius="2" |
| 39 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 40 | + BorderThickness="{TemplateBinding BorderThickness}"/> |
| 41 | + |
| 42 | + <Grid> |
| 43 | + <ScrollViewer x:Name="PART_ContentHost" |
| 44 | + Padding="{TemplateBinding Padding}" |
| 45 | + Focusable="False" |
| 46 | + HorizontalScrollBarVisibility="Hidden" |
| 47 | + VerticalScrollBarVisibility="Hidden" |
| 48 | + VerticalAlignment="Top" |
| 49 | + Margin="0"/> |
| 50 | + <Label x:Name="PromptLabel" |
| 51 | + HorizontalAlignment="Left" |
| 52 | + Foreground="{StaticResource PromptTextBrush}" |
| 53 | + FontSize="{TemplateBinding FontSize}" |
| 54 | + Padding="{TemplateBinding Padding}" |
| 55 | + Opacity="0" |
| 56 | + Target="{Binding ElementName=Bd}" |
| 57 | + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
| 58 | + Focusable="False" |
| 59 | + IsHitTestVisible="False" |
| 60 | + VerticalAlignment="Top"> |
| 61 | + <TextBlock Text="{TemplateBinding PromptText}" |
| 62 | + Margin="2,0,0,0" |
| 63 | + TextTrimming="CharacterEllipsis"/> |
| 64 | + </Label> |
| 65 | + </Grid> |
| 66 | + </Grid> |
| 67 | + |
| 68 | + <ControlTemplate.Triggers> |
| 69 | + <Trigger Property="IsEnabled" Value="False"> |
| 70 | + <Setter Property="Opacity" Value="0.5"/> |
| 71 | + </Trigger> |
| 72 | + <Trigger Property="IsKeyboardFocusWithin" Value="True"> |
| 73 | + <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource AccentBrush}"/> |
| 74 | + <Setter Property="BorderThickness" TargetName="Bd" Value="2"/> |
| 75 | + <Setter Property="Margin" TargetName="Bd" Value="0"/> |
| 76 | + </Trigger> |
| 77 | + <DataTrigger Binding="{Binding Text.Length, RelativeSource={RelativeSource Self}}" Value="0"> |
| 78 | + <Setter Property="Opacity" Value="0.7" TargetName="PromptLabel" /> |
| 79 | + <Setter Property="Foreground" Value="Transparent" /> |
| 80 | + </DataTrigger> |
| 81 | + </ControlTemplate.Triggers> |
| 82 | + </ControlTemplate> |
| 83 | + </Setter.Value> |
| 84 | + </Setter> |
| 85 | + </Style> |
| 86 | + |
| 87 | + <Style TargetType="sharedControls:PromptTextBox" BasedOn="{StaticResource PromptRoundTextBox}"/> |
| 88 | + <Style TargetType="sharedControls:PasswordPromptTextBox" BasedOn="{StaticResource PromptRoundTextBox}"/> |
| 89 | + |
| 90 | + <Style x:Key="RoundButton" TargetType="Button"> |
| 91 | + <Setter Property="FontSize" Value="14"/> |
| 92 | + <Setter Property="MinHeight" Value="23"/> |
| 93 | + <Setter Property="MinWidth" Value="46"/> |
| 94 | + <Setter Property="Template"> |
| 95 | + <Setter.Value> |
| 96 | + <ControlTemplate TargetType="Button"> |
| 97 | + <Border Background="{TemplateBinding Background}" |
| 98 | + CornerRadius="2"> |
| 99 | + <ContentPresenter Margin="10,6" |
| 100 | + HorizontalAlignment="Center" |
| 101 | + VerticalAlignment="Center" |
| 102 | + RecognizesAccessKey="True"/> |
| 103 | + </Border> |
| 104 | + </ControlTemplate> |
| 105 | + </Setter.Value> |
| 106 | + </Setter> |
| 107 | + |
| 108 | + </Style> |
| 109 | + <Style x:Key="AccentButton" TargetType="Button" BasedOn="{StaticResource RoundButton}"> |
| 110 | + <Setter Property="Foreground" Value="White"/> |
| 111 | + <Setter Property="Background" Value="{StaticResource AccentButtonDefaultBackgroundBrush}"/> |
| 112 | + <Style.Triggers> |
| 113 | + <Trigger Property="IsEnabled" Value="False"> |
| 114 | + <Setter Property="Foreground" Value="{StaticResource AccentButtonDisabledForegroundBrush}"/> |
| 115 | + <Setter Property="Background" Value="{StaticResource AccentButtonDisabledBackgroundBrush}"/> |
| 116 | + </Trigger> |
| 117 | + <Trigger Property="IsMouseOver" Value="True"> |
| 118 | + <Setter Property="Background" Value="{StaticResource AccentButtonHoverBackgroundBrush}"/> |
| 119 | + </Trigger> |
| 120 | + <Trigger Property="IsPressed" Value="True"> |
| 121 | + <Setter Property="Background" Value="{StaticResource AccentButtonPressedBackgroundBrush}"/> |
| 122 | + </Trigger> |
| 123 | + </Style.Triggers> |
| 124 | + </Style> |
| 125 | + |
| 126 | + <Style TargetType="Button" BasedOn="{StaticResource RoundButton}"/> |
| 127 | + |
| 128 | + <Style TargetType="Hyperlink"> |
| 129 | + <Setter Property="TextDecorations" Value="" /> |
| 130 | + <Setter Property="Foreground" Value="{StaticResource AccentBrush}"/> |
| 131 | + <Style.Triggers> |
| 132 | + <Trigger Property="IsMouseOver" Value="True"> |
| 133 | + <Setter Property="Foreground" Value="{StaticResource AccentHoverBrush}"/> |
| 134 | + </Trigger> |
| 135 | + <Trigger Property="IsFocused" Value="True"> |
| 136 | + <Setter Property="Foreground" Value="{StaticResource AccentActiveBrush}"/> |
| 137 | + </Trigger> |
| 138 | + <Trigger Property="IsEnabled" Value="False"> |
| 139 | + <Setter Property="Foreground" Value="{StaticResource DisabledBackgroundBrush}"/> |
| 140 | + </Trigger> |
| 141 | + </Style.Triggers> |
| 142 | + </Style> |
| 143 | +</ResourceDictionary> |
0 commit comments