mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 19:27:56 +01:00
Adapt Always on Top module to use right settings and GPO
This commit is contained in:
@@ -18,7 +18,7 @@ namespace AlwaysOnTopModuleInterface
|
|||||||
|
|
||||||
public string Name => "AlwaysOnTop";
|
public string Name => "AlwaysOnTop";
|
||||||
|
|
||||||
public GpoRuleConfigured GpoRuleConfigured => GpoRuleConfigured.Unavailable;
|
public GpoRuleConfigured GpoRuleConfigured => GPOWrapper.GetConfiguredAlwaysOnTopEnabledValue();
|
||||||
|
|
||||||
private Process? _process;
|
private Process? _process;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ namespace AlwaysOnTopModuleInterface
|
|||||||
_process = Process.Start(psi);
|
_process = Process.Start(psi);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HotkeyEx HotkeyEx => new(0x2 | 0x1, 0x54); // Ctrl + Alt + T
|
public HotkeyEx HotkeyEx => new SettingsUtils().GetSettings<AlwaysOnTopSettings>().Properties.Hotkey.Value;
|
||||||
|
|
||||||
public Action OnHotkey => () =>
|
public Action OnHotkey => () =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -316,5 +316,31 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
|||||||
result = result.Replace(" ", null);
|
result = result.Replace(" ", null);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static implicit operator HotkeyEx(HotkeySettings settings)
|
||||||
|
{
|
||||||
|
ushort modifiers = 0;
|
||||||
|
if (settings.Ctrl)
|
||||||
|
{
|
||||||
|
modifiers += 0x0002;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.Alt)
|
||||||
|
{
|
||||||
|
modifiers += 0x0001;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.Shift)
|
||||||
|
{
|
||||||
|
modifiers += 0x0004;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.Win)
|
||||||
|
{
|
||||||
|
modifiers += 0x0008;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new HotkeyEx(modifiers, (ushort)settings.Code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user