From 4757fd5b685530b8933820c9ae7c76ca254fdf8c Mon Sep 17 00:00:00 2001 From: "DESKTOP-3BO4HSG\\ksat" Date: Wed, 28 Dec 2022 13:32:02 +0800 Subject: [PATCH] feat: add theme switching function --- STranslate/App.xaml | 3 +- STranslate/MainWindow.xaml | 86 +++------ STranslate/MainWindow.xaml.cs | 12 ++ STranslate/STranslate.csproj | 28 ++- STranslate/Style/Dark.xaml | 9 + .../Style/Dark/DictionaryButtonDark.xaml | 71 +++++++ .../Style/Dark/DictionaryComboBoxDark.xaml | 176 ++++++++++++++++++ .../Style/Dark/DictionaryCommonDark.xaml | 68 +++++++ STranslate/Style/Default.xaml | 9 + .../DictionaryButtonDefault.xaml | 0 .../DictionaryComboBoxDefault.xaml | 0 .../Default/DictionaryCommonDefault.xaml | 64 +++++++ STranslate/ViewModel/MainVM.cs | 6 +- 13 files changed, 468 insertions(+), 64 deletions(-) create mode 100644 STranslate/Style/Dark.xaml create mode 100644 STranslate/Style/Dark/DictionaryButtonDark.xaml create mode 100644 STranslate/Style/Dark/DictionaryComboBoxDark.xaml create mode 100644 STranslate/Style/Dark/DictionaryCommonDark.xaml create mode 100644 STranslate/Style/Default.xaml rename STranslate/Style/{ => Default}/DictionaryButtonDefault.xaml (100%) rename STranslate/Style/{ => Default}/DictionaryComboBoxDefault.xaml (100%) create mode 100644 STranslate/Style/Default/DictionaryCommonDefault.xaml diff --git a/STranslate/App.xaml b/STranslate/App.xaml index d92fa00..310d543 100644 --- a/STranslate/App.xaml +++ b/STranslate/App.xaml @@ -5,8 +5,7 @@ - - + diff --git a/STranslate/MainWindow.xaml b/STranslate/MainWindow.xaml index 240487d..ec1e986 100644 --- a/STranslate/MainWindow.xaml +++ b/STranslate/MainWindow.xaml @@ -4,7 +4,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:STranslate.ViewModel" - xmlns:model="clr-namespace:STranslate.Model" mc:Ignorable="d" Background="Transparent" WindowStartupLocation="CenterScreen" @@ -19,19 +18,12 @@ SizeToContent="Height" Width="400" Icon="/Images/translate.ico"> - + - - - - - - + + @@ -65,7 +57,13 @@ - + + Style="{DynamicResource BorderInOutputStyle}"> @@ -105,18 +89,15 @@ -