Implementing themes for Calendar.
This commit is contained in:
@@ -13,9 +13,13 @@
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Name="Light">
|
||||
<SolidColorBrush x:Key="MailListHeaderBackgroundColor">#b2dffc</SolidColorBrush>
|
||||
|
||||
<SolidColorBrush x:Key="CalendarSeperatorBrush">#222f3e</SolidColorBrush>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Name="Dark">
|
||||
<SolidColorBrush x:Key="MailListHeaderBackgroundColor">#b2dffc</SolidColorBrush>
|
||||
|
||||
<SolidColorBrush x:Key="CalendarSeperatorBrush">#222f3e</SolidColorBrush>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -13,7 +13,10 @@
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Name="Light">
|
||||
<SolidColorBrush x:Key="MailListHeaderBackgroundColor">#dcfad8</SolidColorBrush>
|
||||
<SolidColorBrush x:Key="CalendarSeperatorBrush">#576574</SolidColorBrush>
|
||||
</ResourceDictionary>
|
||||
|
||||
<!-- N/A. Light theme only. -->
|
||||
<ResourceDictionary x:Name="Dark">
|
||||
<SolidColorBrush x:Key="MailListHeaderBackgroundColor">#dcfad8</SolidColorBrush>
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:xaml="using:Windows.UI.Xaml">
|
||||
|
||||
<x:String x:Key="ThemeName">Snowflake</x:String>
|
||||
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/Snowflake.jpg</x:String>
|
||||
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/BackgroundImages/Snowflake.jpg</x:String>
|
||||
<x:Boolean x:Key="UseMica">False</x:Boolean>
|
||||
|
||||
<ImageBrush x:Key="WinoApplicationBackgroundColor" ImageSource="{StaticResource ThemeBackgroundImage}" />
|
||||
|
||||
@@ -31,8 +31,9 @@
|
||||
<SolidColorBrush x:Key="CommandBarBorderBrushOpen" Color="Transparent" />
|
||||
<Thickness x:Key="CommandBarBorderThicknessOpen">0</Thickness>
|
||||
|
||||
<!--<x:Double x:Key="AppBarButtonContentHeight">19</x:Double>
|
||||
<x:Double x:Key="NavigationViewItemOnLeftIconBoxHeight">19</x:Double>-->
|
||||
<!-- Override AppBarToggleButton's checked background color. -->
|
||||
<StaticResource x:Key="AppBarToggleButtonBackgroundChecked" ResourceKey="SystemAccentColor" />
|
||||
|
||||
<Thickness x:Key="ImapSetupDialogSubPagePadding">24,24,24,24</Thickness>
|
||||
|
||||
<!-- Border style for each page's root border for separation of zones. -->
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Wino.Core.UWP
|
||||
services.AddSingleton<IThemeService, ThemeService>();
|
||||
services.AddSingleton<IStatePersistanceService, StatePersistenceService>();
|
||||
|
||||
|
||||
services.AddSingleton<IDialogServiceBase, DialogServiceBase>();
|
||||
services.AddTransient<IConfigurationService, ConfigurationService>();
|
||||
services.AddTransient<IFileService, FileService>();
|
||||
services.AddTransient<IStoreRatingService, StoreRatingService>();
|
||||
|
||||
@@ -235,14 +235,22 @@ namespace Wino.Services
|
||||
// Change accent color if specified.
|
||||
if (!string.IsNullOrEmpty(hex))
|
||||
{
|
||||
var brush = new SolidColorBrush(Microsoft.Toolkit.Uwp.Helpers.ColorHelper.ToColor(hex));
|
||||
var color = Microsoft.Toolkit.Uwp.Helpers.ColorHelper.ToColor(hex);
|
||||
var brush = new SolidColorBrush(color);
|
||||
|
||||
if (_applicationResourceManager.ContainsResourceKey("SystemAccentColor"))
|
||||
_applicationResourceManager.ReplaceResource("SystemAccentColor", brush);
|
||||
_applicationResourceManager.ReplaceResource("SystemAccentColor", color);
|
||||
|
||||
if (_applicationResourceManager.ContainsResourceKey("NavigationViewSelectionIndicatorForeground"))
|
||||
_applicationResourceManager.ReplaceResource("NavigationViewSelectionIndicatorForeground", brush);
|
||||
|
||||
if (_applicationResourceManager.ContainsResourceKey("SystemControlBackgroundAccentBrush"))
|
||||
_applicationResourceManager.ReplaceResource("SystemControlBackgroundAccentBrush", brush);
|
||||
|
||||
if (_applicationResourceManager.ContainsResourceKey("SystemColorControlAccentBrush"))
|
||||
_applicationResourceManager.ReplaceResource("SystemColorControlAccentBrush", brush);
|
||||
|
||||
|
||||
RefreshThemeResource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:animatedvisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"
|
||||
xmlns:coreControls="using:Wino.Core.UWP.Controls"
|
||||
xmlns:coreSelectors="using:Wino.Core.UWP.Selectors"
|
||||
xmlns:domain="using:Wino.Core.Domain"
|
||||
xmlns:helpers="using:Wino.Helpers"
|
||||
xmlns:local="using:Wino.Core.UWP.Styles"
|
||||
xmlns:menu="using:Wino.Core.Domain.MenuItems"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:personalization="using:Wino.Core.UWP.Models.Personalization"
|
||||
xmlns:viewModelData="using:Wino.Mail.ViewModels.Data"
|
||||
xmlns:winuiControls="using:CommunityToolkit.WinUI.Controls">
|
||||
|
||||
@@ -17,6 +19,23 @@
|
||||
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="NavigationViewContentGridBorderBrush" Color="Transparent" />
|
||||
|
||||
<!-- Root Account Template -->
|
||||
<DataTemplate x:Key="RootAccountTemplate" x:DataType="viewModelData:AccountProviderDetailViewModel">
|
||||
<winuiControls:SettingsCard
|
||||
Margin="0,2,0,0"
|
||||
Command="{Binding ViewModel.NavigateAccountDetailsCommand, Mode=OneWay, ElementName=root}"
|
||||
CommandParameter="{x:Bind}"
|
||||
Description="{x:Bind Account.Address}"
|
||||
Header="{x:Bind Account.Name}"
|
||||
IsClickEnabled="True">
|
||||
<winuiControls:SettingsCard.HeaderIcon>
|
||||
<coreControls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(ProviderDetail.Type)}" />
|
||||
</winuiControls:SettingsCard.HeaderIcon>
|
||||
</winuiControls:SettingsCard>
|
||||
</DataTemplate>
|
||||
|
||||
|
||||
|
||||
<!--#region Navigation Menu Templates-->
|
||||
|
||||
<!-- Manage Accounts etc. Other navigatable. -->
|
||||
@@ -68,19 +87,134 @@
|
||||
|
||||
<!--#endregion-->
|
||||
|
||||
<!-- Root Account Template -->
|
||||
<DataTemplate x:Key="RootAccountTemplate" x:DataType="viewModelData:AccountProviderDetailViewModel">
|
||||
<winuiControls:SettingsCard
|
||||
Margin="0,2,0,0"
|
||||
Command="{Binding ViewModel.NavigateAccountDetailsCommand, Mode=OneWay, ElementName=root}"
|
||||
CommandParameter="{x:Bind}"
|
||||
Description="{x:Bind Account.Address}"
|
||||
Header="{x:Bind Account.Name}"
|
||||
IsClickEnabled="True">
|
||||
<winuiControls:SettingsCard.HeaderIcon>
|
||||
<coreControls:WinoFontIcon FontSize="64" Icon="{x:Bind helpers:XamlHelpers.GetProviderIcon(ProviderDetail.Type)}" />
|
||||
</winuiControls:SettingsCard.HeaderIcon>
|
||||
</winuiControls:SettingsCard>
|
||||
<!--#region Settings-->
|
||||
<!-- System Theme Template -->
|
||||
<DataTemplate x:Key="SystemAppThemeTemplate" x:DataType="personalization:SystemAppTheme">
|
||||
<Grid
|
||||
Width="175"
|
||||
CornerRadius="6"
|
||||
RowSpacing="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="125" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid CornerRadius="6,6,0,0">
|
||||
<Grid.Background>
|
||||
<ImageBrush ImageSource="{x:Bind BackgroundPreviewImage}" />
|
||||
</Grid.Background>
|
||||
<Grid
|
||||
Width="20"
|
||||
Height="20"
|
||||
Margin="0,12,12,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="{ThemeResource SystemAccentColor}" />
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock
|
||||
Padding="0,8"
|
||||
HorizontalAlignment="Center"
|
||||
Text="{x:Bind ThemeName}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Custom Theme Template -->
|
||||
<DataTemplate x:Key="CustomAppThemeTemplate" x:DataType="personalization:CustomAppTheme">
|
||||
<Grid
|
||||
Width="175"
|
||||
CornerRadius="6"
|
||||
RowSpacing="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="125" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid CornerRadius="6,6,0,0">
|
||||
<Grid.Background>
|
||||
<ImageBrush ImageSource="{x:Bind BackgroundPreviewImage}" />
|
||||
</Grid.Background>
|
||||
<!-- Accent Assigned -->
|
||||
<Grid x:Name="AccentAssignedGrid" x:Load="{x:Bind IsAccentColorAssigned}">
|
||||
<Grid
|
||||
Width="20"
|
||||
Height="20"
|
||||
Margin="0,12,12,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="{x:Bind helpers:XamlHelpers.GetSolidColorBrushFromHex(AccentColor)}" />
|
||||
</Grid>
|
||||
|
||||
<!-- Accent Not Assigned -->
|
||||
<Grid x:Name="AccentNotAssignedGrid" x:Load="{x:Bind IsAccentColorAssigned, Converter={StaticResource ReverseBooleanConverter}}">
|
||||
<Grid
|
||||
Width="20"
|
||||
Height="20"
|
||||
Margin="0,12,12,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="{ThemeResource SystemAccentColor}" />
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock
|
||||
Padding="0,8"
|
||||
HorizontalAlignment="Center"
|
||||
Text="{x:Bind ThemeName}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- Wino Template -->
|
||||
<DataTemplate x:Key="PreDefinedAppThemeTemplate" x:DataType="personalization:PreDefinedAppTheme">
|
||||
<Grid
|
||||
Width="175"
|
||||
CornerRadius="6"
|
||||
RowSpacing="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="125" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid CornerRadius="6,6,0,0">
|
||||
<Grid.Background>
|
||||
<ImageBrush ImageSource="{x:Bind BackgroundPreviewImage}" />
|
||||
</Grid.Background>
|
||||
|
||||
<Grid
|
||||
Width="20"
|
||||
Height="20"
|
||||
Margin="0,12,12,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Background="{x:Bind helpers:XamlHelpers.GetSolidColorBrushFromHex(AccentColor)}" />
|
||||
</Grid>
|
||||
|
||||
<!-- Dark Theme Title -->
|
||||
<Grid Grid.Row="1" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock
|
||||
Padding="0,8"
|
||||
HorizontalAlignment="Center"
|
||||
Text="{x:Bind ThemeName}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<coreSelectors:AppThemePreviewTemplateSelector
|
||||
x:Key="AppThemePreviewTemplateSelector"
|
||||
CustomAppTemplate="{StaticResource CustomAppThemeTemplate}"
|
||||
PreDefinedThemeTemplate="{StaticResource PreDefinedAppThemeTemplate}"
|
||||
SystemThemeTemplate="{StaticResource SystemAppThemeTemplate}" />
|
||||
|
||||
<Style x:Key="SettingTitleTextBlockStyle" TargetType="TextBlock">
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<Setter Property="FontWeight" Value="SemiBold" />
|
||||
</Style>
|
||||
|
||||
<!--#endregion-->
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -38,6 +38,9 @@ namespace Wino.Views
|
||||
case WinoPage.AppPreferencesPage:
|
||||
WeakReferenceMessenger.Default.Send(new BreadcrumbNavigationRequested(Translator.SettingsAppPreferences_Title, WinoPage.AppPreferencesPage));
|
||||
break;
|
||||
case WinoPage.PersonalizationPage:
|
||||
WeakReferenceMessenger.Default.Send(new BreadcrumbNavigationRequested(Translator.SettingsPersonalization_Title, WinoPage.PersonalizationPage));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user