Skip to content

Commit b0f900a

Browse files
authored
Merge pull request #286 from mou-haz/RatingControl_fix131
[STYLE] RatingControl
2 parents c9c90da + cc4e789 commit b0f900a

4 files changed

Lines changed: 26 additions & 22 deletions

File tree

source/iNKORE.UI.WPF.Modern.Controls/Controls/Windows/RatingControl/RatingControl.xaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern">
77

88
<Style TargetType="local:RatingControl">
9-
<Setter Property="Height" Value="32" />
9+
<Setter Property="MinHeight" Value="32" />
1010
<!-- 9794813: retire these two properties as customisation points once all resource keys available -->
1111
<Setter Property="Foreground" Value="{DynamicResource RatingControlCaptionForeground}" />
1212
<Setter Property="UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
1313
<Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
1414
<Setter Property="FontFamily" Value="{DynamicResource SymbolThemeFontFamily}" />
15-
<Setter Property="ItemInfo" Value="{DynamicResource RatingControlDefaultPathInfo}" />
15+
<Setter Property="ItemInfo" Value="{DynamicResource RatingControlDefaultFontInfo}" />
16+
<Setter Property="ui:FocusVisualHelper.FocusVisualMargin" Value="-8,-7,-8,0" />
17+
<Setter Property="Focusable" Value="True" />
1618
<Setter Property="Template">
1719
<Setter.Value>
1820
<ControlTemplate TargetType="local:RatingControl">
19-
<Grid x:Name="LayoutRoot">
21+
<Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}">
2022
<StackPanel
2123
Grid.Row="0"
2224
Margin="-20,-20,-20,-20"
@@ -30,6 +32,8 @@
3032
x:Name="Caption"
3133
Height="32"
3234
Margin="4,9,20,0"
35+
FontSize="12"
36+
Foreground="{TemplateBinding Foreground}"
3337
VerticalAlignment="Center"
3438
AutomationProperties.Name="RatingCaption"
3539
IsHitTestVisible="False"

source/iNKORE.UI.WPF.Modern/Themes/Schemes/Dark.xaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,16 +1997,16 @@
19971997
<m:StaticResource x:Key="RadioButtonsHeaderForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
19981998

