diff --git a/App.xaml b/App.xaml
index 9b7864c..b80d29a 100644
--- a/App.xaml
+++ b/App.xaml
@@ -6,7 +6,7 @@
-
+
@@ -15,12 +15,12 @@
+
+
-
\ No newline at end of file
diff --git a/Consts/MainMultilangConst.Designer.cs b/Consts/MainMultilangConst.Designer.cs
index 5d92e3f..fcdcd12 100644
--- a/Consts/MainMultilangConst.Designer.cs
+++ b/Consts/MainMultilangConst.Designer.cs
@@ -69,6 +69,24 @@ namespace Sheas_Cealer.Consts {
}
}
+ ///
+ /// 查找类似 的本地化字符串。
+ ///
+ public static string AboutButtonToolTip {
+ get {
+ return ResourceManager.GetString("AboutButtonToolTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Browser Path 的本地化字符串。
+ ///
+ public static string BrowserPathModeName {
+ get {
+ return ResourceManager.GetString("BrowserPathModeName", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Edit Host 的本地化字符串。
///
@@ -79,7 +97,25 @@ namespace Sheas_Cealer.Consts {
}
///
- /// 查找类似 (Fill in the path of a Chromium-based browser) 的本地化字符串。
+ /// 查找类似 的本地化字符串。
+ ///
+ public static string EditHostButtonToolTip {
+ get {
+ return ResourceManager.GetString("EditHostButtonToolTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Additional Args 的本地化字符串。
+ ///
+ public static string ExtraArgsModeName {
+ get {
+ return ResourceManager.GetString("ExtraArgsModeName", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Fill in the path of a Chromium-based browser 的本地化字符串。
///
public static string SettingsBoxBrowserPathPlaceHolder {
get {
@@ -88,7 +124,7 @@ namespace Sheas_Cealer.Consts {
}
///
- /// 查找类似 (Fill in extra Chromium startup arguments) 的本地化字符串。
+ /// 查找类似 Fill in extra Chromium startup arguments 的本地化字符串。
///
public static string SettingsBoxExtraArgsPlaceHolder {
get {
@@ -97,7 +133,7 @@ namespace Sheas_Cealer.Consts {
}
///
- /// 查找类似 (Fill in the link to an upstream Cealing Host) 的本地化字符串。
+ /// 查找类似 Fill in the link to an upstream Cealing Host 的本地化字符串。
///
public static string SettingsBoxUpstreamUrlPlaceHolder {
get {
@@ -106,7 +142,7 @@ namespace Sheas_Cealer.Consts {
}
///
- /// 查找类似 Browse 的本地化字符串。
+ /// 查找类似 Browse Path 的本地化字符串。
///
public static string SettingsFunctionButtonBrowserPathContent {
get {
@@ -115,7 +151,7 @@ namespace Sheas_Cealer.Consts {
}
///
- /// 查找类似 Clear 的本地化字符串。
+ /// 查找类似 Clear Args 的本地化字符串。
///
public static string SettingsFunctionButtonExtraArgsContent {
get {
@@ -124,7 +160,16 @@ namespace Sheas_Cealer.Consts {
}
///
- /// 查找类似 Reset 的本地化字符串。
+ /// 查找类似 的本地化字符串。
+ ///
+ public static string SettingsFunctionButtonToolTip {
+ get {
+ return ResourceManager.GetString("SettingsFunctionButtonToolTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Reset Url 的本地化字符串。
///
public static string SettingsFunctionButtonUpstreamUrlContent {
get {
@@ -133,29 +178,11 @@ namespace Sheas_Cealer.Consts {
}
///
- /// 查找类似 Browser Path > 的本地化字符串。
+ /// 查找类似 的本地化字符串。
///
- public static string SettingsModeButtonBrowserPathContent {
+ public static string SettingsModeButtonToolTip {
get {
- return ResourceManager.GetString("SettingsModeButtonBrowserPathContent", resourceCulture);
- }
- }
-
- ///
- /// 查找类似 Additional Args > 的本地化字符串。
- ///
- public static string SettingsModeButtonExtraArgsContent {
- get {
- return ResourceManager.GetString("SettingsModeButtonExtraArgsContent", resourceCulture);
- }
- }
-
- ///
- /// 查找类似 Upstream Url > 的本地化字符串。
- ///
- public static string SettingsModeButtonUpstreamUrlContent {
- get {
- return ResourceManager.GetString("SettingsModeButtonUpstreamUrlContent", resourceCulture);
+ return ResourceManager.GetString("SettingsModeButtonToolTip", resourceCulture);
}
}
@@ -168,6 +195,51 @@ namespace Sheas_Cealer.Consts {
}
}
+ ///
+ /// 查找类似 的本地化字符串。
+ ///
+ public static string StartCealButtonToolTip {
+ get {
+ return ResourceManager.GetString("StartCealButtonToolTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Light Theme 的本地化字符串。
+ ///
+ public static string ThemesButtonDarkThemeContent {
+ get {
+ return ResourceManager.GetString("ThemesButtonDarkThemeContent", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Auto Theme 的本地化字符串。
+ ///
+ public static string ThemesButtonInheritThemeContent {
+ get {
+ return ResourceManager.GetString("ThemesButtonInheritThemeContent", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Dark Theme 的本地化字符串。
+ ///
+ public static string ThemesButtonLightThemeContent {
+ get {
+ return ResourceManager.GetString("ThemesButtonLightThemeContent", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 的本地化字符串。
+ ///
+ public static string ThemesButtonToolTip {
+ get {
+ return ResourceManager.GetString("ThemesButtonToolTip", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Update Host 的本地化字符串。
///
@@ -176,5 +248,23 @@ namespace Sheas_Cealer.Consts {
return ResourceManager.GetString("UpdateHostButtonContent", resourceCulture);
}
}
+
+ ///
+ /// 查找类似 的本地化字符串。
+ ///
+ public static string UpdateHostButtonToolTip {
+ get {
+ return ResourceManager.GetString("UpdateHostButtonToolTip", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Upstream Url 的本地化字符串。
+ ///
+ public static string UpstreamUrlModeName {
+ get {
+ return ResourceManager.GetString("UpstreamUrlModeName", resourceCulture);
+ }
+ }
}
}
diff --git a/Consts/MainMultilangConst.resx b/Consts/MainMultilangConst.resx
index a01e3ee..f92fd36 100644
--- a/Consts/MainMultilangConst.resx
+++ b/Consts/MainMultilangConst.resx
@@ -120,40 +120,70 @@
About Me
+
+
+
+
+ Browser Path
+
Edit Host
+
+
+
+
+ Additional Args
+
- (Fill in the path of a Chromium-based browser)
+ Fill in the path of a Chromium-based browser
- (Fill in extra Chromium startup arguments)
+ Fill in extra Chromium startup arguments
- (Fill in the link to an upstream Cealing Host)
+ Fill in the link to an upstream Cealing Host
- Browse
+ Browse Path
- Clear
+ Clear Args
+
+
+
- Reset
+ Reset Url
-
- Browser Path >
-
-
- Additional Args >
-
-
- Upstream Url >
+
+
Start Cealing
+
+
+
+
+ Light Theme
+
+
+ Auto Theme
+
+
+ Dark Theme
+
+
+
+
Update Host
+
+
+
+
+ Upstream Url
+
\ No newline at end of file
diff --git a/Consts/MainMultilangConst.zh.resx b/Consts/MainMultilangConst.zh.resx
index 9e9287b..326b604 100644
--- a/Consts/MainMultilangConst.zh.resx
+++ b/Consts/MainMultilangConst.zh.resx
@@ -120,40 +120,70 @@
关于项目
+
+ 点击打开关于窗口
+
+
+ 文件路径
+
编辑规则
+
+ 点击编辑伪造规则
+
+
+ 额外参数
+
- (填入任意以 Chromium 为内核的浏览器的路径)
+ 填入任意以 Chromium 为内核的浏览器的路径
- (填入任意额外的 Chromium 启动参数)
+ 填入任意额外的 Chromium 启动参数
- (填入任意上游伪造规则的链接)
+ 填入任意上游伪造规则的链接
- 浏览
+ 浏览路径
- 清除
+ 清除参数
+
+
+ 点击处理输入框内容
- 重置
+ 重置链接
-
- 文件路径 >
-
-
- 额外参数 >
-
-
- 上游链接 >
+
+ 点击切换输入框设置模式
启动伪造
+
+ 点击启动伪造注入后的浏览器
+
+
+ 跟随系统
+
+
+ 暗色模式
+
+
+ 亮色模式
+
+
+ 点击切换显示主题
+
更新规则
+
+ 点击更新伪造规则
+
+
+ 上游链接
+
\ No newline at end of file
diff --git a/Convs/MainSettingsBoxForegroundConv.cs b/Convs/MainSettingsBoxForegroundConv.cs
deleted file mode 100644
index 570d2a8..0000000
--- a/Convs/MainSettingsBoxForegroundConv.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-using System.Globalization;
-using System.Windows.Data;
-using System.Windows.Media;
-using Sheas_Cealer.Consts;
-
-namespace Sheas_Cealer.Convs;
-
-internal class MainSettingsBoxForegroundConv : IMultiValueConverter
-{
- public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
- {
- MainConst.SettingsMode? mode = values[0] as MainConst.SettingsMode?;
- string? browserPath = values[1] as string;
- string? upstreamUrl = values[2] as string;
- string? extraArgs = values[3] as string;
-
- switch (mode)
- {
- case MainConst.SettingsMode.BrowserPathMode when browserPath == MainConst.SettingsBoxBrowserPathPlaceHolder:
- case MainConst.SettingsMode.UpstreamUrlMode when upstreamUrl == MainConst.SettingsBoxUpstreamUrlPlaceHolder:
- case MainConst.SettingsMode.ExtraArgsMode when extraArgs == MainConst.SettingsBoxExtraArgsPlaceHolder:
- return new SolidColorBrush(Color.FromRgb(191, 205, 219));
- }
-
- return new SolidColorBrush(Color.FromRgb(0, 0, 0));
- }
-
- public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
-}
\ No newline at end of file
diff --git a/Convs/MainSettingsBoxHintConv.cs b/Convs/MainSettingsBoxHintConv.cs
new file mode 100644
index 0000000..3e63a35
--- /dev/null
+++ b/Convs/MainSettingsBoxHintConv.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Diagnostics;
+using System.Globalization;
+using System.Windows.Data;
+using Sheas_Cealer.Consts;
+
+namespace Sheas_Cealer.Convs;
+
+internal class MainSettingsBoxHintConv : IValueConverter
+{
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ MainConst.SettingsMode? mode = value as MainConst.SettingsMode?;
+
+ return mode switch
+ {
+ MainConst.SettingsMode.BrowserPathMode => MainConst.BrowserPathModeName,
+ MainConst.SettingsMode.UpstreamUrlMode => MainConst.UpstreamUrlModeName,
+ MainConst.SettingsMode.ExtraArgsMode => MainConst.ExtraArgsModeName,
+ _ => throw new UnreachableException()
+ };
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
+}
\ No newline at end of file
diff --git a/Convs/MainSettingsBoxTextConv.cs b/Convs/MainSettingsBoxTextConv.cs
index c17e654..503dca5 100644
--- a/Convs/MainSettingsBoxTextConv.cs
+++ b/Convs/MainSettingsBoxTextConv.cs
@@ -10,19 +10,15 @@ internal class MainSettingsBoxTextConv : IMultiValueConverter
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
MainConst.SettingsMode? mode = values[0] as MainConst.SettingsMode?;
- bool? isFocused = values[1] as bool?;
- string? browserPath = values[2] as string;
- string? upstreamUrl = values[3] as string;
- string? extraArgs = values[4] as string;
+ string? browserPath = values[1] as string;
+ string? upstreamUrl = values[2] as string;
+ string? extraArgs = values[3] as string;
return mode switch
{
- MainConst.SettingsMode.BrowserPathMode => !isFocused.GetValueOrDefault() && string.IsNullOrEmpty(browserPath) ? MainConst.SettingsBoxBrowserPathPlaceHolder :
- isFocused.GetValueOrDefault() && browserPath == MainConst.SettingsBoxBrowserPathPlaceHolder ? string.Empty : browserPath!,
- MainConst.SettingsMode.UpstreamUrlMode => !isFocused.GetValueOrDefault() && string.IsNullOrEmpty(upstreamUrl) ? MainConst.SettingsBoxUpstreamUrlPlaceHolder :
- isFocused.GetValueOrDefault() && upstreamUrl == MainConst.SettingsBoxUpstreamUrlPlaceHolder ? string.Empty : upstreamUrl!,
- MainConst.SettingsMode.ExtraArgsMode => !isFocused.GetValueOrDefault() && string.IsNullOrEmpty(extraArgs) ? MainConst.SettingsBoxExtraArgsPlaceHolder :
- isFocused.GetValueOrDefault() && extraArgs == MainConst.SettingsBoxExtraArgsPlaceHolder ? string.Empty : extraArgs!,
+ MainConst.SettingsMode.BrowserPathMode => browserPath!,
+ MainConst.SettingsMode.UpstreamUrlMode => upstreamUrl!,
+ MainConst.SettingsMode.ExtraArgsMode => extraArgs!,
_ => throw new UnreachableException(),
};
}
diff --git a/Convs/MainSettingsBoxToolTipConv.cs b/Convs/MainSettingsBoxToolTipConv.cs
new file mode 100644
index 0000000..ef385c0
--- /dev/null
+++ b/Convs/MainSettingsBoxToolTipConv.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Diagnostics;
+using System.Globalization;
+using System.Windows.Data;
+using Sheas_Cealer.Consts;
+
+namespace Sheas_Cealer.Convs;
+
+internal class MainSettingsBoxToolTipConv : IValueConverter
+{
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ MainConst.SettingsMode? mode = value as MainConst.SettingsMode?;
+
+ return mode switch
+ {
+ MainConst.SettingsMode.BrowserPathMode => MainConst.SettingsBoxBrowserPathPlaceHolder,
+ MainConst.SettingsMode.UpstreamUrlMode => MainConst.SettingsBoxUpstreamUrlPlaceHolder,
+ MainConst.SettingsMode.ExtraArgsMode => MainConst.SettingsBoxExtraArgsPlaceHolder,
+ _ => throw new UnreachableException()
+ };
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
+}
\ No newline at end of file
diff --git a/Convs/MainSettingsModeButtonContentConv.cs b/Convs/MainSettingsModeButtonContentConv.cs
index a1fcf0e..f78ec5e 100644
--- a/Convs/MainSettingsModeButtonContentConv.cs
+++ b/Convs/MainSettingsModeButtonContentConv.cs
@@ -13,9 +13,9 @@ internal class MainSettingsModeButtonContentConv : IValueConverter
return mode switch
{
- MainConst.SettingsMode.BrowserPathMode => MainConst.SettingsModeButtonBrowserPathContent,
- MainConst.SettingsMode.UpstreamUrlMode => MainConst.SettingsModeButtonUpstreamUrlContent,
- MainConst.SettingsMode.ExtraArgsMode => MainConst.SettingsModeButtonExtraArgsContent,
+ MainConst.SettingsMode.BrowserPathMode => MainConst.UpstreamUrlModeName,
+ MainConst.SettingsMode.UpstreamUrlMode => MainConst.ExtraArgsModeName,
+ MainConst.SettingsMode.ExtraArgsMode => MainConst.BrowserPathModeName,
_ => throw new NotImplementedException()
};
}
diff --git a/Convs/MainThemesButtonContentConv.cs b/Convs/MainThemesButtonContentConv.cs
new file mode 100644
index 0000000..510957f
--- /dev/null
+++ b/Convs/MainThemesButtonContentConv.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using Sheas_Cealer.Consts;
+
+namespace Sheas_Cealer.Convs;
+
+internal class MainThemesButtonContentConv : IValueConverter
+{
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ bool? isLightMode = value as bool?;
+
+ return isLightMode.HasValue ? (isLightMode.GetValueOrDefault() ? MainConst.ThemesButtonLightThemeContent : MainConst.ThemesButtonDarkThemeContent) : MainConst.ThemesButtonInheritThemeContent;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
+}
\ No newline at end of file
diff --git a/Preses/MainPres.cs b/Preses/MainPres.cs
index 0b04579..b5c6f73 100644
--- a/Preses/MainPres.cs
+++ b/Preses/MainPres.cs
@@ -1,6 +1,10 @@
using System;
using System.IO;
+using System.Windows;
+using System.Windows.Media;
using CommunityToolkit.Mvvm.ComponentModel;
+using MaterialDesignColors;
+using MaterialDesignThemes.Wpf;
using Sheas_Cealer.Consts;
using Sheas_Cealer.Props;
using File = System.IO.File;
@@ -31,6 +35,16 @@ internal partial class MainPres : ObservableObject
[ObservableProperty]
private MainConst.SettingsMode mode;
+ [ObservableProperty]
+ private bool? isLightTheme = null;
+ partial void OnIsLightThemeChanged(bool? value)
+ {
+ PaletteHelper paletteHelper = new();
+ Theme newTheme = paletteHelper.GetTheme();
+ newTheme.SetBaseTheme(value.HasValue ? (value.GetValueOrDefault() ? BaseTheme.Light : BaseTheme.Dark) : BaseTheme.Inherit);
+ paletteHelper.SetTheme(newTheme);
+ }
+
[ObservableProperty]
private string browserPath;
partial void OnBrowserPathChanged(string value)
diff --git a/Utils/Command.cs b/Utils/Command.cs
index f0f066d..beb94b5 100644
--- a/Utils/Command.cs
+++ b/Utils/Command.cs
@@ -6,8 +6,11 @@ namespace Sheas_Cealer.Utils;
internal class Command : Proc
{
- internal Command() : base("Cmd.exe")
+ internal bool EnvironmentExitAfterProcessExited = true;
+
+ internal Command(bool environmentExitAfterProcessExited) : base("Cmd.exe")
{
+ EnvironmentExitAfterProcessExited = environmentExitAfterProcessExited;
}
public override void Process_OutputDataReceived(object sender, DataReceivedEventArgs e)
@@ -16,5 +19,9 @@ internal class Command : Proc
public override void Process_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
}
- public override void Process_Exited(object sender, EventArgs e) => Environment.Exit(0);
+ public override void Process_Exited(object sender, EventArgs e)
+ {
+ if (EnvironmentExitAfterProcessExited)
+ Environment.Exit(0);
+ }
}
\ No newline at end of file
diff --git a/Wins/AboutWin.xaml b/Wins/AboutWin.xaml
index ca7a0d4..ca3ece1 100644
--- a/Wins/AboutWin.xaml
+++ b/Wins/AboutWin.xaml
@@ -6,7 +6,7 @@
xmlns:convs="clr-namespace:Sheas_Cealer.Convs"
xmlns:consts="clr-namespace:Sheas_Cealer.Consts"
mc:Ignorable="d"
- Style="{DynamicResource CommonWindow}" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" SizeToContent="Height" Width="500" MinWidth="500"
+ Style="{DynamicResource CommonWindow}" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" SizeToContent="Height" Width="600"
KeyDown="AboutWin_KeyDown">
@@ -18,7 +18,7 @@
-
+
diff --git a/Wins/MainWin.xaml b/Wins/MainWin.xaml
index b9593de..6f2d493 100644
--- a/Wins/MainWin.xaml
+++ b/Wins/MainWin.xaml
@@ -3,12 +3,13 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:consts="clr-namespace:Sheas_Cealer.Consts"
xmlns:convs="clr-namespace:Sheas_Cealer.Convs"
xmlns:preses="clr-namespace:Sheas_Cealer.Preses"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance preses:MainPres}" AllowDrop="True"
- Style="{DynamicResource CommonWindow}" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize" SizeToContent="Height" Width="500" MinWidth="500"
+ Style="{DynamicResource CommonWindow}" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize" SizeToContent="Height" Width="600"
Loaded="MainWin_Loaded" Closing="MainWin_Closing" DragEnter="MainWin_DragEnter" Drop="MainWin_Drop" KeyDown="MainWin_KeyDown">
@@ -16,7 +17,7 @@
-
+
@@ -28,7 +29,7 @@
-
@@ -49,26 +50,27 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-