diff --git a/src/modules/poweraccent/PowerAccent.UI/App.xaml b/src/modules/poweraccent/PowerAccent.UI/App.xaml index abc58f7b3e..aabf3459af 100644 --- a/src/modules/poweraccent/PowerAccent.UI/App.xaml +++ b/src/modules/poweraccent/PowerAccent.UI/App.xaml @@ -2,15 +2,14 @@ x:Class="PowerAccent.UI.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="clr-namespace:PowerAccent" - xmlns:ui="http://schemas.modernwpf.com/2019" + xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" StartupUri="Selector.xaml"> - - + + diff --git a/src/modules/poweraccent/PowerAccent.UI/App.xaml.cs b/src/modules/poweraccent/PowerAccent.UI/App.xaml.cs index af3ff38db9..1ae590ce88 100644 --- a/src/modules/poweraccent/PowerAccent.UI/App.xaml.cs +++ b/src/modules/poweraccent/PowerAccent.UI/App.xaml.cs @@ -5,9 +5,7 @@ using System; using System.Threading; using System.Windows; -using Common.UI; using ManagedCommon; -using PowerAccent.Core.Tools; namespace PowerAccent.UI { @@ -18,7 +16,6 @@ namespace PowerAccent.UI { private static Mutex _mutex; private bool _disposed; - private ThemeManager _themeManager; protected override void OnStartup(StartupEventArgs e) { @@ -30,7 +27,6 @@ namespace PowerAccent.UI Application.Current.Shutdown(); } - _themeManager = new ThemeManager(this); base.OnStartup(e); } @@ -50,7 +46,6 @@ namespace PowerAccent.UI if (disposing) { _mutex?.Dispose(); - _themeManager?.Dispose(); } _disposed = true; diff --git a/src/modules/poweraccent/PowerAccent.UI/PowerAccent.UI.csproj b/src/modules/poweraccent/PowerAccent.UI/PowerAccent.UI.csproj index b459272213..be88b83789 100644 --- a/src/modules/poweraccent/PowerAccent.UI/PowerAccent.UI.csproj +++ b/src/modules/poweraccent/PowerAccent.UI/PowerAccent.UI.csproj @@ -35,7 +35,7 @@ - + diff --git a/src/modules/poweraccent/PowerAccent.UI/Program.cs b/src/modules/poweraccent/PowerAccent.UI/Program.cs index 9ca3de95be..d45b7c601c 100644 --- a/src/modules/poweraccent/PowerAccent.UI/Program.cs +++ b/src/modules/poweraccent/PowerAccent.UI/Program.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using System.Windows; using interop; using ManagedCommon; -using PowerAccent.Core.Tools; namespace PowerAccent.UI; diff --git a/src/modules/poweraccent/PowerAccent.UI/Selector.xaml b/src/modules/poweraccent/PowerAccent.UI/Selector.xaml index 1f30d628e2..1396528383 100644 --- a/src/modules/poweraccent/PowerAccent.UI/Selector.xaml +++ b/src/modules/poweraccent/PowerAccent.UI/Selector.xaml @@ -1,30 +1,30 @@ - - + @@ -33,101 +33,89 @@ - + - + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - + + + + - + \ No newline at end of file diff --git a/src/modules/poweraccent/PowerAccent.UI/Selector.xaml.cs b/src/modules/poweraccent/PowerAccent.UI/Selector.xaml.cs index f83e20c037..14df70a72f 100644 --- a/src/modules/poweraccent/PowerAccent.UI/Selector.xaml.cs +++ b/src/modules/poweraccent/PowerAccent.UI/Selector.xaml.cs @@ -5,13 +5,13 @@ using System; using System.ComponentModel; using System.Windows; -using PowerAccent.Core.Services; +using Wpf.Ui.Controls; using Point = PowerAccent.Core.Point; using Size = PowerAccent.Core.Size; namespace PowerAccent.UI; -public partial class Selector : Window, IDisposable, INotifyPropertyChanged +public partial class Selector : FluentWindow, IDisposable, INotifyPropertyChanged { private readonly Core.PowerAccent _powerAccent = new(); @@ -38,6 +38,7 @@ public partial class Selector : Window, IDisposable, INotifyPropertyChanged public Selector() { InitializeComponent(); + Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this); Application.Current.MainWindow.ShowActivated = false; Application.Current.MainWindow.Topmost = true; } @@ -67,7 +68,6 @@ public partial class Selector : Window, IDisposable, INotifyPropertyChanged characters.SelectedIndex = _selectedIndex; this.UpdateLayout(); // Required for filling the actual width/height before positioning. SetWindowPosition(); - SetWindowAlignment(); Show(); Microsoft.PowerToys.Telemetry.PowerToysTelemetry.Log.WriteEvent(new PowerAccent.Core.Telemetry.PowerAccentShowAccentMenuEvent()); } @@ -90,17 +90,6 @@ public partial class Selector : Window, IDisposable, INotifyPropertyChanged this.Top = position.Y; } - private void SetWindowAlignment() - { - gridBorder.HorizontalAlignment = _powerAccent.GetToolbarPosition() switch - { - Position.Left or Position.TopLeft or Position.BottomLeft => HorizontalAlignment.Left, - Position.Right or Position.TopRight or Position.BottomRight => HorizontalAlignment.Right, - Position.Center or Position.Top or Position.Bottom => HorizontalAlignment.Center, - _ => HorizontalAlignment.Center, - }; - } - protected override void OnClosed(EventArgs e) { _powerAccent.Dispose(); diff --git a/src/modules/poweraccent/PowerAccent.UI/Themes/Dark.xaml b/src/modules/poweraccent/PowerAccent.UI/Themes/Dark.xaml deleted file mode 100644 index 07ed9f95ce..0000000000 --- a/src/modules/poweraccent/PowerAccent.UI/Themes/Dark.xaml +++ /dev/null @@ -1,32 +0,0 @@ - - - - Dark.Accent1 - PowerToysRun - Accent1 (Dark) - Dark - Accent1 - Black - - - - - - - - \ No newline at end of file diff --git a/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrast1.xaml b/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrast1.xaml deleted file mode 100644 index 42d269d7fe..0000000000 --- a/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrast1.xaml +++ /dev/null @@ -1,26 +0,0 @@ - - - - HighContrast.Accent2 - PowerToysRun - Accent2 (HighContrast) - HighContrast - Accent2 - White - - - - - - - - \ No newline at end of file diff --git a/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrast2.xaml b/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrast2.xaml deleted file mode 100644 index 825f0267bf..0000000000 --- a/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrast2.xaml +++ /dev/null @@ -1,26 +0,0 @@ - - - - HighContrast.Accent3 - PowerToysRun - Accent3 (HighContrast) - HighContrast - Accent3 - White - - - - - - - - \ No newline at end of file diff --git a/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrastBlack.xaml b/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrastBlack.xaml deleted file mode 100644 index eee95d5823..0000000000 --- a/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrastBlack.xaml +++ /dev/null @@ -1,26 +0,0 @@ - - - - HighContrast.Accent4 - PowerToysRun - Accent4 (HighContrast) - HighContrast - Accent4 - White - - - - - - - - \ No newline at end of file diff --git a/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrastWhite.xaml b/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrastWhite.xaml deleted file mode 100644 index 5a9f6df8ab..0000000000 --- a/src/modules/poweraccent/PowerAccent.UI/Themes/HighContrastWhite.xaml +++ /dev/null @@ -1,26 +0,0 @@ - - - - HighContrast.Accent5 - PowerToysRun - Accent5 (HighContrast) - HighContrast - Accent5 - White - - - - - - - - \ No newline at end of file diff --git a/src/modules/poweraccent/PowerAccent.UI/Themes/Light.xaml b/src/modules/poweraccent/PowerAccent.UI/Themes/Light.xaml deleted file mode 100644 index 22f8213eee..0000000000 --- a/src/modules/poweraccent/PowerAccent.UI/Themes/Light.xaml +++ /dev/null @@ -1,35 +0,0 @@ - - - - Light.Accent1 - PowerToysRun - Accent1 (Light) - Light - Accent1 - White - - - - - - - - \ No newline at end of file