Fix themes and attachment icons.

This commit is contained in:
Burak Kaan Köse
2024-11-27 01:43:03 +01:00
parent c3f98e327c
commit cd3e0492f5
16 changed files with 41 additions and 25 deletions

View File

@@ -22,5 +22,6 @@ namespace Wino.Core.Domain.Interfaces
Guid CurrentApplicationThemeId { get; set; }
string AccentColor { get; set; }
string GetSystemAccentColorHex();
bool IsCustomTheme { get; }
}
}

View File

@@ -4,7 +4,7 @@
xmlns:xaml="using:Windows.UI.Xaml">
<x:String x:Key="ThemeName">Clouds</x:String>
<x:String x:Key="ThemeBackgroundImage">ms-appx:///BackgroundImages/Clouds.jpg</x:String>
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/BackgroundImages/Clouds.jpg</x:String>
<x:Boolean x:Key="UseMica">False</x:Boolean>
<ImageBrush x:Key="WinoApplicationBackgroundColor" ImageSource="{StaticResource ThemeBackgroundImage}" />

View File

@@ -4,7 +4,7 @@
xmlns:xaml="using:Windows.UI.Xaml">
<x:String x:Key="ThemeName">Forest</x:String>
<x:String x:Key="ThemeBackgroundImage">ms-appx:///BackgroundImages/Forest.jpg</x:String>
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/BackgroundImages/Forest.jpg</x:String>
<x:Boolean x:Key="UseMica">False</x:Boolean>
<ImageBrush x:Key="WinoApplicationBackgroundColor" ImageSource="{StaticResource ThemeBackgroundImage}" />

View File

@@ -4,7 +4,7 @@
xmlns:xaml="using:Windows.UI.Xaml">
<x:String x:Key="ThemeName">Garden</x:String>
<x:String x:Key="ThemeBackgroundImage">ms-appx:///BackgroundImages/Garden.jpg</x:String>
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/BackgroundImages/Garden.jpg</x:String>
<x:Boolean x:Key="UseMica">False</x:Boolean>
<ImageBrush x:Key="WinoApplicationBackgroundColor" ImageSource="{StaticResource ThemeBackgroundImage}" />

View File

@@ -4,7 +4,7 @@
xmlns:xaml="using:Windows.UI.Xaml">
<x:String x:Key="ThemeName">Nighty</x:String>
<x:String x:Key="ThemeBackgroundImage">ms-appx:///BackgroundImages/Nighty.jpg</x:String>
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/BackgroundImages/Nighty.jpg</x:String>
<x:Boolean x:Key="UseMica">False</x:Boolean>
<ImageBrush x:Key="WinoApplicationBackgroundColor" ImageSource="{StaticResource ThemeBackgroundImage}" />

View File

@@ -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:///BackgroundImages/Snowflake.jpg</x:String>
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/Snowflake.jpg</x:String>
<x:Boolean x:Key="UseMica">False</x:Boolean>
<ImageBrush x:Key="WinoApplicationBackgroundColor" ImageSource="{StaticResource ThemeBackgroundImage}" />

View File

@@ -94,9 +94,6 @@
</Setter>
</Style>
</ResourceDictionary>
<!-- Last item must always be the default theme. -->
<ResourceDictionary Source="AppThemes/Mica.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@@ -24,7 +24,7 @@ namespace Wino.Core.UWP.Models.Personalization
public override async Task<string> GetThemeResourceDictionaryContentAsync()
{
var customAppThemeFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///AppThemes/Custom.xaml"));
var customAppThemeFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Wino.Core.UWP/AppThemes/Custom.xaml"));
return await FileIO.ReadTextAsync(customAppThemeFile);
}
}

View File

@@ -23,11 +23,11 @@ namespace Wino.Core.UWP.Models.Personalization
public override AppThemeType AppThemeType => AppThemeType.PreDefined;
public override string GetBackgroundPreviewImagePath()
=> $"ms-appx:///BackgroundImages/{ThemeName}.jpg";
=> $"ms-appx:///Wino.Core.UWP/BackgroundImages/{ThemeName}.jpg";
public override async Task<string> GetThemeResourceDictionaryContentAsync()
{
var xamlDictionaryFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///AppThemes/{ThemeName}.xaml"));
var xamlDictionaryFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appx:///Wino.Core.UWP/AppThemes/{ThemeName}.xaml"));
return await FileIO.ReadTextAsync(xamlDictionaryFile);
}
}

View File

