New setting options.
This commit is contained in:
@@ -65,7 +65,6 @@ public sealed partial class App : WinoApplication, IRecipient<NewCalendarSynchro
|
|||||||
{
|
{
|
||||||
services.AddSingleton<INavigationService, NavigationService>();
|
services.AddSingleton<INavigationService, NavigationService>();
|
||||||
services.AddSingleton<ICalendarDialogService, DialogService>();
|
services.AddSingleton<ICalendarDialogService, DialogService>();
|
||||||
services.AddTransient<ISettingsBuilderService, SettingsBuilderService>();
|
|
||||||
services.AddTransient<IProviderService, ProviderService>();
|
services.AddTransient<IProviderService, ProviderService>();
|
||||||
services.AddSingleton<IAuthenticatorConfig, CalendarAuthenticatorConfig>();
|
services.AddSingleton<IAuthenticatorConfig, CalendarAuthenticatorConfig>();
|
||||||
services.AddSingleton<IAccountCalendarStateService, AccountCalendarStateService>();
|
services.AddSingleton<IAccountCalendarStateService, AccountCalendarStateService>();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,8 +0,0 @@
|
|||||||
namespace Wino.Core.Domain.Enums;
|
|
||||||
|
|
||||||
public enum SettingOptionCategory
|
|
||||||
{
|
|
||||||
General,
|
|
||||||
Mail,
|
|
||||||
Calendar
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using Wino.Core.Domain.Models.Settings;
|
|
||||||
|
|
||||||
namespace Wino.Core.Domain.Interfaces;
|
|
||||||
|
|
||||||
public interface ISettingsBuilderService
|
|
||||||
{
|
|
||||||
List<SettingOption> GetSettingItems();
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
using Wino.Core.Domain.Enums;
|
|
||||||
|
|
||||||
namespace Wino.Core.Domain.Models.Settings;
|
|
||||||
|
|
||||||
public record SettingOption(string Title, string Description, WinoPage NavigationPage, SettingOptionCategory Category, string PathIcon);
|
|
||||||
@@ -63,6 +63,7 @@
|
|||||||
"Buttons_Edit": "Edit",
|
"Buttons_Edit": "Edit",
|
||||||
"Buttons_EnableImageRendering": "Enable",
|
"Buttons_EnableImageRendering": "Enable",
|
||||||
"Buttons_Multiselect": "Select Multiple",
|
"Buttons_Multiselect": "Select Multiple",
|
||||||
|
"Buttons_Manage": "Manage",
|
||||||
"Buttons_No": "No",
|
"Buttons_No": "No",
|
||||||
"Buttons_Open": "Open",
|
"Buttons_Open": "Open",
|
||||||
"Buttons_Purchase": "Purchase",
|
"Buttons_Purchase": "Purchase",
|
||||||
@@ -623,6 +624,10 @@
|
|||||||
"SettingsNotificationsAndTaskbar_Description": "Change whether notifications should be displayed and taskbar badge for this account.",
|
"SettingsNotificationsAndTaskbar_Description": "Change whether notifications should be displayed and taskbar badge for this account.",
|
||||||
"SettingsNotificationsAndTaskbar_Title": "Notifications & Taskbar",
|
"SettingsNotificationsAndTaskbar_Title": "Notifications & Taskbar",
|
||||||
"SettingsOptions_Title": "Settings",
|
"SettingsOptions_Title": "Settings",
|
||||||
|
"SettingsOptions_GeneralSection": "General",
|
||||||
|
"SettingsOptions_MailSection": "Mail",
|
||||||
|
"SettingsOptions_CalendarSection": "Calendar",
|
||||||
|
"SettingsOptions_MoreComingSoon": "More options coming soon",
|
||||||
"SettingsPaneLengthReset_Description": "Reset the size of the mail list to original if you have issues with it.",
|
"SettingsPaneLengthReset_Description": "Reset the size of the mail list to original if you have issues with it.",
|
||||||
"SettingsPaneLengthReset_Title": "Reset Mail List Size",
|
"SettingsPaneLengthReset_Title": "Reset Mail List Size",
|
||||||
"SettingsPaypal_Description": "Show much more love ❤️ All donations are appreciated.",
|
"SettingsPaypal_Description": "Show much more love ❤️ All donations are appreciated.",
|
||||||
|
|||||||
@@ -1,23 +1,14 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using CommunityToolkit.Mvvm.Collections;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using CommunityToolkit.Mvvm.Messaging;
|
using CommunityToolkit.Mvvm.Messaging;
|
||||||
using Wino.Core.Domain;
|
using Wino.Core.Domain;
|
||||||
using Wino.Core.Domain.Enums;
|
using Wino.Core.Domain.Enums;
|
||||||
using Wino.Core.Domain.Interfaces;
|
|
||||||
using Wino.Core.Domain.Models.Settings;
|
|
||||||
using Wino.Messaging.Client.Navigation;
|
using Wino.Messaging.Client.Navigation;
|
||||||
|
|
||||||
namespace Wino.Core.ViewModels;
|
namespace Wino.Core.ViewModels;
|
||||||
|
|
||||||
public partial class SettingOptionsPageViewModel : CoreBaseViewModel
|
public partial class SettingOptionsPageViewModel : CoreBaseViewModel
|
||||||
{
|
{
|
||||||
private readonly ISettingsBuilderService _settingsBuilderService;
|
|
||||||
private readonly ObservableGroupedCollection<SettingOptionCategory, SettingOption> _internalGroupedSettings;
|
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
private void GoAccountSettings() => Messenger.Send<NavigateManageAccountsRequested>();
|
private void GoAccountSettings() => Messenger.Send<NavigateManageAccountsRequested>();
|
||||||
|
|
||||||
@@ -49,28 +40,4 @@ public partial class SettingOptionsPageViewModel : CoreBaseViewModel
|
|||||||
Messenger.Send(new BreadcrumbNavigationRequested(pageTitle, pageType));
|
Messenger.Send(new BreadcrumbNavigationRequested(pageTitle, pageType));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
public partial ReadOnlyObservableGroupedCollection<SettingOptionCategory, SettingOption> SettingOptions { get; set; }
|
|
||||||
|
|
||||||
public SettingOptionsPageViewModel(ISettingsBuilderService settingsBuilderService)
|
|
||||||
{
|
|
||||||
_settingsBuilderService = settingsBuilderService;
|
|
||||||
_internalGroupedSettings = new ObservableGroupedCollection<SettingOptionCategory, SettingOption>();
|
|
||||||
SettingOptions = new ReadOnlyObservableGroupedCollection<SettingOptionCategory, SettingOption>(_internalGroupedSettings);
|
|
||||||
|
|
||||||
ReloadSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ReloadSettings()
|
|
||||||
{
|
|
||||||
var settings = _settingsBuilderService.GetSettingItems();
|
|
||||||
var grouped = settings.GroupBy(x => x.Category);
|
|
||||||
|
|
||||||
_internalGroupedSettings.Clear();
|
|
||||||
foreach (var group in grouped)
|
|
||||||
{
|
|
||||||
_internalGroupedSettings.AddGroup(group.Key, group);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ public partial class App : WinoApplication,
|
|||||||
{
|
{
|
||||||
services.AddSingleton<INavigationService, NavigationService>();
|
services.AddSingleton<INavigationService, NavigationService>();
|
||||||
services.AddSingleton<IMailDialogService, DialogService>();
|
services.AddSingleton<IMailDialogService, DialogService>();
|
||||||
services.AddTransient<ISettingsBuilderService, SettingsBuilderService>();
|
|
||||||
services.AddTransient<IProviderService, ProviderService>();
|
services.AddTransient<IProviderService, ProviderService>();
|
||||||
services.AddSingleton<IAuthenticatorConfig, MailAuthenticatorConfiguration>();
|
services.AddSingleton<IAuthenticatorConfig, MailAuthenticatorConfiguration>();
|
||||||
services.AddSingleton<IAccountCalendarStateService, AccountCalendarStateService>();
|
services.AddSingleton<IAccountCalendarStateService, AccountCalendarStateService>();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -3,76 +3,487 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:abstract="using:Wino.Views.Abstract"
|
xmlns:abstract="using:Wino.Views.Abstract"
|
||||||
xmlns:collections="using:CommunityToolkit.Mvvm.Collections"
|
|
||||||
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:domain="using:Wino.Core.Domain"
|
xmlns:domain="using:Wino.Core.Domain"
|
||||||
xmlns:enums="using:Wino.Core.Domain.Enums"
|
xmlns:enums="using:Wino.Core.Domain.Enums"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:settings="using:Wino.Core.Domain.Models.Settings"
|
|
||||||
xmlns:translations="using:Wino.Core.Domain.Models.Translations"
|
|
||||||
x:Name="root"
|
x:Name="root"
|
||||||
Title="{x:Bind domain:Translator.SettingsOptions_Title}"
|
Title="{x:Bind domain:Translator.SettingsOptions_Title}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Page.Resources>
|
<ScrollViewer Padding="0,0,16,0" VerticalScrollBarVisibility="Auto">
|
||||||
<CollectionViewSource
|
<StackPanel Margin="0,8,0,24" Spacing="16">
|
||||||
x:Name="GroupedSettingsSource"
|
<StackPanel.ChildrenTransitions>
|
||||||
IsSourceGrouped="True"
|
<TransitionCollection>
|
||||||
Source="{x:Bind ViewModel.SettingOptions, Mode=OneWay}" />
|
<EntranceThemeTransition FromVerticalOffset="50" IsStaggeringEnabled="True" />
|
||||||
</Page.Resources>
|
</TransitionCollection>
|
||||||
|
</StackPanel.ChildrenTransitions>
|
||||||
|
|
||||||
<ListView
|
<!-- Hero Account Card - Prominent at top -->
|
||||||
HorizontalAlignment="Stretch"
|
<Grid
|
||||||
ItemsSource="{x:Bind GroupedSettingsSource.View, Mode=OneWay}"
|
Padding="20"
|
||||||
SelectionMode="None">
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
<ListView.ItemTemplate>
|
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||||
<DataTemplate x:DataType="settings:SettingOption">
|
BorderThickness="1"
|
||||||
<controls:SettingsCard
|
CornerRadius="8">
|
||||||
Margin="0,2"
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Border
|
||||||
|
Width="56"
|
||||||
|
Height="56"
|
||||||
|
CornerRadius="28">
|
||||||
|
<FontIcon
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="24"
|
||||||
|
Foreground="{ThemeResource TextOnAccentAAFillColorDisabledBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<StackPanel
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="16,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Spacing="2">
|
||||||
|
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Text="{x:Bind domain:Translator.SettingsManageAccountSettings_Title}" />
|
||||||
|
<TextBlock
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsManageAccountSettings_Description}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
Click="SettingOptionClicked"
|
Click="SettingOptionClicked"
|
||||||
CommandParameter="{x:Bind NavigationPage}"
|
Style="{StaticResource AccentButtonStyle}"
|
||||||
Description="{x:Bind Description}"
|
Tag="{x:Bind enums:WinoPage.AccountManagementPage}">
|
||||||
Header="{x:Bind Title}"
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
IsClickEnabled="True">
|
<TextBlock Text="{x:Bind domain:Translator.Buttons_Manage}" />
|
||||||
<controls:SettingsCard.HeaderIcon>
|
<FontIcon FontSize="12" Glyph="" />
|
||||||
<PathIcon Data="{x:Bind PathIcon}" />
|
</StackPanel>
|
||||||
</controls:SettingsCard.HeaderIcon>
|
</Button>
|
||||||
</controls:SettingsCard>
|
</Grid>
|
||||||
</DataTemplate>
|
|
||||||
</ListView.ItemTemplate>
|
|
||||||
<ListView.GroupStyle>
|
|
||||||
<GroupStyle>
|
|
||||||
<GroupStyle.HeaderTemplate>
|
|
||||||
<DataTemplate x:DataType="collections:IReadOnlyObservableGroup">
|
|
||||||
<TextBlock
|
|
||||||
FontSize="14"
|
|
||||||
FontWeight="SemiBold"
|
|
||||||
Text="{x:Bind Key.ToString()}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</GroupStyle.HeaderTemplate>
|
|
||||||
</GroupStyle>
|
|
||||||
</ListView.GroupStyle>
|
|
||||||
</ListView>
|
|
||||||
|
|
||||||
<!--<ScrollViewer VerticalScrollBarVisibility="Hidden">
|
<!-- General Settings Card -->
|
||||||
<ItemsControl ItemsSource="{x:Bind ViewModel.SettingOptions, Mode=OneWay}">
|
<Grid
|
||||||
<ItemsControl.ItemTemplate>
|
Padding="20"
|
||||||
<DataTemplate x:DataType="settings:SettingOption">
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
<controls:SettingsCard
|
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||||
Margin="0,2"
|
BorderThickness="1"
|
||||||
|
CornerRadius="8">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- General Header -->
|
||||||
|
<StackPanel
|
||||||
|
Margin="0,0,0,16"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="12">
|
||||||
|
<Border
|
||||||
|
Width="40"
|
||||||
|
Height="40"
|
||||||
|
Background="{ThemeResource SystemFillColorNeutralBackgroundBrush}"
|
||||||
|
CornerRadius="8">
|
||||||
|
<FontIcon
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="18"
|
||||||
|
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Border>
|
||||||
|
<TextBlock
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsOptions_GeneralSection}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- General Options -->
|
||||||
|
<StackPanel Grid.Row="1" Spacing="2">
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
Click="SettingOptionClicked"
|
Click="SettingOptionClicked"
|
||||||
CommandParameter="{x:Bind NavigationPage}"
|
CornerRadius="4"
|
||||||
Description="{x:Bind Description}"
|
Tag="{x:Bind enums:WinoPage.AppPreferencesPage}">
|
||||||
Header="{x:Bind Title}"
|
<Grid Padding="4,10" ColumnSpacing="12">
|
||||||
IsClickEnabled="True">
|
<Grid.ColumnDefinitions>
|
||||||
<controls:SettingsCard.HeaderIcon>
|
<ColumnDefinition Width="Auto" />
|
||||||
<PathIcon Data="{x:Bind PathIcon}" />
|
<ColumnDefinition Width="*" />
|
||||||
</controls:SettingsCard.HeaderIcon>
|
<ColumnDefinition Width="Auto" />
|
||||||
</controls:SettingsCard>
|
</Grid.ColumnDefinitions>
|
||||||
</DataTemplate>
|
<FontIcon
|
||||||
</ItemsControl.ItemTemplate>
|
VerticalAlignment="Center"
|
||||||
</ItemsControl>
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsAppPreferences_Title}" />
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="12"
|
||||||
|
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
</ScrollViewer>-->
|
<Button
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
Click="SettingOptionClicked"
|
||||||
|
CornerRadius="4"
|
||||||
|
Tag="{x:Bind enums:WinoPage.LanguageTimePage}">
|
||||||
|
<Grid Padding="4,10" ColumnSpacing="12">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<FontIcon
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsLanguageTime_Title}" />
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="12"
|
||||||
|
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
Click="SettingOptionClicked"
|
||||||
|
CornerRadius="4"
|
||||||
|
Tag="{x:Bind enums:WinoPage.PersonalizationPage}">
|
||||||
|
<Grid Padding="4,10" ColumnSpacing="12">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<FontIcon
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsPersonalization_Title}" />
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="12"
|
||||||
|
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
Click="SettingOptionClicked"
|
||||||
|
CornerRadius="4"
|
||||||
|
Tag="{x:Bind enums:WinoPage.AboutPage}">
|
||||||
|
<Grid Padding="4,10" ColumnSpacing="12">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<FontIcon
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsAbout_Title}" />
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="12"
|
||||||
|
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Two-Column Layout for Mail & Calendar -->
|
||||||
|
<Grid ColumnSpacing="16">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- Mail Settings Card -->
|
||||||
|
<Grid
|
||||||
|
Grid.Column="0"
|
||||||
|
Padding="20"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="8">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- Mail Header -->
|
||||||
|
<StackPanel
|
||||||
|
Margin="0,0,0,16"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="12">
|
||||||
|
<Border
|
||||||
|
Width="40"
|
||||||
|
Height="40"
|
||||||
|
Background="{ThemeResource SystemFillColorNeutralBackgroundBrush}"
|
||||||
|
CornerRadius="8">
|
||||||
|
<FontIcon
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="18"
|
||||||
|
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Border>
|
||||||
|
<TextBlock
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsOptions_MailSection}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- Mail Options -->
|
||||||
|
<StackPanel Grid.Row="1" Spacing="2">
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
Click="SettingOptionClicked"
|
||||||
|
CornerRadius="4"
|
||||||
|
Tag="{x:Bind enums:WinoPage.KeyboardShortcutsPage}">
|
||||||
|
<Grid Padding="4,10" ColumnSpacing="12">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<FontIcon
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Bind domain:Translator.Settings_KeyboardShortcuts_Title}" />
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="12"
|
||||||
|
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
Click="SettingOptionClicked"
|
||||||
|
CornerRadius="4"
|
||||||
|
Tag="{x:Bind enums:WinoPage.MessageListPage}">
|
||||||
|
<Grid Padding="4,10" ColumnSpacing="12">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<FontIcon
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsMessageList_Title}" />
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="12"
|
||||||
|
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
Click="SettingOptionClicked"
|
||||||
|
CornerRadius="4"
|
||||||
|
Tag="{x:Bind enums:WinoPage.ReadComposePanePage}">
|
||||||
|
<Grid Padding="4,10" ColumnSpacing="12">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<FontIcon
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsReadComposePane_Title}" />
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="12"
|
||||||
|
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
Click="SettingOptionClicked"
|
||||||
|
CornerRadius="4"
|
||||||
|
Tag="{x:Bind enums:WinoPage.SignatureAndEncryptionPage}">
|
||||||
|
<Grid Padding="4,10" ColumnSpacing="12">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<FontIcon
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsSignatureAndEncryption_Title}" />
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="12"
|
||||||
|
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<!-- Calendar Settings Card -->
|
||||||
|
<Grid
|
||||||
|
Grid.Column="1"
|
||||||
|
Padding="20"
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="8">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!-- Calendar Header -->
|
||||||
|
<StackPanel
|
||||||
|
Margin="0,0,0,16"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="12">
|
||||||
|
<Border
|
||||||
|
Width="40"
|
||||||
|
Height="40"
|
||||||
|
Background="{ThemeResource SystemFillColorNeutralBackgroundBrush}"
|
||||||
|
CornerRadius="8">
|
||||||
|
<FontIcon
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="18"
|
||||||
|
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Border>
|
||||||
|
<TextBlock
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsOptions_CalendarSection}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- Calendar Options -->
|
||||||
|
<StackPanel Grid.Row="1" Spacing="2">
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
Background="Transparent"
|
||||||
|
BorderThickness="0"
|
||||||
|
Click="SettingOptionClicked"
|
||||||
|
CornerRadius="4"
|
||||||
|
Tag="{x:Bind enums:WinoPage.CalendarSettingsPage}">
|
||||||
|
<Grid Padding="4,10" ColumnSpacing="12">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<FontIcon
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="16"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{x:Bind domain:Translator.SettingsCalendarSettings_Title}" />
|
||||||
|
<FontIcon
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="12"
|
||||||
|
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
|
||||||
|
Glyph="" />
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
</abstract:SettingOptionsPageAbstract>
|
</abstract:SettingOptionsPageAbstract>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using CommunityToolkit.WinUI.Controls;
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Wino.Core.Domain.Enums;
|
using Wino.Core.Domain.Enums;
|
||||||
using Wino.Views.Abstract;
|
using Wino.Views.Abstract;
|
||||||
|
|
||||||
@@ -11,8 +12,17 @@ public sealed partial class SettingOptionsPage : SettingOptionsPageAbstract
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SettingOptionClicked(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
private void SettingOptionClicked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is SettingsCard card && card.CommandParameter is WinoPage page) ViewModel.NavigateSubDetailCommand.Execute(page);
|
WinoPage? page = sender switch
|
||||||
|
{
|
||||||
|
Button button when button.Tag is WinoPage p => p,
|
||||||
|
_ => null
|
||||||
|
};
|
||||||
|
|
||||||
|
if (page.HasValue)
|
||||||
|
{
|
||||||
|
ViewModel.NavigateSubDetailCommand.Execute(page.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user