/ src / settings-ui / Settings.UI.Library / AlwaysOnTopProperties.cs
AlwaysOnTopProperties.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.Text.Json;
 6  using System.Text.Json.Serialization;
 7  
 8  namespace Microsoft.PowerToys.Settings.UI.Library
 9  {
10      // Needs to be kept in sync with src\modules\alwaysontop\AlwaysOnTop\Settings.h
11      public class AlwaysOnTopProperties
12      {
13          public static readonly HotkeySettings DefaultHotkeyValue = new HotkeySettings(true, true, false, false, 0x54);
14          public const bool DefaultFrameEnabled = true;
15          public const int DefaultFrameThickness = 15;
16          public const string DefaultFrameColor = "#0099cc";
17          public const bool DefaultFrameAccentColor = true;
18          public const int DefaultFrameOpacity = 100;
19          public const bool DefaultSoundEnabled = true;
20          public const bool DefaultDoNotActivateOnGameMode = true;
21          public const bool DefaultRoundCornersEnabled = true;
22  
23          public AlwaysOnTopProperties()
24          {
25              Hotkey = new KeyboardKeysProperty(DefaultHotkeyValue);
26              FrameEnabled = new BoolProperty(DefaultFrameEnabled);
27              FrameThickness = new IntProperty(DefaultFrameThickness);
28              FrameColor = new StringProperty(DefaultFrameColor);
29              FrameAccentColor = new BoolProperty(DefaultFrameAccentColor);
30              FrameOpacity = new IntProperty(DefaultFrameOpacity);
31              SoundEnabled = new BoolProperty(DefaultSoundEnabled);
32              DoNotActivateOnGameMode = new BoolProperty(DefaultDoNotActivateOnGameMode);
33              RoundCornersEnabled = new BoolProperty(DefaultRoundCornersEnabled);
34              ExcludedApps = new StringProperty();
35          }
36  
37          [JsonPropertyName("hotkey")]
38          public KeyboardKeysProperty Hotkey { get; set; }
39  
40          [JsonPropertyName("frame-enabled")]
41          public BoolProperty FrameEnabled { get; set; }
42  
43          [JsonPropertyName("frame-thickness")]
44          public IntProperty FrameThickness { get; set; }
45  
46          [JsonPropertyName("frame-color")]
47          public StringProperty FrameColor { get; set; }
48  
49          [JsonPropertyName("frame-opacity")]
50          public IntProperty FrameOpacity { get; set; }
51  
52          [JsonPropertyName("frame-accent-color")]
53          public BoolProperty FrameAccentColor { get; set; }
54  
55          [JsonPropertyName("sound-enabled")]
56          public BoolProperty SoundEnabled { get; set; }
57  
58          [JsonPropertyName("do-not-activate-on-game-mode")]
59          public BoolProperty DoNotActivateOnGameMode { get; set; }
60  
61          [JsonPropertyName("excluded-apps")]
62          public StringProperty ExcludedApps { get; set; }
63  
64          [JsonPropertyName("round-corners-enabled")]
65          public BoolProperty RoundCornersEnabled { get; set; }
66  
67          public string ToJsonString()
68          {
69              return JsonSerializer.Serialize(this);
70          }
71      }
72  }