Skip to content

Commit

Permalink
Correct RatingControl foreground contrast (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
NotYoojun committed Aug 25, 2024
1 parent aadf618 commit c3b4d24
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 130 deletions.
3 changes: 1 addition & 2 deletions samples/ExamplePhotoTaker/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources AccentColor="Green"/>
<ui:ThemeResources/>
<ui:XamlControlsResources/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

</Application.Resources>
</Application>
19 changes: 6 additions & 13 deletions samples/ExamplePhotoTaker/ExamplePhotoTaker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,27 @@
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ImplicitUsings>disable</ImplicitUsings>
<UseWPF>true</UseWPF>
<EnableDefaultPageItems>false</EnableDefaultPageItems>
</PropertyGroup>

<ItemGroup>
<None Remove="david-van-dijk-3LTht2nxd34-unsplash.jpg" />
<None Remove="MainWindow.xaml" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\source\iNKORE.UI.WPF.Modern.Controls\iNKORE.UI.WPF.Modern.Controls.csproj" />
<ProjectReference Include="..\..\source\Inkore.UI.WPF.Modern\iNKORE.UI.WPF.Modern.csproj" />
<Page Include="MainWindow.xaml" />
</ItemGroup>

<ItemGroup>
<Resource Include="david-van-dijk-3LTht2nxd34-unsplash.jpg" />
</ItemGroup>

<ItemGroup>
<Compile Update="Pages\Page2.xaml.cs">
<SubType>Code</SubType>
</Compile>
<ProjectReference Include="..\..\source\iNKORE.UI.WPF.Modern.Controls\iNKORE.UI.WPF.Modern.Controls.csproj" />
<ProjectReference Include="..\..\source\Inkore.UI.WPF.Modern\iNKORE.UI.WPF.Modern.csproj" />
</ItemGroup>

<ItemGroup>
<Page Update="Pages\Page2.xaml">
<SubType>Designer</SubType>
</Page>
<Resource Include="david-van-dijk-3LTht2nxd34-unsplash.jpg" />
</ItemGroup>

</Project>
40 changes: 25 additions & 15 deletions samples/ExamplePhotoTaker/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ExamplePhotoTaker" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:local="clr-namespace:ExamplePhotoTaker"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
mc:Ignorable="d" ui:WindowHelper.UseModernWindowStyle="True"
Title="MainWindow" Height="450" Width="800" Language="en-US">
<Grid>
Expand All @@ -18,20 +20,28 @@
<Viewbox>
<Viewbox x:Name="Viewbox_Viewport" Width="1024">
<Border Background="White" Padding="10" Width="640" Height="270">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>

<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="10" HorizontalAlignment="Center">
<Button x:Name="Button_NavigateToPage1" Content="To Page 1" Click="Button_NavigateToPage1_Click"/>
<Button x:Name="Button_NavigateToPage2" Content="To Page 2" Click="Button_NavigateToPage2_Click"/>
</ikw:SimpleStackPanel>

<ui:Frame x:Name="Frame_Main" Navigating="Frame_Main_Navigating" Margin="10" Grid.Row="1"
BorderBrush="Gray" BorderThickness="2,2,2,2"/>
</Grid>
<ikw:SimpleStackPanel HorizontalAlignment="Center" VerticalAlignment="Center"
Spacing="10">

<Button Content="Confirm Deletion">
<FrameworkElement.Resources>
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundKey}" Color="#FFD80000"/>
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBorderBrushKey}" Color="#FF960000"/>

<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundPointerOverKey}" Color="#FFE90000"/>
<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBorderBrushPointerOverKey}" Color="#FFC00000"/>

<SolidColorBrush x:Key="{x:Static ui:ThemeKeys.ButtonBackgroundPressedKey}" Color="#FF860000"/>
<ui:StaticResource x:Key="{x:Static ui:ThemeKeys.ButtonBorderBrushPressedKey}" ResourceKey="{x:Static ui:ThemeKeys.ButtonBackgroundPressedKey}"/>

