mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
[Settings > Screen ruler] Fix disabled state of infobar (#20184)
* code changes * fix typo * Update src/settings-ui/Settings.UI.Library/ViewModels/MeasureToolViewModel.cs Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
This commit is contained in:
@@ -52,6 +52,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
SendConfigMSG(outgoing.ToString());
|
||||
|
||||
NotifyPropertyChanged();
|
||||
NotifyPropertyChanged(nameof(ShowContinuousCaptureWarning));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,6 +70,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
{
|
||||
Settings.Properties.ContinuousCapture = value;
|
||||
NotifyPropertyChanged();
|
||||
NotifyPropertyChanged(nameof(ShowContinuousCaptureWarning));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,9 +164,21 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
|
||||
public void NotifyPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
OnPropertyChanged(propertyName);
|
||||
|
||||
if (propertyName == nameof(ShowContinuousCaptureWarning))
|
||||
{
|
||||
// Don't trigger a settings update if the changed property is for visual notification.
|
||||
return;
|
||||
}
|
||||
|
||||
SettingsUtils.SaveSettings(Settings.ToJsonString(), MeasureToolSettings.ModuleName);
|
||||
}
|
||||
|
||||
public bool ShowContinuousCaptureWarning
|
||||
{
|
||||
get => IsEnabled && ContinuousCapture;
|
||||
}
|
||||
|
||||
private Func<string, int> SendConfigMSG { get; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user