/ src / settings-ui / Settings.UI.Library / PowerDisplayProperties.cs
PowerDisplayProperties.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  using System.Collections.Generic;
 6  using System.Text.Json.Serialization;
 7  using PowerDisplay.Common.Models;
 8  using Settings.UI.Library.Attributes;
 9  
10  namespace Microsoft.PowerToys.Settings.UI.Library
11  {
12      public class PowerDisplayProperties
13      {
14          [CmdConfigureIgnore]
15          public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, true, false, true, 0x44); // Ctrl+Shift+Win+D (win, ctrl, alt, shift, code)
16  
17          public PowerDisplayProperties()
18          {
19              ActivationShortcut = DefaultActivationShortcut;
20              MonitorRefreshDelay = 5;
21              Monitors = new List<MonitorInfo>();
22              RestoreSettingsOnStartup = false;
23              ShowSystemTrayIcon = true;
24              ShowProfileSwitcher = true;
25              ShowIdentifyMonitorsButton = true;
26              CustomVcpMappings = new List<CustomVcpValueMapping>();
27  
28              // Note: saved_monitor_settings has been moved to monitor_state.json
29              // which is managed separately by PowerDisplay app
30          }
31  
32          [JsonPropertyName("activation_shortcut")]
33          public HotkeySettings ActivationShortcut { get; set; }
34  
35          /// <summary>
36          /// Gets or sets delay in seconds before refreshing monitors after display changes (hot-plug).
37          /// This allows hardware to stabilize before querying DDC/CI.
38          /// </summary>
39          [JsonPropertyName("monitor_refresh_delay")]
40          public int MonitorRefreshDelay { get; set; }
41  
42          [JsonPropertyName("monitors")]
43          public List<MonitorInfo> Monitors { get; set; }
44  
45          [JsonPropertyName("restore_settings_on_startup")]
46          public bool RestoreSettingsOnStartup { get; set; }
47  
48          [JsonPropertyName("show_system_tray_icon")]
49          public bool ShowSystemTrayIcon { get; set; }
50  
51          /// <summary>
52          /// Gets or sets whether to show the profile switcher button in the flyout UI.
53          /// Default is true. When false, the profile switcher is hidden (but profiles still work via Settings).
54          /// Note: Also hidden when no profiles exist.
55          /// </summary>
56          [JsonPropertyName("show_profile_switcher")]
57          public bool ShowProfileSwitcher { get; set; }
58  
59          /// <summary>
60          /// Gets or sets whether to show the identify monitors button in the flyout UI.
61          /// Default is true.
62          /// </summary>
63          [JsonPropertyName("show_identify_monitors_button")]
64          public bool ShowIdentifyMonitorsButton { get; set; }
65  
66          /// <summary>
67          /// Gets or sets custom VCP value name mappings shared across all monitors.
68          /// Allows users to define custom names for color temperature presets and input sources.
69          /// </summary>
70          [JsonPropertyName("custom_vcp_mappings")]
71          public List<CustomVcpValueMapping> CustomVcpMappings { get; set; }
72      }
73  }