19991999
<!-- Resources for RatingControl -->
2000-
<m:StaticResource x:Key="RatingControlUnselectedForeground" ResourceKey="SystemControlBackgroundBaseLowBrush" />
2001-
<m:StaticResource x:Key="RatingControlSelectedForeground" ResourceKey="SystemAccentColorLight2Brush" />
2002-
<m:StaticResource x:Key="RatingControlPlaceholderForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
2003-
<m:StaticResource x:Key="RatingControlPointerOverPlaceholderForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
2004-
<m:StaticResource x:Key="RatingControlPointerOverUnselectedForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
2005-
<m:StaticResource x:Key="RatingControlPointerOverSelectedForeground" ResourceKey="SystemControlForegroundAccentBrush" />
2006-
<m:StaticResource x:Key="RatingControlDisabledSelectedForeground" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
2000+
<m:StaticResource x:Key="RatingControlUnselectedForeground" ResourceKey="TextFillColorSecondaryBrush" />
2001+
<m:StaticResource x:Key="RatingControlSelectedForeground" ResourceKey="AccentFillColorDefaultBrush" />
2002+
<m:StaticResource x:Key="RatingControlPlaceholderForeground" ResourceKey="TextFillColorPrimaryBrush" />
2003+
<m:StaticResource x:Key="RatingControlPointerOverPlaceholderForeground" ResourceKey="ControlAltFillColorTertiaryBrush" />
2004+
<m:StaticResource x:Key="RatingControlPointerOverUnselectedForeground" ResourceKey="ControlAltFillColorTertiaryBrush" />
2005+
<m:StaticResource x:Key="RatingControlPointerOverSelectedForeground" ResourceKey="AccentFillColorDefaultBrush" />
2006+
<m:StaticResource x:Key="RatingControlDisabledSelectedForeground" ResourceKey="TextFillColorDisabledBrush" />
2007+
<m:StaticResource x:Key="RatingControlCaptionForeground" ResourceKey="TextFillColorSecondaryBrush" />
20072008
<!-- If this Foreground property is removed/renamed, please update ThemeResourcesTests::VerifyOverrides: -->
2008-
<m:StaticResource x:Key="RatingControlCaptionForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
2009-
<common:RatingItemFontInfo x:Key="RatingControlDefaultFontInfo" Glyph="&#xE735;" />
2009+
<common:RatingItemFontInfo x:Key="RatingControlDefaultFontInfo" Glyph="&#xE735;" UnsetGlyph="&#xE734;" />
20102010
<common:RatingItemPathInfo x:Key="RatingControlDefaultPathInfo" Data="F1 M 4.21875 19.53125 C 4.049479 19.53125 3.902995 19.467773 3.779297 19.34082 C 3.655599 19.213867 3.59375 19.065756 3.59375 18.896484 C 3.59375 18.850912 3.597005 18.815104 3.603516 18.789062 L 4.648438 12.675781 L 0.205078 8.349609 C 0.08138 8.225912 0.019531 8.079428 0.019531 7.910156 C 0.019531 7.760417 0.071615 7.623698 0.175781 7.5 C 0.279948 7.376303 0.406901 7.301434 0.556641 7.275391 L 6.689453 6.386719 L 9.443359 0.820312 C 9.495442 0.716146 9.571939 0.633139 9.672852 0.571289 C 9.773763 0.509441 9.879557 0.478516 9.990234 0.478516 C 10.107422 0.478516 10.218099 0.507812 10.322266 0.566406 C 10.426432 0.625 10.504557 0.709637 10.556641 0.820312 L 13.310547 6.386719 L 19.443359 7.275391 C 19.599609 7.301434 19.728189 7.373048 19.829102 7.490234 C 19.930012 7.607423 19.980469 7.744142 19.980469 7.900391 C 19.980469 8.082683 19.918619 8.232422 19.794922 8.349609 L 15.351562 12.675781 L 16.396484 18.789062 C 16.402994 18.815104 16.40625 18.850912 16.40625 18.896484 C 16.40625 19.065756 16.3444 19.21224 16.220703 19.335938 C 16.097004 19.459635 15.950521 19.521484 15.78125 19.521484 C 15.670572 19.521484 15.572916 19.498697 15.488281 19.453125 L 10 16.5625 L 4.511719 19.453125 C 4.420573 19.505209 4.322917 19.53125 4.21875 19.53125 Z " />
20112011

20122012
<!-- Resources for RepeatButton -->

source/iNKORE.UI.WPF.Modern/Themes/Schemes/HighContrast.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,7 @@
19261926
<m:StaticResource x:Key="RatingControlPointerOverUnselectedForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
19271927
<m:StaticResource x:Key="RatingControlPointerOverSelectedForeground" ResourceKey="SystemControlHighlightAccentBrush" />
19281928
<SolidColorBrush x:Key="RatingControlDisabledSelectedForeground" Color="{m:ThemeResource SystemColorGrayTextColor}" />
1929-
<m:StaticResource x:Key="RatingControlCaptionForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
1929+
<m:StaticResource x:Key="RatingControlCaptionForeground" ResourceKey="TextFillColorSecondaryBrush" />
19301930
<common:RatingItemFontInfo
19311931
x:Key="RatingControlDefaultFontInfo"
19321932
Glyph="&#xE735;"

source/iNKORE.UI.WPF.Modern/Themes/Schemes/Light.xaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,15 +2014,15 @@
20142014
<m:StaticResource x:Key="RadioButtonsHeaderForegroundDisabled" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
20152015