@@ -143,6 +143,15 @@ namespace Wino.Services
}
}
public bool IsCustomTheme
{
get
{
return currentApplicationThemeId != Guid.Parse(_micaThemeId) &&
currentApplicationThemeId != Guid.Parse(_acrylicThemeId);
}
}
public async Task InitializeAsync()
{
// Already initialized. There is no need.

View File

@@ -6,43 +6,43 @@
<!-- Attachment Icon Templates -->
<DataTemplate x:Key="NoneTemplate">
<Image Source="/Assets/FileTypes/type_none.png" />
<Image Source="Assets/FileTypes/type_none.png" />
</DataTemplate>
<DataTemplate x:Key="ExecutableTemplate">
<Image Source="/Assets/FileTypes/type_executable.png" />
<Image Source="Assets/FileTypes/type_executable.png" />
</DataTemplate>
<DataTemplate x:Key="ImageTemplate">
<Image Source="/Assets/FileTypes/type_image.png" />
<Image Source="Assets/FileTypes/type_image.png" />
</DataTemplate>
<DataTemplate x:Key="VideoTemplate">
<Image Source="/Assets/FileTypes/type_video.png" />
<Image Source="Assets/FileTypes/type_video.png" />
</DataTemplate>
<DataTemplate x:Key="AudioTemplate">
<Image Source="/Assets/FileTypes/type_audio.png" />
<Image Source="Assets/FileTypes/type_audio.png" />
</DataTemplate>
<DataTemplate x:Key="PDFTemplate">
<Image Source="/Assets/FileTypes/type_pdf.png" />
<Image Source="Assets/FileTypes/type_pdf.png" />
</DataTemplate>
<DataTemplate x:Key="HTMLTemplate">
<Image Source="/Assets/FileTypes/type_html.png" />
<Image Source="Assets/FileTypes/type_html.png" />
</DataTemplate>
<DataTemplate x:Key="RarTemplate">
<Image Source="/Assets/FileTypes/type_rar.png" />
<Image Source="Assets/FileTypes/type_rar.png" />
</DataTemplate>
<DataTemplate x:Key="ArchiveTemplate">
<Image Source="/Assets/FileTypes/type_archive.png" />
<Image Source="Assets/FileTypes/type_archive.png" />
</DataTemplate>
<DataTemplate x:Key="OtherTemplate">
<Image Source="/Assets/FileTypes/type_other.png" />
<Image Source="Assets/FileTypes/type_other.png" />
</DataTemplate>
<selectors:FileAttachmentTypeSelector
@@ -57,5 +57,4 @@
RarArchive="{StaticResource RarTemplate}"
Video="{StaticResource VideoTemplate}" />
</ResourceDictionary>

View File

@@ -85,6 +85,7 @@
<Compile Include="Activation\ActivationHandler.cs" />
<Compile Include="BasePage.cs" />
<Compile Include="Controls\ControlConstants.cs" />
<Compile Include="Controls\CustomWrapPanel.cs" />
<Compile Include="Controls\WinoAppTitleBar.xaml.cs">
<DependentUpon>WinoAppTitleBar.xaml</DependentUpon>
</Compile>

View File

@@ -70,6 +70,7 @@ namespace Wino.Mail.ViewModels
public INavigationService NavigationService { get; }
public IStatePersistanceService StatePersistenceService { get; }
public IPreferencesService PreferencesService { get; }
public IThemeService ThemeService { get; }
private readonly IMailService _mailService;
private readonly IFolderService _folderService;
@@ -154,9 +155,11 @@ namespace Wino.Mail.ViewModels
IWinoRequestDelegator winoRequestDelegator,
IKeyPressService keyPressService,
IPreferencesService preferencesService,
IWinoServerConnectionManager winoServerConnectionManager)
IThemeService themeService,
IWinoServerConnectionManager winoServerConnectionManager)
{
PreferencesService = preferencesService;
ThemeService = themeService;
_winoServerConnectionManager = winoServerConnectionManager;
StatePersistenceService = statePersistenceService;
NavigationService = navigationService;

View File

@@ -17,6 +17,9 @@
<ResourceDictionary Source="Styles/ImagePreviewControl.xaml" />
<styles:WinoExpanderStyle />
<!-- Last item must always be the default theme. -->
<ResourceDictionary Source="ms-appx:///Wino.Core.UWP/AppThemes/Mica.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

View File

@@ -381,6 +381,7 @@
x:Name="navigationView"
Grid.Row="1"
Grid.ColumnSpan="3"
Margin="-1,-1,0,0"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
AlwaysShowHeader="True"

View File

@@ -228,7 +228,7 @@
</Grid>
</wino:BasePage.ShellContent>
<Grid x:Name="RootGrid">
<Grid x:Name="RootGrid" Padding="0,2,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="MailListColumn" Width="{x:Bind ViewModel.MailListLength, Mode=OneWay, Converter={StaticResource GridLengthConverter}}" />
<ColumnDefinition x:Name="RendererColumn" Width="*" />
@@ -506,6 +506,7 @@
</Grid>
</Border>
<toolkit:PropertySizer
x:Name="MailListSizer"
Grid.Column="1"
@@ -531,7 +532,8 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Opacity="0.5"
Spacing="6">
Spacing="6"
Visibility="{x:Bind helpers:XamlHelpers.ReverseBoolToVisibilityConverter(ViewModel.ThemeService.IsCustomTheme)}">
<coreControls:WinoFontIcon FontSize="80" Icon="Mail" />