mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
Fix color temperature doesn't work issue
This commit is contained in:
@@ -501,9 +501,9 @@ public partial class MainViewModel : INotifyPropertyChanged, IDisposable
|
||||
updateTasks.Add(task);
|
||||
}
|
||||
|
||||
// Apply color temperature if changed and feature is enabled
|
||||
if (monitorVm.ShowColorTemperature &&
|
||||
monitorSettings.ColorTemperature > 0 &&
|
||||
// Apply color temperature if changed
|
||||
// Note: ColorTemperature is now Settings UI-only (no flyout control)
|
||||
if (monitorSettings.ColorTemperature > 0 &&
|
||||
monitorSettings.ColorTemperature != monitorVm.ColorTemperature)
|
||||
{
|
||||
Logger.LogInfo($"[Settings] Scheduling color temperature update for {hardwareId}: 0x{monitorSettings.ColorTemperature:X2}");
|
||||
@@ -750,9 +750,8 @@ public partial class MainViewModel : INotifyPropertyChanged, IDisposable
|
||||
|
||||
if (monitorSettings != null)
|
||||
{
|
||||
Logger.LogInfo($"[Startup] Applying feature visibility for Hardware ID '{monitorVm.HardwareId}': ColorTemp={monitorSettings.EnableColorTemperature}, Contrast={monitorSettings.EnableContrast}, Volume={monitorSettings.EnableVolume}");
|
||||
Logger.LogInfo($"[Startup] Applying feature visibility for Hardware ID '{monitorVm.HardwareId}': Contrast={monitorSettings.EnableContrast}, Volume={monitorSettings.EnableVolume}");
|
||||
|
||||
monitorVm.ShowColorTemperature = monitorSettings.EnableColorTemperature;
|
||||
monitorVm.ShowContrast = monitorSettings.EnableContrast;
|
||||
monitorVm.ShowVolume = monitorSettings.EnableVolume;
|
||||
}
|
||||
@@ -852,7 +851,6 @@ public partial class MainViewModel : INotifyPropertyChanged, IDisposable
|
||||
if (existingMonitorSettings.TryGetValue(vm.HardwareId, out var existingMonitor))
|
||||
{
|
||||
monitorInfo.IsHidden = existingMonitor.IsHidden;
|
||||
monitorInfo.EnableColorTemperature = existingMonitor.EnableColorTemperature;
|
||||
monitorInfo.EnableContrast = existingMonitor.EnableContrast;
|
||||
monitorInfo.EnableVolume = existingMonitor.EnableVolume;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ public partial class MonitorViewModel : INotifyPropertyChanged, IDisposable
|
||||
private bool _isAvailable;
|
||||
|
||||
// Visibility settings (controlled by Settings UI)
|
||||
private bool _showColorTemperature;
|
||||
private bool _showContrast;
|
||||
private bool _showVolume;
|
||||
|
||||
@@ -283,7 +282,6 @@ public partial class MonitorViewModel : INotifyPropertyChanged, IDisposable
|
||||
}
|
||||
|
||||
// Initialize Show properties based on hardware capabilities
|
||||
_showColorTemperature = monitor.SupportsColorTemperature; // Only show for DDC/CI monitors that support it
|
||||
_showContrast = monitor.SupportsContrast;
|
||||
_showVolume = monitor.SupportsVolume;
|
||||
|
||||
@@ -336,21 +334,7 @@ public partial class MonitorViewModel : INotifyPropertyChanged, IDisposable
|
||||
public int MaxVolume => _monitor.MaxVolume;
|
||||
|
||||
// Advanced control display logic
|
||||
public bool HasAdvancedControls => ShowColorTemperature || ShowContrast || ShowVolume;
|
||||
|
||||
public bool ShowColorTemperature
|
||||
{
|
||||
get => _showColorTemperature;
|
||||
set
|
||||
{
|
||||
if (_showColorTemperature != value)
|
||||
{
|
||||
_showColorTemperature = value;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(HasAdvancedControls));
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool HasAdvancedControls => ShowContrast || ShowVolume;
|
||||
|
||||
public bool ShowContrast
|
||||
{
|
||||
|
||||
@@ -20,7 +20,6 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
private int _currentBrightness;
|
||||
private int _colorTemperature = 6500;
|
||||
private bool _isHidden;
|
||||
private bool _enableColorTemperature;
|
||||
private bool _enableContrast;
|
||||
private bool _enableVolume;
|
||||
private string _capabilitiesRaw = string.Empty;
|
||||
@@ -171,21 +170,6 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
||||
}
|
||||
}
|
||||
|
||||
[JsonPropertyName("enableColorTemperature")]
|
||||
public bool EnableColorTemperature
|
||||
{
|
||||
get => _enableColorTemperature;
|
||||
set
|
||||
{
|
||||
if (_enableColorTemperature != value)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"[MonitorInfo] EnableColorTemperature changing from {_enableColorTemperature} to {value} for monitor {Name}");
|
||||
_enableColorTemperature = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[JsonPropertyName("enableContrast")]
|
||||
public bool EnableContrast
|
||||
{
|
||||
|
||||
@@ -156,24 +156,6 @@
|
||||
</ToolTipService.ToolTip>
|
||||
</ComboBox>
|
||||
</tkcontrols:SettingsCard>
|
||||
<tkcontrols:SettingsCard
|
||||
x:Uid="PowerDisplay_Monitor_EnableColorTemperature"
|
||||
IsEnabled="{x:Bind SupportsColorTemperature, Mode=OneWay}">
|
||||
<tkcontrols:SettingsCard.Description>
|
||||
<TextBlock
|
||||
Text="{x:Bind ColorTemperatureTooltip, Mode=OneWay}"
|
||||
Visibility="{x:Bind SupportsColorTemperature, Mode=OneWay, Converter={StaticResource ReverseBoolToVisibilityConverter}}"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
|
||||
</tkcontrols:SettingsCard.Description>
|
||||
<ToggleSwitch
|
||||
x:Uid="PowerDisplay_Monitor_EnableColorTemperature_ToggleSwitch"
|
||||
IsOn="{x:Bind EnableColorTemperature, Mode=TwoWay}"
|
||||
IsEnabled="{x:Bind SupportsColorTemperature, Mode=OneWay}">
|
||||
<ToolTipService.ToolTip>
|
||||
<TextBlock Text="{x:Bind ColorTemperatureTooltip, Mode=OneWay}" />
|
||||
</ToolTipService.ToolTip>
|
||||
</ToggleSwitch>
|
||||
</tkcontrols:SettingsCard>
|
||||
<tkcontrols:SettingsCard
|
||||
x:Uid="PowerDisplay_Monitor_EnableContrast"
|
||||
IsEnabled="{x:Bind SupportsContrast, Mode=OneWay}">
|
||||
|
||||
@@ -5598,18 +5598,6 @@ To record a specific window, enter the hotkey with the Alt key in the opposite m
|
||||
<data name="PowerDisplay_Monitor_ColorTemperature.Header" xml:space="preserve">
|
||||
<value>Color Temperature</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_Monitor_EnableColorTemperature.Header" xml:space="preserve">
|
||||
<value>Enable color temperature</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_Monitor_EnableColorTemperature.Description" xml:space="preserve">
|
||||
<value>Show color temperature control for this monitor</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_Monitor_EnableColorTemperature_ToggleSwitch.OnContent" xml:space="preserve">
|
||||
<value>On</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_Monitor_EnableColorTemperature_ToggleSwitch.OffContent" xml:space="preserve">
|
||||
<value>Off</value>
|
||||
</data>
|
||||
<data name="PowerDisplay_Monitor_EnableContrast.Header" xml:space="preserve">
|
||||
<value>Enable contrast</value>
|
||||
</data>
|
||||
|
||||
@@ -201,7 +201,6 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||
if (existingMonitors.TryGetValue(monitorKey, out var existingMonitor))
|
||||
{
|
||||
// Preserve user settings from existing monitor
|
||||
newMonitor.EnableColorTemperature = existingMonitor.EnableColorTemperature;
|
||||
newMonitor.EnableContrast = existingMonitor.EnableContrast;
|
||||
newMonitor.EnableVolume = existingMonitor.EnableVolume;
|
||||
newMonitor.IsHidden = existingMonitor.IsHidden;
|
||||
|
||||
Reference in New Issue
Block a user