Files
PowerToys/src/settings-ui/Settings.UI.Library/PowerDisplayActionMessage.cs
Yu Leng fc54172e13 Refactor color temperature operation handling
Introduced `ColorTemperatureOperation` class to manage pending color temperature changes. Updated `MainViewModel` to process operations for specific monitors, improving efficiency and separation of concerns.

Added `PendingColorTemperatureOperation` property to `PowerDisplayProperties` for tracking operations. Enhanced IPC messaging with `MonitorId` and `ColorTemperature` in `PowerDisplayActionMessage`.

Refactored `PowerDisplayViewModel` and `PowerDisplayPage` to directly apply color temperature to specified monitors. Improved logging for better traceability.
2025-11-19 16:16:04 +08:00

39 lines
1.1 KiB
C#

// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text.Json.Serialization;
namespace Microsoft.PowerToys.Settings.UI.Library
{
/// <summary>
/// Message for PowerDisplay module actions
/// </summary>
public class PowerDisplayActionMessage
{
[JsonPropertyName("action")]
public ActionData Action { get; set; }
public class ActionData
{
[JsonPropertyName("PowerDisplay")]
public PowerDisplayAction PowerDisplay { get; set; }
}
public class PowerDisplayAction
{
[JsonPropertyName("action_name")]
public string ActionName { get; set; }
[JsonPropertyName("value")]
public string Value { get; set; }
[JsonPropertyName("monitor_id")]
public string MonitorId { get; set; }
[JsonPropertyName("color_temperature")]
public int ColorTemperature { get; set; }
}
}
}