From abc7f3f3fb14b974e489fa9cdfaaccf37103deab Mon Sep 17 00:00:00 2001 From: Niels Laute Date: Tue, 19 Aug 2025 16:40:41 +0200 Subject: [PATCH] UI tweaks in Settings --- .../DarkModeBoolToVisibilityConverter.cs | 23 -- .../Converters/DarkModeInvertBoolean.cs | 23 -- .../DarkModeInvertBooleanConverter.cs | 26 --- .../SettingsXAML/Views/DarkModePage.xaml | 210 +++++++++--------- .../SettingsXAML/Views/DarkModePage.xaml.cs | 4 +- .../Views/RegistryPreviewPage.xaml | 3 - .../Settings.UI/Strings/en-us/Resources.resw | 3 + 7 files changed, 114 insertions(+), 178 deletions(-) delete mode 100644 src/settings-ui/Settings.UI/Converters/DarkModeBoolToVisibilityConverter.cs delete mode 100644 src/settings-ui/Settings.UI/Converters/DarkModeInvertBoolean.cs delete mode 100644 src/settings-ui/Settings.UI/Converters/DarkModeInvertBooleanConverter.cs diff --git a/src/settings-ui/Settings.UI/Converters/DarkModeBoolToVisibilityConverter.cs b/src/settings-ui/Settings.UI/Converters/DarkModeBoolToVisibilityConverter.cs deleted file mode 100644 index 1bd8e97168..0000000000 --- a/src/settings-ui/Settings.UI/Converters/DarkModeBoolToVisibilityConverter.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation -// The Microsoft Corporation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Data; - -namespace Microsoft.PowerToys.Settings.UI.Converters -{ - public sealed partial class DarkModeBoolToVisibilityConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, string language) - { - return value is bool b && b ? Visibility.Visible : Visibility.Collapsed; - } - - public object ConvertBack(object value, Type targetType, object parameter, string language) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/settings-ui/Settings.UI/Converters/DarkModeInvertBoolean.cs b/src/settings-ui/Settings.UI/Converters/DarkModeInvertBoolean.cs deleted file mode 100644 index d65f2177c5..0000000000 --- a/src/settings-ui/Settings.UI/Converters/DarkModeInvertBoolean.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation -// The Microsoft Corporation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Data; - -namespace Microsoft.PowerToys.Settings.UI.Converters -{ - public sealed partial class InvertBooleanToVisibilityConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, string language) - { - return value is bool b && !b ? Visibility.Visible : Visibility.Collapsed; - } - - public object ConvertBack(object value, Type targetType, object parameter, string language) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/settings-ui/Settings.UI/Converters/DarkModeInvertBooleanConverter.cs b/src/settings-ui/Settings.UI/Converters/DarkModeInvertBooleanConverter.cs deleted file mode 100644 index 75d79d015f..0000000000 --- a/src/settings-ui/Settings.UI/Converters/DarkModeInvertBooleanConverter.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation -// The Microsoft Corporation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.UI.Xaml.Data; - -namespace Microsoft.PowerToys.Settings.UI.Converters -{ - public sealed partial class DarkModeInvertBooleanConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, string language) - { - return value is bool b ? !b : value; - } - - public object ConvertBack(object value, Type targetType, object parameter, string language) - { - return value is bool b ? !b : value; - } - } -} diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/DarkModePage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/DarkModePage.xaml index 3e64a3f514..8e7ef03cac 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/DarkModePage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/DarkModePage.xaml @@ -1,121 +1,129 @@ - + - - - - - + + + - + + + + + + - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + +