From 765a06121e6056479b9f522ff4c6c2c8b89a4273 Mon Sep 17 00:00:00 2001 From: Thomas May Date: Tue, 10 Sep 2024 15:57:06 +0100 Subject: [PATCH] Initial Themes 2.0 work --- Unicord.Universal/App.xaml | 37 +- Unicord.Universal/App.xaml.cs | 6 +- .../Commands/Users/ShowUserOverlayCommand.cs | 12 +- .../Channels/ChannelPageHeaderControl.xaml | 35 +- .../Channels/ChannelPageHeaderControl.xaml.cs | 8 +- .../Dialogs/ProfileOverlay.xaml.cs | 4 +- Unicord.Universal/MainPage.xaml | 99 ++-- Unicord.Universal/MainPage.xaml.cs | 80 +--- .../Models/Channels/ChannelPageViewModel.cs | 2 +- .../Channels/ChannelPageViewModelBase.cs | 41 ++ .../Models/Channels/ForumChannelViewModel.cs | 4 +- .../Models/Messages/MessageViewModel.cs | 2 + .../Models/SearchPageViewModel.cs | 39 +- Unicord.Universal/Models/ViewModelbase.cs | 21 +- Unicord.Universal/Pages/ChannelPage.xaml | 10 +- Unicord.Universal/Pages/ChannelPage.xaml.cs | 10 +- Unicord.Universal/Pages/DiscordPage.xaml | 424 ++++++++++-------- Unicord.Universal/Pages/DiscordPage.xaml.cs | 69 +-- .../Pages/Overlay/UserInfoOverlayPage.xaml | 13 + .../Pages/Overlay/UserInfoOverlayPage.xaml.cs | 42 ++ .../Pages/Settings/SettingsPage.xaml | 3 +- .../Pages/Subpages/FriendsPage.xaml | 17 +- .../Pages/Subpages/FriendsPage.xaml.cs | 15 +- .../Pages/Subpages/SearchPage.xaml.cs | 3 +- .../Pages/Subpages/UserListPage.xaml.cs | 14 +- .../Services/DiscordNavigationService.cs | 8 +- .../Services/SplitPaneService.cs | 160 +++++++ .../Services/SwipeOpenService.cs | 2 +- Unicord.Universal/Services/ThemeService.cs | 47 ++ Unicord.Universal/Themes/RS2.xaml | 9 - .../Themes/RS2/ContentDialog.xaml | 315 ------------- Unicord.Universal/Themes/Styles/Fluent.xaml | 114 +++++ .../Themes/Styles/Performance.xaml | 185 ++++++++ .../Themes/Styles/SunValley.xaml | 108 +++++ Unicord.Universal/Themes/ThemeResources.cs | 36 ++ Unicord.Universal/Unicord.Universal.csproj | 24 +- 36 files changed, 1174 insertions(+), 844 deletions(-) create mode 100644 Unicord.Universal/Models/Channels/ChannelPageViewModelBase.cs create mode 100644 Unicord.Universal/Pages/Overlay/UserInfoOverlayPage.xaml create mode 100644 Unicord.Universal/Pages/Overlay/UserInfoOverlayPage.xaml.cs create mode 100644 Unicord.Universal/Services/SplitPaneService.cs create mode 100644 Unicord.Universal/Services/ThemeService.cs delete mode 100644 Unicord.Universal/Themes/RS2.xaml delete mode 100644 Unicord.Universal/Themes/RS2/ContentDialog.xaml create mode 100644 Unicord.Universal/Themes/Styles/Fluent.xaml create mode 100644 Unicord.Universal/Themes/Styles/Performance.xaml create mode 100644 Unicord.Universal/Themes/Styles/SunValley.xaml create mode 100644 Unicord.Universal/Themes/ThemeResources.cs diff --git a/Unicord.Universal/App.xaml b/Unicord.Universal/App.xaml index 2d8efb63..3a60be30 100644 --- a/Unicord.Universal/App.xaml +++ b/Unicord.Universal/App.xaml @@ -30,14 +30,11 @@ - - + - - @@ -84,37 +81,7 @@ /Assets/FluentSystemIcons-Regular.ttf#FluentSystemIcons-Regular /Assets/SegoeIcons.ttf#Segoe Fluent Icons - - - - - - - - - - - - + \ No newline at end of file diff --git a/Unicord.Universal/App.xaml.cs b/Unicord.Universal/App.xaml.cs index 7c05b320..41d3aac1 100644 --- a/Unicord.Universal/App.xaml.cs +++ b/Unicord.Universal/App.xaml.cs @@ -55,8 +55,10 @@ sealed partial class App : Application private static TaskCompletionSource _readySource = new TaskCompletionSource(); internal static DiscordClient Discord { get; set; } - internal static ApplicationDataStorageHelper LocalSettings { get; } = ApplicationDataStorageHelper.GetCurrent(); - internal static ApplicationDataStorageHelper RoamingSettings { get; } = ApplicationDataStorageHelper.GetCurrent(); + internal static ApplicationDataStorageHelper LocalSettings { get; } + = ApplicationDataStorageHelper.GetCurrent(); + internal static ApplicationDataStorageHelper RoamingSettings { get; } + = ApplicationDataStorageHelper.GetCurrent(); public App() { diff --git a/Unicord.Universal/Commands/Users/ShowUserOverlayCommand.cs b/Unicord.Universal/Commands/Users/ShowUserOverlayCommand.cs index d19be548..f6e1de7d 100644 --- a/Unicord.Universal/Commands/Users/ShowUserOverlayCommand.cs +++ b/Unicord.Universal/Commands/Users/ShowUserOverlayCommand.cs @@ -7,6 +7,8 @@ using DSharpPlus.Entities; using Microsoft.AppCenter.Analytics; using Unicord.Universal.Models.User; +using Unicord.Universal.Pages.Overlay; +using Unicord.Universal.Services; using Windows.UI.Xaml; namespace Unicord.Universal.Commands.Users @@ -17,15 +19,11 @@ public ShowUserOverlayCommand(UserViewModel viewModel) : base(viewModel) { } - public override void Execute(object parameter) + public override async void Execute(object parameter) { // TODO: will probably be reworked - var page = Window.Current.Content.FindChild(); - if (page != null) - { - Analytics.TrackEvent("ShowUserOverlayCommand_Invoked"); - page.ShowUserOverlay(viewModel, true); - } + await OverlayService.GetForCurrentView() + .ShowOverlayAsync(viewModel); } } } diff --git a/Unicord.Universal/Controls/Channels/ChannelPageHeaderControl.xaml b/Unicord.Universal/Controls/Channels/ChannelPageHeaderControl.xaml index c1e857a7..6c1af40f 100644 --- a/Unicord.Universal/Controls/Channels/ChannelPageHeaderControl.xaml +++ b/Unicord.Universal/Controls/Channels/ChannelPageHeaderControl.xaml @@ -24,8 +24,9 @@ + Background="{ThemeResource ChannelPage_Header_Background}" + BorderBrush="{ThemeResource ChannelPage_Header_BorderBrush}" + BorderThickness="{StaticResource ChannelPage_Header_BorderThickness}"> @@ -54,9 +55,9 @@