mirror of
https://github.com/SpaceTimee/Sheas-Cealer.git
synced 2025-07-14 21:32:08 +08:00
1.1.3 -> 1.1.4 第39次更新
This commit is contained in:
parent
73f411aca3
commit
f7a0729eaa
@ -8,8 +8,8 @@ internal class AboutVersionButtonContentConv : IMultiValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
string? versionButtonLabelContent = values[0] as string;
|
string versionButtonLabelContent = (string)values[0];
|
||||||
string? versionButtonVersionContent = values[1] as string;
|
string versionButtonVersionContent = (string)values[1];
|
||||||
|
|
||||||
return $"{versionButtonLabelContent} {versionButtonVersionContent}";
|
return $"{versionButtonLabelContent} {versionButtonVersionContent}";
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ internal class MainSettingsBoxHintConv : IValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode? settingsMode = value as MainConst.SettingsMode?;
|
MainConst.SettingsMode settingsMode = (MainConst.SettingsMode)value;
|
||||||
|
|
||||||
return settingsMode switch
|
return settingsMode switch
|
||||||
{
|
{
|
||||||
|
@ -9,16 +9,16 @@ internal class MainSettingsBoxTextConv : IMultiValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode? settingsMode = values[0] as MainConst.SettingsMode?;
|
MainConst.SettingsMode settingsMode = (MainConst.SettingsMode)values[0];
|
||||||
string? browserPath = values[1] as string;
|
string browserPath = (string)values[1];
|
||||||
string? upstreamUrl = values[2] as string;
|
string upstreamUrl = (string)values[2];
|
||||||
string? extraArgs = values[3] as string;
|
string extraArgs = (string)values[3];
|
||||||
|
|
||||||
return settingsMode switch
|
return settingsMode switch
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode.BrowserPathMode => browserPath!,
|
MainConst.SettingsMode.BrowserPathMode => browserPath,
|
||||||
MainConst.SettingsMode.UpstreamUrlMode => upstreamUrl!,
|
MainConst.SettingsMode.UpstreamUrlMode => upstreamUrl,
|
||||||
MainConst.SettingsMode.ExtraArgsMode => extraArgs!,
|
MainConst.SettingsMode.ExtraArgsMode => extraArgs,
|
||||||
_ => throw new UnreachableException(),
|
_ => throw new UnreachableException(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ internal class MainSettingsBoxToolTipConv : IValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode? settingsMode = value as MainConst.SettingsMode?;
|
MainConst.SettingsMode settingsMode = (MainConst.SettingsMode)value;
|
||||||
|
|
||||||
return settingsMode switch
|
return settingsMode switch
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@ internal class MainSettingsFunctionButtonContentConv : IValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode? settingsMode = value as MainConst.SettingsMode?;
|
MainConst.SettingsMode settingsMode = (MainConst.SettingsMode)value;
|
||||||
|
|
||||||
return settingsMode switch
|
return settingsMode switch
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ internal class MainSettingsModeButtonContentConv : IValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
MainConst.SettingsMode? settingsMode = value as MainConst.SettingsMode?;
|
MainConst.SettingsMode settingsMode = (MainConst.SettingsMode)value;
|
||||||
|
|
||||||
return settingsMode switch
|
return settingsMode switch
|
||||||
{
|
{
|
||||||
|
@ -10,10 +10,10 @@ internal class MainStartButtonIsEnabledConv : IMultiValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
string? browserPath = values[0] as string;
|
string browserPath = (string)values[0];
|
||||||
string? extraArgs = values[1] as string;
|
string extraArgs = (string)values[1];
|
||||||
|
|
||||||
return File.Exists(browserPath) && Path.GetFileName(browserPath).ToLowerInvariant().EndsWith(".exe") && MainConst.ExtraArgsRegex().IsMatch(extraArgs!);
|
return File.Exists(browserPath) && Path.GetFileName(browserPath).ToLowerInvariant().EndsWith(".exe") && MainConst.ExtraArgsRegex().IsMatch(extraArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
@ -9,9 +9,9 @@ internal class MainUpdateHostButtonIsEnabledConv : IValueConverter
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
string? upstreamUrl = value as string;
|
string upstreamUrl = (string)value;
|
||||||
|
|
||||||
return MainConst.UpstreamUrlRegex().IsMatch(upstreamUrl!);
|
return MainConst.UpstreamUrlRegex().IsMatch(upstreamUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
||||||
|
@ -6,8 +6,8 @@ namespace Sheas_Cealer.Utils;
|
|||||||
|
|
||||||
internal static partial class BorderThemeSetter
|
internal static partial class BorderThemeSetter
|
||||||
{
|
{
|
||||||
private const int DWMWA_USE_IMMERSIVE_DARK_MODE_OLD = 19;
|
private const int DwmwaUseImmersiveDarkModeOld = 19;
|
||||||
private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
|
private const int DwmwaUseImmersiveDarkMode = 20;
|
||||||
|
|
||||||
[LibraryImport("dwmapi.dll")]
|
[LibraryImport("dwmapi.dll")]
|
||||||
private static partial int DwmGetWindowAttribute(nint hwnd, uint attr, out nint attrValue, uint attrSize);
|
private static partial int DwmGetWindowAttribute(nint hwnd, uint attr, out nint attrValue, uint attrSize);
|
||||||
@ -23,9 +23,9 @@ internal static partial class BorderThemeSetter
|
|||||||
if (isLightTheme.HasValue)
|
if (isLightTheme.HasValue)
|
||||||
isDarkTheme = !isLightTheme.Value ? 1 : 0;
|
isDarkTheme = !isLightTheme.Value ? 1 : 0;
|
||||||
else
|
else
|
||||||
DwmGetWindowAttribute(desktopHwnd, DWMWA_USE_IMMERSIVE_DARK_MODE, out isDarkTheme, (uint)Marshal.SizeOf(typeof(nint)));
|
DwmGetWindowAttribute(desktopHwnd, DwmwaUseImmersiveDarkMode, out isDarkTheme, (uint)Marshal.SizeOf(typeof(nint)));
|
||||||
|
|
||||||
_ = DwmSetWindowAttribute(windowHwnd, DWMWA_USE_IMMERSIVE_DARK_MODE_OLD, ref isDarkTheme, (uint)Marshal.SizeOf(typeof(nint)));
|
_ = DwmSetWindowAttribute(windowHwnd, DwmwaUseImmersiveDarkModeOld, ref isDarkTheme, (uint)Marshal.SizeOf(typeof(nint)));
|
||||||
_ = DwmSetWindowAttribute(windowHwnd, DWMWA_USE_IMMERSIVE_DARK_MODE, ref isDarkTheme, (uint)Marshal.SizeOf(typeof(nint)));
|
_ = DwmSetWindowAttribute(windowHwnd, DwmwaUseImmersiveDarkMode, ref isDarkTheme, (uint)Marshal.SizeOf(typeof(nint)));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,13 +6,13 @@ namespace Sheas_Cealer.Utils;
|
|||||||
|
|
||||||
internal static partial class IconRemover
|
internal static partial class IconRemover
|
||||||
{
|
{
|
||||||
private const int GWL_EXSTYLE = -20;
|
private const int GwlExStyle = -20;
|
||||||
private const int WS_EX_DLGMODALFRAME = 0x0001;
|
private const int WsExDlgModalFrame = 0x0001;
|
||||||
private const int SWP_NOSIZE = 0x0001;
|
private const int SwpNoSize = 0x0001;
|
||||||
private const int SWP_NOMOVE = 0x0002;
|
private const int SwpNoMove = 0x0002;
|
||||||
private const int SWP_NOZORDER = 0x0004;
|
private const int SwpNoZOrder = 0x0004;
|
||||||
private const int SWP_FRAMECHANGED = 0x0020;
|
private const int SwpFrameChanged = 0x0020;
|
||||||
private const uint WM_SETICON = 0x0080;
|
private const uint WmSetIcon = 0x0080;
|
||||||
|
|
||||||
[LibraryImport("user32.dll", EntryPoint = "GetWindowLongW")]
|
[LibraryImport("user32.dll", EntryPoint = "GetWindowLongW")]
|
||||||
private static partial int GetWindowLong(nint hwnd, int index);
|
private static partial int GetWindowLong(nint hwnd, int index);
|
||||||
@ -28,11 +28,11 @@ internal static partial class IconRemover
|
|||||||
{
|
{
|
||||||
nint hwnd = new WindowInteropHelper(window).Handle;
|
nint hwnd = new WindowInteropHelper(window).Handle;
|
||||||
|
|
||||||
_ = SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_DLGMODALFRAME);
|
_ = SetWindowLong(hwnd, GwlExStyle, GetWindowLong(hwnd, GwlExStyle) | WsExDlgModalFrame);
|
||||||
|
|
||||||
SetWindowPos(hwnd, nint.Zero, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
SetWindowPos(hwnd, nint.Zero, 0, 0, 0, 0, SwpNoMove | SwpNoSize | SwpNoZOrder | SwpFrameChanged);
|
||||||
|
|
||||||
SendMessage(hwnd, WM_SETICON, new nint(1), nint.Zero);
|
SendMessage(hwnd, WmSetIcon, new nint(1), nint.Zero);
|
||||||
SendMessage(hwnd, WM_SETICON, nint.Zero, nint.Zero);
|
SendMessage(hwnd, WmSetIcon, nint.Zero, nint.Zero);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -20,10 +20,10 @@
|
|||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5" Foreground="#FF2196F3" Content="{Binding Source={x:Static consts:AboutConst.DeveloperButtonContent}, Mode=OneTime}" ToolTip="{Binding Source={x:Static consts:AboutConst.DeveloperButtonUrl}, Mode=OneTime}"
|
<Button Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5" Foreground="#2196F3" Content="{Binding Source={x:Static consts:AboutConst.DeveloperButtonContent}, Mode=OneTime}" ToolTip="{Binding Source={x:Static consts:AboutConst.DeveloperButtonUrl}, Mode=OneTime}"
|
||||||
Click="AboutButton_Click" />
|
Click="AboutButton_Click" />
|
||||||
<Button x:Name="VersionButton"
|
<Button x:Name="VersionButton"
|
||||||
Grid.Row="1" Grid.Column="0" Margin="5" Foreground="#FF2196F3" ToolTip="{Binding Source={x:Static consts:AboutConst.VersionButtonUrl}, Mode=OneTime}"
|
Grid.Row="1" Grid.Column="0" Margin="5" Foreground="#2196F3" ToolTip="{Binding Source={x:Static consts:AboutConst.VersionButtonUrl}, Mode=OneTime}"
|
||||||
Click="AboutButton_Click">
|
Click="AboutButton_Click">
|
||||||
<Button.Content>
|
<Button.Content>
|
||||||
<MultiBinding Mode="OneTime">
|
<MultiBinding Mode="OneTime">
|
||||||
|
@ -347,8 +347,7 @@
|
|||||||
</Binding>
|
</Binding>
|
||||||
</Button.ToolTip>
|
</Button.ToolTip>
|
||||||
</Button>
|
</Button>
|
||||||
<Button x:Name="AboutButton"
|
<Button Grid.Column="2" Margin="5" Content="{Binding Source={x:Static consts:MainConst.AboutButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.AboutButtonToolTip}}"
|
||||||
Grid.Column="2" Margin="5" Content="{Binding Source={x:Static consts:MainConst.AboutButtonContent}}" ToolTip="{Binding Source={x:Static consts:MainConst.AboutButtonToolTip}}"
|
|
||||||
Click="AboutButton_Click" />
|
Click="AboutButton_Click" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
Loading…
Reference in New Issue
Block a user