mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
disable apps for shortcut guide (#10123)
This commit is contained in:
committed by
GitHub
parent
6561290bde
commit
bc28a3f5e3
@@ -13,6 +13,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
OverlayOpacity = new IntProperty(90);
|
||||
PressTime = new IntProperty(900);
|
||||
Theme = new StringProperty("system");
|
||||
DisabledApps = new StringProperty();
|
||||
}
|
||||
|
||||
[JsonPropertyName("overlay_opacity")]
|
||||
@@ -23,5 +24,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
|
||||
[JsonPropertyName("theme")]
|
||||
public StringProperty Theme { get; set; }
|
||||
|
||||
[JsonPropertyName("disabled_apps")]
|
||||
public StringProperty DisabledApps { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
private Func<string, int> SendConfigMSG { get; }
|
||||
|
||||
private string _settingsConfigFileFolder = string.Empty;
|
||||
private string _disabledApps;
|
||||
|
||||
public ShortcutGuideViewModel(ISettingsRepository<GeneralSettings> settingsRepository, ISettingsRepository<ShortcutGuideSettings> moduleSettingsRepository, Func<string, int> ipcMSGCallBackFunc, string configFileSubfolder = "")
|
||||
{
|
||||
@@ -49,6 +50,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
_isEnabled = GeneralSettingsConfig.Enabled.ShortcutGuide;
|
||||
_pressTime = Settings.Properties.PressTime.Value;
|
||||
_opacity = Settings.Properties.OverlayOpacity.Value;
|
||||
_disabledApps = Settings.Properties.DisabledApps.Value;
|
||||
|
||||
string theme = Settings.Properties.Theme.Value;
|
||||
|
||||
@@ -170,6 +172,24 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public string DisabledApps
|
||||
{
|
||||
get
|
||||
{
|
||||
return _disabledApps;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != _disabledApps)
|
||||
{
|
||||
_disabledApps = value;
|
||||
Settings.Properties.DisabledApps.Value = value;
|
||||
NotifyPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string GetSettingsSubPath()
|
||||
{
|
||||
return _settingsConfigFileFolder + "\\" + ModuleName;
|
||||
|
||||
@@ -491,6 +491,16 @@
|
||||
<data name="ShortcutGuide_OverlayOpacity.Header" xml:space="preserve">
|
||||
<value>Opacity of background</value>
|
||||
</data>
|
||||
<data name="ShortcutGuide_DisabledApps.Text" xml:space="preserve">
|
||||
<value>Disable for apps</value>
|
||||
</data>
|
||||
<data name="ShortcutGuide_DisabledApps_TextBoxControl.Header" xml:space="preserve">
|
||||
<value>Turn off Shortcut Guide when these applications have focus. Add one application name per line.</value>
|
||||
</data>
|
||||
<data name="ShortcutGuide_DisabledApps_TextBoxControl.PlaceholderText" xml:space="preserve">
|
||||
<value>Example: outlook.exe</value>
|
||||
<comment>Don't translate outlook.exe</comment>
|
||||
</data>
|
||||
<data name="ImageResizer_CustomSizes.Text" xml:space="preserve">
|
||||
<value>Image sizes</value>
|
||||
</data>
|
||||
@@ -793,6 +803,7 @@
|
||||
</data>
|
||||
<data name="FancyZones_ExcludeApps_TextBoxControl.PlaceholderText" xml:space="preserve">
|
||||
<value>Example: outlook.exe</value>
|
||||
<comment>Don't translate outlook.exe</comment>
|
||||
</data>
|
||||
<data name="ImageResizer_FilenameFormatPlaceholder.PlaceholderText" xml:space="preserve">
|
||||
<value>Example: %1 (%2)</value>
|
||||
|
||||
@@ -111,6 +111,23 @@
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
|
||||
<TextBlock x:Uid="Windows_Color_Settings" />
|
||||
</HyperlinkButton>
|
||||
|
||||
<TextBlock x:Uid="ShortcutGuide_DisabledApps"
|
||||
Style="{StaticResource SettingsGroupTitleStyle}"
|
||||
Foreground="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToForegroundConverter}}"/>
|
||||
|
||||
<TextBox x:Uid="ShortcutGuide_DisabledApps_TextBoxControl"
|
||||
Margin="{StaticResource SmallTopMargin}"
|
||||
Text="{x:Bind Mode=TwoWay, Path=ViewModel.DisabledApps}"
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
|
||||
ScrollViewer.VerticalScrollBarVisibility ="Visible"
|
||||
ScrollViewer.VerticalScrollMode="Enabled"
|
||||
ScrollViewer.IsVerticalRailEnabled="True"
|
||||
TextWrapping="Wrap"
|
||||
AcceptsReturn="True"
|
||||
HorizontalAlignment="Left"
|
||||
MinWidth="240"
|
||||
MinHeight="160" />
|
||||
</StackPanel>
|
||||
|
||||
<RelativePanel x:Name="SidePanel"
|
||||
|
||||
Reference in New Issue
Block a user