|
9 | 9 | xmlns:sys="clr-namespace:System;assembly=mscorlib" |
10 | 10 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
11 | 11 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 12 | + xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0" |
12 | 13 | xmlns:ui="clr-namespace:GitHub.UI"> |
13 | 14 |
|
14 | 15 | <!-- CommonValidationToolTipTemplate --> |
|
59 | 60 | </Grid> |
60 | 61 | </ControlTemplate> |
61 | 62 |
|
62 | | - |
| 63 | + <ControlTemplate x:Key="ListViewItemControlTemplate" TargetType="{x:Type ListBoxItem}"> |
| 64 | + <Border BorderBrush="{TemplateBinding BorderBrush}" |
| 65 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 66 | + Background="{TemplateBinding Background}" |
| 67 | + SnapsToDevicePixels="True" |
| 68 | + Padding="{TemplateBinding Padding}"> |
| 69 | + <ContentPresenter Content="{TemplateBinding Content}" |
| 70 | + ContentTemplate="{TemplateBinding ContentTemplate}" |
| 71 | + ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" /> |
| 72 | + </Border> |
| 73 | + </ControlTemplate> |
| 74 | + |
63 | 75 | <Style x:Key="AutoCompleteListItemContainerStyle" TargetType="{x:Type ListBoxItem}"> |
64 | | - <Setter Property="SnapsToDevicePixels" Value="True"/> |
65 | | - <Setter Property="Padding" Value="5,0,10,0"/> |
66 | | - <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> |
67 | | - <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> |
68 | | - <Setter Property="Background" Value="{DynamicResource GHBoxBackgroundBrush}"/> |
69 | | - <Setter Property="Foreground" Value="{DynamicResource GHBoxTextBrush}"/> |
70 | | - <Setter Property="BorderBrush" Value="Transparent"/> |
71 | | - <Setter Property="BorderThickness" Value="0"/> |
72 | | - <Setter Property="FocusVisualStyle" Value="{DynamicResource NoMarginFocusVisual}"/> |
73 | | - <Setter Property="Template"> |
74 | | - <Setter.Value> |
75 | | - <ControlTemplate TargetType="{x:Type ListBoxItem}"> |
76 | | - <Border x:Name="Bd" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> |
77 | | - <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
78 | | - </Border> |
79 | | - <ControlTemplate.Triggers> |
80 | | - <MultiTrigger> |
81 | | - <MultiTrigger.Conditions> |
82 | | - <Condition Property="IsMouseOver" Value="True"/> |
83 | | - </MultiTrigger.Conditions> |
84 | | - <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource GHBoxHoverBackgroundBrush}"/> |
85 | | - </MultiTrigger> |
86 | | - <MultiTrigger> |
87 | | - <MultiTrigger.Conditions> |
88 | | - <Condition Property="Selector.IsSelectionActive" Value="False"/> |
89 | | - <Condition Property="IsSelected" Value="True"/> |
90 | | - </MultiTrigger.Conditions> |
91 | | - <Setter Property="Background" Value="{DynamicResource GHBoxSelectedBackgroundBrush}"/> |
92 | | - <Setter Property="Foreground" Value="{DynamicResource GHBoxSelectedTextBrush}"/> |
93 | | - </MultiTrigger> |
94 | | - <MultiTrigger> |
95 | | - <MultiTrigger.Conditions> |
96 | | - <Condition Property="Selector.IsSelectionActive" Value="True"/> |
97 | | - <Condition Property="IsSelected" Value="True"/> |
98 | | - </MultiTrigger.Conditions> |
99 | | - <Setter Property="Background" Value="{DynamicResource GHBoxActiveSelectionBackgroundBrush}"/> |
100 | | - <Setter Property="Foreground" Value="{DynamicResource GHBoxActiveSelectionTextBrush}"/> |
101 | | - </MultiTrigger> |
102 | | - <Trigger Property="IsEnabled" Value="False"> |
103 | | - <Setter Property="Opacity" TargetName="Bd" Value="0.3"/> |
104 | | - </Trigger> |
105 | | - </ControlTemplate.Triggers> |
106 | | - </ControlTemplate> |
107 | | - </Setter.Value> |
108 | | - </Setter> |
| 76 | + <Setter Property="BorderThickness" Value="0" /> |
| 77 | + <Setter Property="Padding" Value="5,3,3,3" /> |
| 78 | + <Setter Property="Template" Value="{StaticResource ListViewItemControlTemplate}" /> |
| 79 | + <Style.Triggers> |
| 80 | + <Trigger Property="IsMouseOver" Value="True"> |
| 81 | + <Setter Property="Background" Value="{DynamicResource {x:Static vs:ThemedDialogColors.ListItemMouseOverBrushKey}}" /> |
| 82 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static vs:ThemedDialogColors.ListItemMouseOverTextBrushKey}}" /> |
| 83 | + </Trigger> |
| 84 | + <Trigger Property="IsSelected" Value="true"> |
| 85 | + <Setter Property="Background" Value="{DynamicResource {x:Static vs:ThemedDialogColors.SelectedItemInactiveBrushKey}}" /> |
| 86 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static vs:ThemedDialogColors.SelectedItemInactiveTextBrushKey}}" /> |
| 87 | + </Trigger> |
| 88 | + <MultiTrigger> |
| 89 | + <MultiTrigger.Conditions> |
| 90 | + <Condition Property="IsSelected" Value="True" /> |
| 91 | + <Condition Property="Selector.IsSelectionActive" Value="True" /> |
| 92 | + </MultiTrigger.Conditions> |
| 93 | + <Setter Property="Background" Value="{DynamicResource {x:Static vs:ThemedDialogColors.SelectedItemActiveBrushKey}}" /> |
| 94 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static vs:ThemedDialogColors.SelectedItemActiveTextBrushKey}}" /> |
| 95 | + </MultiTrigger> |
| 96 | + <Trigger Property="IsEnabled" Value="False"> |
| 97 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static vs:ThemedDialogColors.ListItemDisabledTextBrushKey}}" /> |
| 98 | + </Trigger> |
| 99 | + </Style.Triggers> |
109 | 100 | </Style> |
110 | | - |
111 | 101 |
|
112 | 102 | <!-- input:AutoCompleteBox --> |
113 | 103 | <Style TargetType="ui:AutoCompleteBox"> |
114 | 104 | <Setter Property="IsTabStop" Value="False" /> |
115 | 105 | <Setter Property="Padding" Value="2" /> |
116 | | - <Setter Property="Background" Value="{DynamicResource DefaultBackgroundBrush}" /> |
117 | | - <Setter Property="Foreground" Value="{DynamicResource GHTextBrush}" /> |
| 106 | + <Setter Property="Background" Value="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}" /> |
| 107 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelTextBrushKey}}" /> |
118 | 108 | <Setter Property="MinWidth" Value="45" /> |
119 | 109 | <Setter Property="ItemContainerStyle" Value="{StaticResource AutoCompleteListItemContainerStyle}" /> |
120 | 110 |
|
|
125 | 115 | <ContentPresenter |
126 | 116 | x:Name="Text" |
127 | 117 | Content="{Binding InputElement.Control, RelativeSource={RelativeSource TemplatedParent}}"/> |
| 118 | + <!-- TODO: What should we use for validation BorderBrush? --> |
128 | 119 | <Border |
129 | 120 | x:Name="ValidationErrorElement" |
130 | 121 | Visibility="Collapsed" |
|
174 | 165 | x:Name="PopupBorder" |
175 | 166 | HorizontalAlignment="Stretch" |
176 | 167 | Opacity="0" |
177 | | - BorderBrush="#B0B0B0" |
| 168 | + BorderBrush="{DynamicResource {x:Static vs:CommonControlsColors.TextBoxBorderFocusedBrushKey}}" |
178 | 169 | BorderThickness="1"> |
179 | 170 | <ListBox |
180 | 171 | x:Name="Selector" |
|
0 commit comments