20162016
<!-- Resources for RatingControl -->
2017-
<m:StaticResource x:Key="RatingControlUnselectedForeground" ResourceKey="SystemControlBackgroundBaseLowBrush" />
2018-
<m:StaticResource x:Key="RatingControlSelectedForeground" ResourceKey="SystemAccentColorDark1Brush" />
2019-
<m:StaticResource x:Key="RatingControlPlaceholderForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
2020-
<m:StaticResource x:Key="RatingControlPointerOverPlaceholderForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
2021-
<m:StaticResource x:Key="RatingControlPointerOverUnselectedForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
2022-
<m:StaticResource x:Key="RatingControlPointerOverSelectedForeground" ResourceKey="SystemControlForegroundAccentBrush" />
2023-
<m:StaticResource x:Key="RatingControlDisabledSelectedForeground" ResourceKey="SystemControlDisabledBaseMediumLowBrush" />
2024-
<m:StaticResource x:Key="RatingControlCaptionForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
2025-
<common:RatingItemFontInfo x:Key="RatingControlDefaultFontInfo" Glyph="&#xE735;" />
2017+
<m:StaticResource x:Key="RatingControlUnselectedForeground" ResourceKey="TextFillColorSecondaryBrush" />
2018+
<m:StaticResource x:Key="RatingControlSelectedForeground" ResourceKey="AccentFillColorDefaultBrush" />
2019+
<m:StaticResource x:Key="RatingControlPlaceholderForeground" ResourceKey="TextFillColorPrimaryBrush" />
2020+
<m:StaticResource x:Key="RatingControlPointerOverPlaceholderForeground" ResourceKey="ControlAltFillColorTertiaryBrush" />
2021+
<m:StaticResource x:Key="RatingControlPointerOverUnselectedForeground" ResourceKey="ControlAltFillColorTertiaryBrush" />
2022+
<m:StaticResource x:Key="RatingControlPointerOverSelectedForeground" ResourceKey="AccentFillColorDefaultBrush" />
2023+
<m:StaticResource x:Key="RatingControlDisabledSelectedForeground" ResourceKey="TextFillColorDisabledBrush" />
2024+
<m:StaticResource x:Key="RatingControlCaptionForeground" ResourceKey="TextFillColorSecondaryBrush" />
2025+
<common:RatingItemFontInfo x:Key="RatingControlDefaultFontInfo" Glyph="&#xE735;" UnsetGlyph="&#xE734;" />
20262026
<common:RatingItemPathInfo x:Key="RatingControlDefaultPathInfo" Data="F1 M 4.21875 19.53125 C 4.049479 19.53125 3.902995 19.467773 3.779297 19.34082 C 3.655599 19.213867 3.59375 19.065756 3.59375 18.896484 C 3.59375 18.850912 3.597005 18.815104 3.603516 18.789062 L 4.648438 12.675781 L 0.205078 8.349609 C 0.08138 8.225912 0.019531 8.079428 0.019531 7.910156 C 0.019531 7.760417 0.071615 7.623698 0.175781 7.5 C 0.279948 7.376303 0.406901 7.301434 0.556641 7.275391 L 6.689453 6.386719 L 9.443359 0.820312 C 9.495442 0.716146 9.571939 0.633139 9.672852 0.571289 C 9.773763 0.509441 9.879557 0.478516 9.990234 0.478516 C 10.107422 0.478516 10.218099 0.507812 10.322266 0.566406 C 10.426432 0.625 10.504557 0.709637 10.556641 0.820312 L 13.310547 6.386719 L 19.443359 7.275391 C 19.599609 7.301434 19.728189 7.373048 19.829102 7.490234 C 19.930012 7.607423 19.980469 7.744142 19.980469 7.900391 C 19.980469 8.082683 19.918619 8.232422 19.794922 8.349609 L 15.351562 12.675781 L 16.396484 18.789062 C 16.402994 18.815104 16.40625 18.850912 16.40625 18.896484 C 16.40625 19.065756 16.3444 19.21224 16.220703 19.335938 C 16.097004 19.459635 15.950521 19.521484 15.78125 19.521484 C 15.670572 19.521484 15.572916 19.498697 15.488281 19.453125 L 10 16.5625 L 4.511719 19.453125 C 4.420573 19.505209 4.322917 19.53125 4.21875 19.53125 Z " />
20272027

20282028
<!-- Resources for RepeatButton -->

0 commit comments

Comments
 (0)