<ui:StaticResource x:Key="{x:Static ui:ThemeKeys.ButtonForegroundKey}" ResourceKey="{x:Static ui:ThemeKeys.AccentButtonForegroundKey}"/>
<ui:StaticResource x:Key="{x:Static ui:ThemeKeys.ButtonForegroundPointerOverKey}" ResourceKey="{x:Static ui:ThemeKeys.ButtonForegroundKey}"/>
<ui:StaticResource x:Key="{x:Static ui:ThemeKeys.ButtonForegroundPressedKey}" ResourceKey="{x:Static ui:ThemeKeys.ButtonForegroundKey}"/>

</FrameworkElement.Resources>
</Button>

</ikw:SimpleStackPanel>
</Border>
</Viewbox>
</Viewbox>
Expand Down
30 changes: 1 addition & 29 deletions samples/ExamplePhotoTaker/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ExamplePhotoTaker.Pages;
using iNKORE.UI.WPF.Modern.Media.Animation;
using iNKORE.UI.WPF.Modern.Media.Animation;
using Microsoft.Win32;
using System.Collections.ObjectModel;
using System.Diagnostics;
Expand Down Expand Up @@ -63,33 +62,6 @@ private void Button_SaveScreenshot_Click(object sender, RoutedEventArgs e)
}
}

Page1 Page_1 = new Page1();
Page2 Page_2 = new Page2();

private void Button_NavigateToPage1_Click(object sender, RoutedEventArgs e)
{
NavigateTo(Page_1);
}

private void Button_NavigateToPage2_Click(object sender, RoutedEventArgs e)
{
NavigateTo(Page_2);
}

WeakReference __Frame_Main_NavigatingTarget = new WeakReference(null);
private void Frame_Main_Navigating(object sender, NavigatingCancelEventArgs e)
{
if (e.Content != __Frame_Main_NavigatingTarget.Target)
{
e.Cancel = true;
}
}

public void NavigateTo(object content, object? extraData = null, NavigationTransitionInfo? infoOverride = null)
{
__Frame_Main_NavigatingTarget.Target = content;
Frame_Main.Navigate(content, extraData, infoOverride);
}
}

class VacationSpots : ObservableCollection<string>
Expand Down
19 changes: 0 additions & 19 deletions samples/ExamplePhotoTaker/Pages/Page1.xaml

This file was deleted.

16 changes: 0 additions & 16 deletions samples/ExamplePhotoTaker/Pages/Page1.xaml.cs

This file was deleted.

18 changes: 0 additions & 18 deletions samples/ExamplePhotoTaker/Pages/Page2.xaml

This file was deleted.

16 changes: 0 additions & 16 deletions samples/ExamplePhotoTaker/Pages/Page2.xaml.cs

This file was deleted.

2 changes: 1 addition & 1 deletion source/iNKORE.UI.WPF.Modern/Themes/Schemes/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@

<!-- Resources for RatingControl -->
<m:StaticResource x:Key="RatingControlUnselectedForeground" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<m:StaticResource x:Key="RatingControlSelectedForeground" ResourceKey="SystemControlForegroundAccentBrush" />
<m:StaticResource x:Key="RatingControlSelectedForeground" ResourceKey="SystemAccentColorLight2Brush" />
<m:StaticResource x:Key="RatingControlPlaceholderForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<m:StaticResource x:Key="RatingControlPointerOverPlaceholderForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
<m:StaticResource x:Key="RatingControlPointerOverUnselectedForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
Expand Down
2 changes: 1 addition & 1 deletion source/iNKORE.UI.WPF.Modern/Themes/Schemes/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,7 @@

<!-- Resources for RatingControl -->
<m:StaticResource x:Key="RatingControlUnselectedForeground" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<m:StaticResource x:Key="RatingControlSelectedForeground" ResourceKey="SystemControlForegroundAccentBrush" />
<m:StaticResource x:Key="RatingControlSelectedForeground" ResourceKey="SystemAccentColorDark1Brush" />
<m:StaticResource x:Key="RatingControlPlaceholderForeground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<m:StaticResource x:Key="RatingControlPointerOverPlaceholderForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
<m:StaticResource x:Key="RatingControlPointerOverUnselectedForeground" ResourceKey="SystemControlForegroundBaseMediumBrush" />
Expand Down

0 comments on commit c3b4d24

Please sign in to comment.