mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
Compare commits
1 Commits
feat/windo
...
fix/1632
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f66ad3b4e1 |
@@ -27,7 +27,6 @@ internal sealed class HotKeyCombination : ObservableObject
|
|||||||
|
|
||||||
private bool registered;
|
private bool registered;
|
||||||
|
|
||||||
private bool modifierHasWindows;
|
|
||||||
private bool modifierHasControl;
|
private bool modifierHasControl;
|
||||||
private bool modifierHasShift;
|
private bool modifierHasShift;
|
||||||
private bool modifierHasAlt;
|
private bool modifierHasAlt;
|
||||||
@@ -52,7 +51,10 @@ internal sealed class HotKeyCombination : ObservableObject
|
|||||||
isEnabled = LocalSetting.Get($"{settingKey}.IsEnabled", true);
|
isEnabled = LocalSetting.Get($"{settingKey}.IsEnabled", true);
|
||||||
|
|
||||||
HotKeyParameter actual = LocalSettingGetHotKeyParameter();
|
HotKeyParameter actual = LocalSettingGetHotKeyParameter();
|
||||||
modifiers = actual.Modifiers;
|
|
||||||
|
// HOT_KEY_MODIFIERS.MOD_WIN is reversed for use by the OS.
|
||||||
|
// It should not be used by the application.
|
||||||
|
modifiers = actual.Modifiers & ~HOT_KEY_MODIFIERS.MOD_WIN;
|
||||||
InitializeModifiersCompositionFields();
|
InitializeModifiersCompositionFields();
|
||||||
key = actual.Key;
|
key = actual.Key;
|
||||||
|
|
||||||
@@ -61,18 +63,6 @@ internal sealed class HotKeyCombination : ObservableObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region Binding Property
|
#region Binding Property
|
||||||
public bool ModifierHasWindows
|
|
||||||
{
|
|
||||||
get => modifierHasWindows;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (SetProperty(ref modifierHasWindows, value))
|
|
||||||
{
|
|
||||||
UpdateModifiers();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool ModifierHasControl
|
public bool ModifierHasControl
|
||||||
{
|
{
|
||||||
get => modifierHasControl;
|
get => modifierHasControl;
|
||||||
@@ -218,11 +208,6 @@ internal sealed class HotKeyCombination : ObservableObject
|
|||||||
{
|
{
|
||||||
StringBuilder stringBuilder = new();
|
StringBuilder stringBuilder = new();
|
||||||
|
|
||||||
if (Modifiers.HasFlag(HOT_KEY_MODIFIERS.MOD_WIN))
|
|
||||||
{
|
|
||||||
stringBuilder.Append("Win").Append(" + ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Modifiers.HasFlag(HOT_KEY_MODIFIERS.MOD_CONTROL))
|
if (Modifiers.HasFlag(HOT_KEY_MODIFIERS.MOD_CONTROL))
|
||||||
{
|
{
|
||||||
stringBuilder.Append("Ctrl").Append(" + ");
|
stringBuilder.Append("Ctrl").Append(" + ");
|
||||||
@@ -247,11 +232,6 @@ internal sealed class HotKeyCombination : ObservableObject
|
|||||||
{
|
{
|
||||||
HOT_KEY_MODIFIERS modifiers = default;
|
HOT_KEY_MODIFIERS modifiers = default;
|
||||||
|
|
||||||
if (ModifierHasWindows)
|
|
||||||
{
|
|
||||||
modifiers |= HOT_KEY_MODIFIERS.MOD_WIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ModifierHasControl)
|
if (ModifierHasControl)
|
||||||
{
|
{
|
||||||
modifiers |= HOT_KEY_MODIFIERS.MOD_CONTROL;
|
modifiers |= HOT_KEY_MODIFIERS.MOD_CONTROL;
|
||||||
@@ -272,11 +252,6 @@ internal sealed class HotKeyCombination : ObservableObject
|
|||||||
|
|
||||||
private void InitializeModifiersCompositionFields()
|
private void InitializeModifiersCompositionFields()
|
||||||
{
|
{
|
||||||
if (Modifiers.HasFlag(HOT_KEY_MODIFIERS.MOD_WIN))
|
|
||||||
{
|
|
||||||
modifierHasWindows = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Modifiers.HasFlag(HOT_KEY_MODIFIERS.MOD_CONTROL))
|
if (Modifiers.HasFlag(HOT_KEY_MODIFIERS.MOD_CONTROL))
|
||||||
{
|
{
|
||||||
modifierHasControl = true;
|
modifierHasControl = true;
|
||||||
|
|||||||
@@ -2664,7 +2664,7 @@
|
|||||||
<value>高级功能</value>
|
<value>高级功能</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ViewPageSettingKeyShortcutAutoClickingDescription" xml:space="preserve">
|
<data name="ViewPageSettingKeyShortcutAutoClickingDescription" xml:space="preserve">
|
||||||
<value>更改自动连点功能的快捷键</value>
|
<value>更改自动连点功能的快捷键,仅管理员模式下生效</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ViewPageSettingKeyShortcutAutoClickingHeader" xml:space="preserve">
|
<data name="ViewPageSettingKeyShortcutAutoClickingHeader" xml:space="preserve">
|
||||||
<value>自动连点</value>
|
<value>自动连点</value>
|
||||||
@@ -3257,4 +3257,4 @@
|
|||||||
<data name="WindowIdentifyMonitorHeader" xml:space="preserve">
|
<data name="WindowIdentifyMonitorHeader" xml:space="preserve">
|
||||||
<value>显示器编号</value>
|
<value>显示器编号</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -437,7 +437,7 @@
|
|||||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||||
Style="{ThemeResource SettingButtonStyle}">
|
Style="{ThemeResource SettingButtonStyle}">
|
||||||
<Button.Flyout>
|
<Button.Flyout>
|
||||||
<Flyout FlyoutPresenterStyle="{ThemeResource FlyoutPresenterPadding16And10Style}">
|
<Flyout FlyoutPresenterStyle="{ThemeResource FlyoutPresenterPadding16And10Style}" ShouldConstrainToRootBounds="False">
|
||||||
<cwc:UniformGrid
|
<cwc:UniformGrid
|
||||||
ColumnSpacing="16"
|
ColumnSpacing="16"
|
||||||
Columns="2"
|
Columns="2"
|
||||||
@@ -447,7 +447,7 @@
|
|||||||
MinWidth="64"
|
MinWidth="64"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Content="Win"
|
Content="Win"
|
||||||
IsChecked="{Binding HotKeyOptions.MouseClickRepeatForeverKeyCombination.ModifierHasWindows, Mode=TwoWay}"/>
|
IsEnabled="False"/>
|
||||||
<CheckBox
|
<CheckBox
|
||||||
MinWidth="64"
|
MinWidth="64"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
|
|||||||
Reference in New Issue
Block a user