From f2c2ed82a7bafe766f9c741a482a2a9bf8bb6937 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sat, 29 Apr 2023 02:23:36 +0800 Subject: [PATCH] =?UTF-8?q?style:=20C#=20=E7=BB=9F=E4=B8=80=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/App.xaml | 24 ++++--- src/MaaWpfGui/App.xaml.cs | 5 -- src/MaaWpfGui/Constants/MaaUrls.cs | 1 - .../HttpResponseLoggingExtension.cs | 2 +- src/MaaWpfGui/Helper/ConfigurationHelper.cs | 2 +- src/MaaWpfGui/Helper/ItemListHelper.cs | 5 +- src/MaaWpfGui/Helper/MessageBoxHelper.cs | 13 +++- src/MaaWpfGui/Helper/ThemeHelper.cs | 6 +- src/MaaWpfGui/Helper/ToastNotification.cs | 2 +- src/MaaWpfGui/Models/ArkItem.cs | 2 +- src/MaaWpfGui/Res/Localizations/en-us.xaml | 6 +- src/MaaWpfGui/Res/Localizations/ja-jp.xaml | 4 +- src/MaaWpfGui/Res/Localizations/ko-kr.xaml | 4 +- src/MaaWpfGui/Res/Localizations/zh-cn.xaml | 6 +- src/MaaWpfGui/Res/Localizations/zh-tw.xaml | 4 +- src/MaaWpfGui/Res/Themes/Dark.xaml | 27 ++++---- src/MaaWpfGui/Res/Themes/Geometries.xaml | 4 +- src/MaaWpfGui/Res/Themes/Light.xaml | 7 +- src/MaaWpfGui/Res/Themes/Markdig.xaml | 62 ++++++++--------- .../HotKeys/MaaHotKeyActionHandler.cs | 2 + src/MaaWpfGui/Services/Web/IHttpService.cs | 2 +- src/MaaWpfGui/Services/Web/IMaaApiService.cs | 2 +- .../ViewModels/UI/TaskQueueViewModel.cs | 1 - src/MaaWpfGui/Views/UI/CopilotView.xaml | 20 +++--- src/MaaWpfGui/Views/UI/ErrorView.xaml | 68 ++++++++++++------- src/MaaWpfGui/Views/UI/ErrorView.xaml.cs | 1 - src/MaaWpfGui/Views/UI/RootView.xaml | 8 +-- src/MaaWpfGui/Views/UI/VersionUpdateView.xaml | 48 ++++++------- .../AutoRecruitSettingsUserControl.xaml | 10 +-- .../UserControl/GameClientUserControl.xaml | 14 ++-- .../HotKeySettingsUserControl.xaml | 12 ++-- .../InfrastSettingsUserControl.xaml | 14 ++-- .../UserControl/MallSettingsUserControl.xaml | 10 +-- .../OtherCombatSettingsUserControl.xaml | 10 +-- .../RoguelikeSettingsUserControl.xaml | 12 ++-- .../UserControl/TimerSettingsUserControl.xaml | 10 +-- src/MaaWpfGui/stylecop.json | 26 +++---- 37 files changed, 232 insertions(+), 224 deletions(-) diff --git a/src/MaaWpfGui/App.xaml b/src/MaaWpfGui/App.xaml index fd7032eacc..d242feb4f9 100644 --- a/src/MaaWpfGui/App.xaml +++ b/src/MaaWpfGui/App.xaml @@ -2,13 +2,10 @@ x:Class="MaaWpfGui.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="clr-namespace:MaaWpfGui" - xmlns:s="https://github.com/canton7/Stylet" - xmlns:main="clr-namespace:MaaWpfGui.Main" - xmlns:styles="clr-namespace:MaaWpfGui.Styles" - xmlns:resources="clr-namespace:MaaWpfGui.Helper" xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls" - xmlns:hc="https://handyorg.github.io/handycontrol"> + xmlns:hc="https://handyorg.github.io/handycontrol" + xmlns:main="clr-namespace:MaaWpfGui.Main" + xmlns:s="https://github.com/canton7/Stylet"> @@ -11,86 +11,86 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/MaaWpfGui/Services/HotKeys/MaaHotKeyActionHandler.cs b/src/MaaWpfGui/Services/HotKeys/MaaHotKeyActionHandler.cs index 748c63b625..75595a4040 100644 --- a/src/MaaWpfGui/Services/HotKeys/MaaHotKeyActionHandler.cs +++ b/src/MaaWpfGui/Services/HotKeys/MaaHotKeyActionHandler.cs @@ -34,9 +34,11 @@ namespace MaaWpfGui.Services.HotKeys case MaaHotKeyAction.ShowGui: HandleShowGui(); break; + case MaaHotKeyAction.LinkStart: HandleLinkStart(); break; + default: throw new ArgumentOutOfRangeException(nameof(action), action, null); } diff --git a/src/MaaWpfGui/Services/Web/IHttpService.cs b/src/MaaWpfGui/Services/Web/IHttpService.cs index 60d6286f2f..6afbf87dc3 100644 --- a/src/MaaWpfGui/Services/Web/IHttpService.cs +++ b/src/MaaWpfGui/Services/Web/IHttpService.cs @@ -1,4 +1,4 @@ -// +// // MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // diff --git a/src/MaaWpfGui/Services/Web/IMaaApiService.cs b/src/MaaWpfGui/Services/Web/IMaaApiService.cs index 865a6882b9..4a9dc0eede 100644 --- a/src/MaaWpfGui/Services/Web/IMaaApiService.cs +++ b/src/MaaWpfGui/Services/Web/IMaaApiService.cs @@ -1,4 +1,4 @@ -// +// // MaaWpfGui - A part of the MaaCoreArknights project // Copyright (C) 2021 MistEO and Contributors // diff --git a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs index 59d321359a..f950ef68cc 100644 --- a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs @@ -32,7 +32,6 @@ using MaaWpfGui.Utilities.ValueType; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Serilog; -using Stylet; using StyletIoC; using Application = System.Windows.Application; using ComboBox = System.Windows.Controls.ComboBox; diff --git a/src/MaaWpfGui/Views/UI/CopilotView.xaml b/src/MaaWpfGui/Views/UI/CopilotView.xaml index d4ce34a5f5..207411c744 100644 --- a/src/MaaWpfGui/Views/UI/CopilotView.xaml +++ b/src/MaaWpfGui/Views/UI/CopilotView.xaml @@ -3,19 +3,19 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding" + xmlns:constants="clr-namespace:MaaWpfGui.Constants" + xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:hc="https://handyorg.github.io/handycontrol" + xmlns:helper="clr-namespace:MaaWpfGui.Helper" xmlns:local="clr-namespace:MaaWpfGui" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:s="https://github.com/canton7/Stylet" - xmlns:vm="clr-namespace:MaaWpfGui" - xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels" - xmlns:helper="clr-namespace:MaaWpfGui.Helper" - xmlns:constants="clr-namespace:MaaWpfGui.Constants" - xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI" - xmlns:styles="clr-namespace:MaaWpfGui.Styles" - xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls" xmlns:properties="clr-namespace:MaaWpfGui.Styles.Properties" + xmlns:s="https://github.com/canton7/Stylet" + xmlns:styles="clr-namespace:MaaWpfGui.Styles" + xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI" + xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels" + xmlns:vm="clr-namespace:MaaWpfGui" d:DataContext="{d:DesignInstance {x:Type ui:CopilotViewModel}}" d:DesignHeight="550" d:DesignWidth="800" @@ -121,9 +121,9 @@ + HorizontalScrollBarVisibility="Disabled" + IsInertiaEnabled="True"> diff --git a/src/MaaWpfGui/Views/UI/ErrorView.xaml b/src/MaaWpfGui/Views/UI/ErrorView.xaml index ef289d25ef..d7449d5e8d 100644 --- a/src/MaaWpfGui/Views/UI/ErrorView.xaml +++ b/src/MaaWpfGui/Views/UI/ErrorView.xaml @@ -1,21 +1,21 @@ - - + + - + - +
- + - +
- + - +
- + - +
-
- + - - - + + + - + - + - + diff --git a/src/MaaWpfGui/Views/UI/ErrorView.xaml.cs b/src/MaaWpfGui/Views/UI/ErrorView.xaml.cs index a19eff2892..3822f1a09d 100644 --- a/src/MaaWpfGui/Views/UI/ErrorView.xaml.cs +++ b/src/MaaWpfGui/Views/UI/ErrorView.xaml.cs @@ -19,7 +19,6 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Documents; -using System.Windows.Media; using MaaWpfGui.Constants; using MaaWpfGui.Helper; diff --git a/src/MaaWpfGui/Views/UI/RootView.xaml b/src/MaaWpfGui/Views/UI/RootView.xaml index 282ab139e0..cebecce791 100644 --- a/src/MaaWpfGui/Views/UI/RootView.xaml +++ b/src/MaaWpfGui/Views/UI/RootView.xaml @@ -3,19 +3,19 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:s="https://github.com/canton7/Stylet" - xmlns:hc="https://handyorg.github.io/handycontrol" - xmlns:vm="clr-namespace:MaaWpfGui" - xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels" xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI" + xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels" + xmlns:vm="clr-namespace:MaaWpfGui" Title="{Binding WindowTitle}" Width="800" Height="600" MinWidth="800" MinHeight="600" - Icon="../../newlogo.ico" d:DataContext="{d:DesignInstance {x:Type ui:RootViewModel}}" + Icon="../../newlogo.ico" mc:Ignorable="d"> + TextWrapping="Wrap" /> + TextWrapping="Wrap" /> + Document="{Binding UpdateInfoDoc}" + IsSelectionEnabled="False" + Language="zh-cn" + Zoom="90"> - + + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + CanContentScroll="True" + IsInertiaEnabled="True" /> - + diff --git a/src/MaaWpfGui/Views/UserControl/AutoRecruitSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/AutoRecruitSettingsUserControl.xaml index e27edb33e3..84b93a7311 100644 --- a/src/MaaWpfGui/Views/UserControl/AutoRecruitSettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/AutoRecruitSettingsUserControl.xaml @@ -1,16 +1,16 @@ - diff --git a/src/MaaWpfGui/Views/UserControl/GameClientUserControl.xaml b/src/MaaWpfGui/Views/UserControl/GameClientUserControl.xaml index 3e3799815e..3d8c7829b3 100644 --- a/src/MaaWpfGui/Views/UserControl/GameClientUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/GameClientUserControl.xaml @@ -1,20 +1,20 @@ - diff --git a/src/MaaWpfGui/Views/UserControl/HotKeySettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/HotKeySettingsUserControl.xaml index ccf0e6a244..81038a3099 100644 --- a/src/MaaWpfGui/Views/UserControl/HotKeySettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/HotKeySettingsUserControl.xaml @@ -1,20 +1,20 @@ - diff --git a/src/MaaWpfGui/Views/UserControl/MallSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/MallSettingsUserControl.xaml index cc4a9baef2..3634ebe837 100644 --- a/src/MaaWpfGui/Views/UserControl/MallSettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/MallSettingsUserControl.xaml @@ -1,16 +1,16 @@ - diff --git a/src/MaaWpfGui/Views/UserControl/OtherCombatSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/OtherCombatSettingsUserControl.xaml index 4efcf8588e..d699c96ce5 100644 --- a/src/MaaWpfGui/Views/UserControl/OtherCombatSettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/OtherCombatSettingsUserControl.xaml @@ -1,17 +1,17 @@ - diff --git a/src/MaaWpfGui/Views/UserControl/RoguelikeSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/RoguelikeSettingsUserControl.xaml index ef6d35e993..aceda466bb 100644 --- a/src/MaaWpfGui/Views/UserControl/RoguelikeSettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/RoguelikeSettingsUserControl.xaml @@ -2,16 +2,16 @@ x:Class="MaaWpfGui.Views.UserControl.RoguelikeSettingsUserControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dd="urn:gong-wpf-dragdrop" xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:s="https://github.com/canton7/Stylet" - xmlns:vm="clr-namespace:MaaWpfGui" - xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels" - xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI" xmlns:styles="clr-namespace:MaaWpfGui.Styles" - xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls" + xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI" + xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels" + xmlns:vm="clr-namespace:MaaWpfGui" d:DataContext="{d:DesignInstance {x:Type ui:SettingsViewModel}}" d:DesignWidth="550" mc:Ignorable="d"> @@ -71,7 +71,7 @@ - + @@ -100,7 +100,7 @@ - + diff --git a/src/MaaWpfGui/Views/UserControl/TimerSettingsUserControl.xaml b/src/MaaWpfGui/Views/UserControl/TimerSettingsUserControl.xaml index 59632add53..892a09f12f 100644 --- a/src/MaaWpfGui/Views/UserControl/TimerSettingsUserControl.xaml +++ b/src/MaaWpfGui/Views/UserControl/TimerSettingsUserControl.xaml @@ -1,17 +1,17 @@ -