From ae6b12600c2191d2eff4e78c979b26a22dde7094 Mon Sep 17 00:00:00 2001 From: Peter Kirmeier Date: Fri, 1 Sep 2023 17:34:42 +0200 Subject: [PATCH] Use global style for all windows Including foreground and background color, clear type rendering and using layout rounding --- Business/App.xaml | 3 +++ UserInterface/AboutBox.xaml | 3 ++- UserInterface/ColorPickerWindow.xaml | 4 ++-- UserInterface/HowToOpenSettingsWindow.xaml | 7 ++++--- UserInterface/Menu.xaml | 24 +++++++++------------- UserInterface/SettingsWindow.xaml | 3 ++- UserInterface/TaskbarLogo.xaml | 3 ++- UserInterface/UpdateWindow.xaml | 3 ++- 8 files changed, 27 insertions(+), 23 deletions(-) diff --git a/Business/App.xaml b/Business/App.xaml index 8039739..5e69573 100644 --- a/Business/App.xaml +++ b/Business/App.xaml @@ -24,6 +24,9 @@ diff --git a/UserInterface/Menu.xaml b/UserInterface/Menu.xaml index 1917bf0..eebe1d4 100644 --- a/UserInterface/Menu.xaml +++ b/UserInterface/Menu.xaml @@ -10,8 +10,9 @@ xmlns:u="clr-namespace:SystemTrayMenu.Utilities" xmlns:local="clr-namespace:SystemTrayMenu.UserInterface" x:Class="SystemTrayMenu.UserInterface.Menu" - mc:Ignorable="d" ResizeMode="NoResize" WindowStyle="None" Topmost="True" Background="Transparent" AllowsTransparency="True" SizeToContent="WidthAndHeight" ShowInTaskbar="False" SnapsToDevicePixels="True" UseLayoutRounding="True" - PreviewKeyDown="HandlePreviewKeyDown" d:MaxHeight="200"> + Style="{StaticResource {x:Type Window}}" mc:Ignorable="d" Background="Transparent" d:MaxHeight="200" + ResizeMode="NoResize" WindowStyle="None" Topmost="True" AllowsTransparency="True" SizeToContent="WidthAndHeight" ShowInTaskbar="False" SnapsToDevicePixels="True" + PreviewKeyDown="HandlePreviewKeyDown"> @@ -105,18 +106,14 @@ BorderBrush="{x:Static stm:MenuDefines.ColorBackgroundBorder}"> + Background="{x:Null}" Foreground="{x:Static stm:MenuDefines.ColorForeground}" CaretBrush="{x:Static stm:MenuDefines.ColorForeground}" /> @@ -143,8 +140,8 @@ - @@ -193,8 +190,7 @@ + Text="{Binding ColumnText}" Foreground="{x:Static stm:MenuDefines.ColorForeground}" /> diff --git a/UserInterface/SettingsWindow.xaml b/UserInterface/SettingsWindow.xaml index ab52696..7dedd2a 100644 --- a/UserInterface/SettingsWindow.xaml +++ b/UserInterface/SettingsWindow.xaml @@ -8,7 +8,8 @@ xmlns:stm="clr-namespace:SystemTrayMenu" xmlns:local="clr-namespace:SystemTrayMenu.UserInterface" x:Class="SystemTrayMenu.UserInterface.SettingsWindow" - mc:Ignorable="d" Title="{u:Translate 'Settings'}" Background="{x:Static stm:MenuDefines.ColorBackground}" WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight" MinWidth="200" MinHeight="250"> + Style="{StaticResource {x:Type Window}}" mc:Ignorable="d" d:Background="{x:Static stm:MenuDefines.ColorBackground}" + Title="{u:Translate 'Settings'}" WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight" MinWidth="200" MinHeight="250"> diff --git a/UserInterface/TaskbarLogo.xaml b/UserInterface/TaskbarLogo.xaml index 9a3b340..ca16a51 100644 --- a/UserInterface/TaskbarLogo.xaml +++ b/UserInterface/TaskbarLogo.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="SystemTrayMenu.UserInterface.TaskbarLogo" - mc:Ignorable="d" WindowStyle="None" ResizeMode="NoResize" Width="38" Height="38" Topmost="True" Background="Transparent" AllowsTransparency="True"> + Style="{StaticResource {x:Type Window}}" mc:Ignorable="d" Background="Transparent" + WindowStyle="None" ResizeMode="NoResize" Width="38" Height="38" Topmost="True" AllowsTransparency="True"> diff --git a/UserInterface/UpdateWindow.xaml b/UserInterface/UpdateWindow.xaml index c32a62e..f8d9b70 100644 --- a/UserInterface/UpdateWindow.xaml +++ b/UserInterface/UpdateWindow.xaml @@ -7,7 +7,8 @@ xmlns:u="clr-namespace:SystemTrayMenu.Utilities" xmlns:stm="clr-namespace:SystemTrayMenu" x:Class="SystemTrayMenu.UserInterface.UpdateWindow" - mc:Ignorable="d" Title="{u:Translate 'New version available!'}" Background="{x:Static stm:MenuDefines.ColorBackground}" WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight" MinWidth="600" MaxHeight="600" WindowStyle="ToolWindow" ShowInTaskbar="False"> + Style="{StaticResource {x:Type Window}}" mc:Ignorable="d" d:Background="{x:Static stm:MenuDefines.ColorBackground}" + Title="{u:Translate 'New version available!'}" WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight" MinWidth="600" MaxHeight="600" WindowStyle="ToolWindow" ShowInTaskbar="False">