mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
Validate contrast and volume settings based on hardware support; log warnings for unsupported features.
This commit is contained in:
@@ -518,16 +518,29 @@ public class MainViewModel : INotifyPropertyChanged, IDisposable
|
||||
Logger.LogWarning($"[Startup] Invalid color temperature value {savedState.Value.ColorTemperature} for '{internalName}', skipping");
|
||||
}
|
||||
|
||||
// 对比度和音量值验证
|
||||
if (savedState.Value.Contrast >= monitorVm.MinContrast && savedState.Value.Contrast <= monitorVm.MaxContrast)
|
||||
// 对比度值验证 - 只在硬件支持的情况下才应用
|
||||
if (monitorVm.ShowContrast &&
|
||||
savedState.Value.Contrast >= monitorVm.MinContrast &&
|
||||
savedState.Value.Contrast <= monitorVm.MaxContrast)
|
||||
{
|
||||
monitorVm.Contrast = savedState.Value.Contrast;
|
||||
}
|
||||
else if (!monitorVm.ShowContrast)
|
||||
{
|
||||
Logger.LogInfo($"[Startup] Contrast not supported on '{internalName}', skipping");
|
||||
}
|
||||
|
||||
if (savedState.Value.Volume >= monitorVm.MinVolume && savedState.Value.Volume <= monitorVm.MaxVolume)
|
||||
// 音量值验证 - 只在硬件支持的情况下才应用
|
||||
if (monitorVm.ShowVolume &&
|
||||
savedState.Value.Volume >= monitorVm.MinVolume &&
|
||||
savedState.Value.Volume <= monitorVm.MaxVolume)
|
||||
{
|
||||
monitorVm.Volume = savedState.Value.Volume;
|
||||
}
|
||||
else if (!monitorVm.ShowVolume)
|
||||
{
|
||||
Logger.LogInfo($"[Startup] Volume not supported on '{internalName}', skipping");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user