|
6 | 6 | <FontFamily x:Key="LatoFontFamily">/InvvardDev.EZLayoutDisplay.Desktop;component/Skins/Fonts/#Lato</FontFamily> |
7 | 7 | <FontFamily x:Key="OryxFontFamily">/InvvardDev.EZLayoutDisplay.Desktop;component/Skins/Fonts/#Oryx</FontFamily> |
8 | 8 |
|
| 9 | + <SolidColorBrush x:Key="KeyLabelForeground" Color="#323546" /> |
9 | 10 | <SolidColorBrush x:Key="DefaultBackgroundBrush" Color="#FFFFFF" /> |
10 | 11 | <SolidColorBrush x:Key="ColorControlBackgroundBrush" Color="#FFF1BA" /> |
11 | 12 | <SolidColorBrush x:Key="CustomLabelBackgroundBrush" Color="#FFBFA3" /> |
12 | 13 | <SolidColorBrush x:Key="DualFunctionBackgroundBrush" Color="#E1EBFF" /> |
13 | 14 | <SolidColorBrush x:Key="MacroBackgroundBrush" Color="#E0DBFF" /> |
14 | 15 | <SolidColorBrush x:Key="ModifierBackgroundBrush" Color="#EBFFE1" /> |
15 | 16 |
|
16 | | - <SolidColorBrush x:Key="TopDefaultBackgroundBrush" Color="#fcfcfc" /> |
17 | | - <SolidColorBrush x:Key="TopDualFunctionBackgroundBrush" Color="#e1ebff" /> |
18 | | - <SolidColorBrush x:Key="TopModifierBackgroundBrush" Color="#ebffe1" /> |
19 | | - |
20 | 17 | <converter:KeyCategoryToBrushConverter x:Key="KeyCategoryToBrushConverter" |
21 | 18 | DefaultBackgroundBrush="{StaticResource DefaultBackgroundBrush}" |
22 | 19 | ColorControlBackgroundBrush="{StaticResource ColorControlBackgroundBrush}" |
23 | 20 | CustomLabelBackgroundBrush="{StaticResource CustomLabelBackgroundBrush}" |
24 | 21 | DualFunctionBackgroundBrush="{StaticResource DualFunctionBackgroundBrush}" |
25 | 22 | MacroBackgroundBrush="{StaticResource MacroBackgroundBrush}" |
26 | 23 | ModifierBackgroundBrush="{StaticResource ModifierBackgroundBrush}"/> |
27 | | - |
28 | | - <converter:KeyCategoryToBrushConverter x:Key="KeyCategoryToTopBrushConverter" |
29 | | - DefaultBackgroundBrush="{StaticResource TopDefaultBackgroundBrush}" |
30 | | - DualFunctionBackgroundBrush="{StaticResource TopDualFunctionBackgroundBrush}" |
31 | | - ModifierBackgroundBrush="{StaticResource TopModifierBackgroundBrush}" /> |
32 | 24 |
|
33 | | - <SolidColorBrush x:Key="KeyBaseBorderColorBrush" Color="#c7c7c7" /> |
34 | | - <SolidColorBrush x:Key="KeyTopBorderColorBrush" Color="#1affffff" /> |
| 25 | + <SolidColorBrush x:Key="KeyBorderColorBrush" Color="#c7c7c7" /> |
35 | 26 |
|
36 | 27 | <Style TargetType="Rectangle" x:Key="BaseKey"> |
37 | 28 | <Setter Property="StrokeThickness" Value="1" /> |
|
48 | 39 | <Style TargetType="Rectangle" BasedOn="{StaticResource BaseKey}" x:Key="KeyBase"> |
49 | 40 | <Setter Property="RadiusX" Value="5" /> |
50 | 41 | <Setter Property="RadiusY" Value="5" /> |
51 | | - <Setter Property="Fill" Value="{Binding Key.KeyCategory, Converter={StaticResource KeyCategoryToBrushConverter}}" /> |
52 | | - <Setter Property="Stroke" Value="{StaticResource KeyBaseBorderColorBrush}" /> |
| 42 | + <Setter Property="Fill" Value="{Binding Key.DisplayMode, Converter={StaticResource KeyCategoryToBrushConverter}}" /> |
| 43 | + <Setter Property="Stroke" Value="{StaticResource KeyBorderColorBrush}" /> |
53 | 44 | <Setter Property="Canvas.Top" Value="{Binding BaseKeyY}" /> |
54 | 45 | <Setter Property="Canvas.Left" Value="{Binding BaseKeyX}" /> |
55 | 46 | <Setter Property="Height" Value="{Binding BaseKeyHeight}" /> |
56 | 47 | <Setter Property="Width" Value="{Binding BaseKeyWidth}" /> |
57 | 48 | </Style> |
58 | 49 |
|
59 | | - <Style TargetType="Rectangle" BasedOn="{StaticResource BaseKey}" x:Key="KeyTop"> |
60 | | - <Setter Property="RadiusX" Value="3" /> |
61 | | - <Setter Property="RadiusY" Value="3" /> |
62 | | - <Setter Property="Fill" Value="{Binding EZKey.KeyCategory, Converter={StaticResource KeyCategoryToTopBrushConverter}}" /> |
63 | | - <Setter Property="Stroke" Value="{StaticResource KeyTopBorderColorBrush}" /> |
64 | | - <Setter Property="Canvas.Top" Value="{Binding TopKeyY}" /> |
65 | | - <Setter Property="Canvas.Left" Value="{Binding TopKeyX}" /> |
66 | | - <Setter Property="Height" Value="{Binding TopKeyHeight}" /> |
67 | | - <Setter Property="Width" Value="{Binding TopKeyWidth}" /> |
| 50 | + <Style TargetType="Label" x:Key="BaseLabelStyle"> |
| 51 | + <Setter Property="Padding" Value="2 0" /> |
| 52 | + <Setter Property="Foreground" Value="{StaticResource KeyLabelForeground}" /> |
| 53 | + </Style> |
| 54 | + |
| 55 | + <Style TargetType="Label" x:Key="LabelStyle" BasedOn="{StaticResource BaseLabelStyle}"> |
| 56 | + <Setter Property="FontFamily" Value="{StaticResource LatoFontFamily}" /> |
| 57 | + <Setter Property="FontSize" Value="22" /> |
68 | 58 | </Style> |
69 | 59 |
|
70 | | - <Style TargetType="Label" x:Key="LabelStyle"> |
71 | | - <Style.Triggers> |
72 | | - <DataTrigger Binding="{Binding EZKey.Primary.Content.IsGlyph}" Value="true"> |
73 | | - <Setter Property="FontFamily" Value="{StaticResource OryxFontFamily}" /> |
74 | | - <Setter Property="FontSize" Value="18" /> |
75 | | - <Setter Property="Foreground" Value="{Binding EZKey.Color}" /> |
76 | | - </DataTrigger> |
77 | | - <DataTrigger Binding="{Binding EZKey.Primary.Content.IsGlyph}" Value="false"> |
78 | | - <Setter Property="FontFamily" Value="{StaticResource LatoFontFamily}" /> |
79 | | - <Setter Property="FontSize" Value="22" /> |
80 | | - <Setter Property="FontWeight" Value="Bold" /> |
81 | | - <Setter Property="Foreground" Value="{Binding EZKey.Color}" /> |
82 | | - </DataTrigger> |
83 | | - </Style.Triggers> |
| 60 | + <Style TargetType="Label" x:Key="GlyphStyle" BasedOn="{StaticResource BaseLabelStyle}"> |
| 61 | + <Setter Property="FontFamily" Value="{StaticResource OryxFontFamily}" /> |
| 62 | + <Setter Property="FontSize" Value="18" /> |
84 | 63 | </Style> |
85 | 64 |
|
86 | | - <DataTemplate x:Key="KeyBaseDataTemplate"> |
| 65 | + <DataTemplate x:Key="KeyDataTemplate"> |
87 | 66 | <Canvas> |
88 | | - <Rectangle x:Name="KeyBaseRect" Style="{DynamicResource KeyBase}" /> |
89 | | - <Rectangle x:Name="KeyTopRect" Style="{DynamicResource KeyTop}" /> |
| 67 | + <Rectangle x:Name="KeyRect" Style="{DynamicResource KeyBase}" /> |
90 | 68 | </Canvas> |
91 | 69 | </DataTemplate> |
92 | 70 |
|
93 | | - <Style TargetType="TextBlock" x:Key="PrimaryTag"> |
| 71 | + <Style TargetType="TextBlock" x:Key="BaseTag"> |
94 | 72 | <Setter Property="FontSize" Value="10" /> |
95 | | - <Setter Property="HorizontalAlignment" Value="Right" /> |
| 73 | + <Setter Property="Foreground" Value="{StaticResource KeyLabelForeground}" /> |
96 | 74 | <Setter Property="Margin" Value="0 -2 2 0" /> |
| 75 | + <Setter Property="Canvas.Right" Value="0" /> |
97 | 76 | </Style> |
98 | 77 |
|
99 | | - <Style TargetType="TextBlock" x:Key="SecondaryTag"> |
100 | | - <Setter Property="FontSize" Value="10" /> |
101 | | - <Setter Property="HorizontalAlignment" Value="Right" /> |
102 | | - <Setter Property="VerticalAlignment" Value="Bottom" /> |
103 | | - <Setter Property="Margin" Value="0 -2 2 0" /> |
| 78 | + <Style TargetType="TextBlock" x:Key="PrimaryTag" BasedOn="{StaticResource BaseTag}"> |
| 79 | + <Setter Property="Canvas.Top" Value="0" /> |
| 80 | + </Style> |
| 81 | + |
| 82 | + <Style TargetType="TextBlock" x:Key="SecondaryTag" BasedOn="{StaticResource BaseTag}"> |
| 83 | + <Setter Property="Canvas.Bottom" Value="0" /> |
104 | 84 | </Style> |
105 | 85 |
|
106 | 86 | <Style TargetType="Viewbox" x:Key="LabelViewBox"> |
107 | 87 | <Setter Property="Height" Value="30" /> |
108 | | - <Setter Property="Margin" Value="3 0" /> |
| 88 | + <Setter Property="Margin" Value="1 0" /> |
109 | 89 | <Setter Property="Stretch" Value="Uniform" /> |
110 | 90 | <Setter Property="StretchDirection" Value="Both" /> |
| 91 | + <Setter Property="VerticalAlignment" Value="Center" /> |
111 | 92 | </Style> |
112 | 93 |
|
113 | 94 | <Style TargetType="Viewbox" x:Key="ModifierViewBox" BasedOn="{StaticResource LabelViewBox}"> |
|
129 | 110 | </Setter> |
130 | 111 | </Style> |
131 | 112 |
|
132 | | - <DataTemplate x:Key="CustomLabelDataTemplate"> |
133 | | - <Canvas> |
134 | | - <ContentPresenter Content="{Binding}" ContentTemplate="{StaticResource KeyBaseDataTemplate}" /> |
135 | | - <Grid Style="{StaticResource ContentGridBase}"> |
136 | | - <Viewbox Style="{StaticResource LabelViewBox}" Grid.Column="0" Grid.Row="0"> |
137 | | - <Label Style="{StaticResource LabelStyle}" Content="{Binding EZKey.Primary.Content.Label}" /> |
138 | | - </Viewbox> |
139 | | - </Grid> |
140 | | - </Canvas> |
| 113 | + <DataTemplate x:Key="SimpleLabelDataTemplate"> |
| 114 | + <Viewbox Style="{StaticResource LabelViewBox}"> |
| 115 | + <Label Style="{StaticResource LabelStyle}" Content="{Binding Label}" /> |
| 116 | + </Viewbox> |
| 117 | + </DataTemplate> |
| 118 | + |
| 119 | + <DataTemplate x:Key="GlyphDataTemplate"> |
| 120 | + <Viewbox Style="{StaticResource LabelViewBox}"> |
| 121 | + <Label Style="{StaticResource GlyphStyle}" Content="{Binding Label}" /> |
| 122 | + </Viewbox> |
141 | 123 | </DataTemplate> |
142 | 124 |
|
| 125 | + <DataTemplate x:Key="ModdedGlyphDataTemplate"> |
| 126 | + <Viewbox Style="{StaticResource LabelViewBox}"> |
| 127 | + <Label Style="{StaticResource GlyphStyle}" Content="{Binding Label}" /> |
| 128 | + </Viewbox> |
| 129 | + </DataTemplate> |
| 130 | + |
| 131 | + <DataTemplate x:Key="LayerDataTemplate"> |
| 132 | + <Viewbox Style="{StaticResource LabelViewBox}"> |
| 133 | + <Label Style="{StaticResource GlyphStyle}" Content="{Binding Label}" /> |
| 134 | + </Viewbox> |
| 135 | + </DataTemplate> |
| 136 | + |
| 137 | + <DataTemplate x:Key="ColorPickerDataTemplate"> |
| 138 | + <Viewbox Style="{StaticResource LabelViewBox}"> |
| 139 | + <Label Style="{StaticResource GlyphStyle}" Content="{Binding Label}" /> |
| 140 | + </Viewbox> |
| 141 | + </DataTemplate> |
| 142 | + |
| 143 | + <helper:KeyFeatureTemplateSelector x:Key="KeyFeatureTemplateSelector" |
| 144 | + SimpleLabelDataTemplate = "{StaticResource SimpleLabelDataTemplate}" |
| 145 | + GlyphDataTemplate = "{StaticResource GlyphDataTemplate}" |
| 146 | + ModdedGlyphDataTemplate = "{StaticResource ModdedGlyphDataTemplate}" |
| 147 | + LayerDataTemplate = "{StaticResource LayerDataTemplate}" |
| 148 | + ColorPickerDataTemplate = "{StaticResource ColorPickerDataTemplate}" /> |
| 149 | + |
143 | 150 | <DataTemplate x:Key="SingleFeatureDataTemplate"> |
144 | 151 | <Canvas> |
145 | | - <ContentPresenter Content="{Binding}" ContentTemplate="{StaticResource KeyBaseDataTemplate}" /> |
| 152 | + <ContentPresenter Content="{Binding}" ContentTemplate="{StaticResource KeyDataTemplate}" /> |
146 | 153 | <Grid Style="{StaticResource ContentGridBase}"> |
147 | | - <Grid.RowDefinitions> |
148 | | - <RowDefinition Height=".6*"/> |
149 | | - <RowDefinition/> |
150 | | - </Grid.RowDefinitions> |
151 | | - <Viewbox Style="{StaticResource ModifierViewBox}" VerticalAlignment="Bottom" Grid.Column="0" Grid.Row="0"> |
152 | | - <Label Style="{StaticResource LabelStyle}" Content="{Binding EZKey.Primary.Modifier}" /> |
153 | | - </Viewbox> |
154 | | - <Viewbox Style="{StaticResource LabelViewBox}" VerticalAlignment="Top" Grid.Column="0" Grid.Row="1"> |
155 | | - <Label Style="{StaticResource LabelStyle}" Content="{Binding EZKey.Primary.Content.Label}" /> |
156 | | - </Viewbox> |
| 154 | + <TextBlock Style="{StaticResource PrimaryTag}" Text="{Binding Key.Primary.Tag}" /> |
| 155 | + <ContentControl ContentTemplateSelector="{StaticResource KeyFeatureTemplateSelector}" Content="{Binding Key.Primary}" /> |
157 | 156 | </Grid> |
158 | 157 | </Canvas> |
159 | 158 | </DataTemplate> |
160 | 159 |
|
161 | 160 | <DataTemplate x:Key="DoubleFeatureDataTemplate"> |
162 | 161 | <Canvas> |
163 | | - <ContentPresenter Content="{Binding}" ContentTemplate="{StaticResource KeyBaseDataTemplate}" /> |
| 162 | + <ContentPresenter Content="{Binding}" ContentTemplate="{StaticResource KeyDataTemplate}" /> |
164 | 163 | <Grid Style="{StaticResource ContentGridBase}"> |
165 | 164 | <Grid.RowDefinitions> |
166 | | - <RowDefinition Height=".5*"/> |
167 | | - <RowDefinition Height="1*"/> |
168 | | - <RowDefinition Height=".5*"/> |
169 | | - <RowDefinition Height="1*"/> |
| 165 | + <RowDefinition Height="*"/> |
| 166 | + <RowDefinition Height="*"/> |
170 | 167 | </Grid.RowDefinitions> |
171 | | - <TextBlock Style="{StaticResource PrimaryTag}" Text="{Binding EZKey.Primary.Tag}" /> |
172 | | - <TextBlock Style="{StaticResource SecondaryTag}" Text="{Binding EZKey.Secondary.Tag}" /> |
173 | | - |
174 | | - <Viewbox Style="{StaticResource ModifierViewBox}" Grid.Column="0" Grid.Row="0"> |
175 | | - <Label Style="{StaticResource LabelStyle}" Content="{Binding EZKey.Primary.Modifier}" /> |
176 | | - </Viewbox> |
177 | | - <Viewbox Style="{StaticResource LabelViewBox}" Grid.Column="0" Grid.Row="1"> |
178 | | - <Label Style="{StaticResource LabelStyle}" Content="{Binding EZKey.Primary.Content.Label}" /> |
179 | | - </Viewbox> |
180 | | - <Viewbox Style="{StaticResource ModifierViewBox}" Grid.Column="0" Grid.Row="2"> |
181 | | - <Label Style="{StaticResource LabelStyle}" Content="{Binding EZKey.Secondary.Modifier}" /> |
182 | | - </Viewbox> |
183 | | - <Viewbox Style="{StaticResource LabelViewBox}" Grid.Column="0" Grid.Row="3"> |
184 | | - <Label Style="{StaticResource LabelStyle}" Content="{Binding EZKey.Secondary.Content.Label}" /> |
185 | | - </Viewbox> |
| 168 | + <TextBlock Style="{StaticResource PrimaryTag}" Text="{Binding Key.Primary.Tag}" /> |
| 169 | + <TextBlock Style="{StaticResource SecondaryTag}" Text="{Binding Key.Secondary.Tag}" /> |
| 170 | + |
| 171 | + <ContentControl ContentTemplateSelector="{StaticResource KeyFeatureTemplateSelector}" |
| 172 | + Content="{Binding Key.Primary}" |
| 173 | + Grid.Column="0" Grid.Row="0"/> |
| 174 | + <ContentControl ContentTemplateSelector="{StaticResource KeyFeatureTemplateSelector}" |
| 175 | + Content="{Binding Key.Secondary}" |
| 176 | + Grid.Column="0" Grid.Row="1"/> |
186 | 177 | </Grid> |
187 | 178 | </Canvas> |
188 | 179 | </DataTemplate> |
189 | 180 |
|
190 | 181 | <helper:KeyContentTemplateSelector x:Key="KeyContentTemplateSelector" |
191 | | - CustomLabelDataTemplate="{StaticResource CustomLabelDataTemplate}" |
192 | 182 | SingleFeatureDataTemplate="{StaticResource SingleFeatureDataTemplate}" |
193 | 183 | DoubleFeatureDataTemplate="{StaticResource DoubleFeatureDataTemplate}" /> |
194 | 184 |
|
|
0 commit comments