2021-12-21 00:50:51 +08:00
|
|
|
// Copyright (c) Microsoft Corporation
|
2020-07-23 07:55:04 +08:00
|
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
2020-05-08 23:22:57 +08:00
|
|
|
using System.Text.Json;
|
2020-04-17 02:45:27 +08:00
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
2020-10-23 00:45:48 +08:00
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Library
|
2020-04-17 02:45:27 +08:00
|
|
|
{
|
|
|
|
public class FZConfigProperties
|
|
|
|
{
|
2021-04-15 17:11:08 +08:00
|
|
|
// in reality, this file needs to be kept in sync currently with src\modules\fancyzones\lib\Settings.h
|
2021-11-03 23:11:42 +08:00
|
|
|
public const int VkOem3 = 0xc0;
|
|
|
|
public const int VkNext = 0x22;
|
|
|
|
public const int VkPrior = 0x21;
|
|
|
|
|
|
|
|
public static readonly HotkeySettings DefaultEditorHotkeyValue = new HotkeySettings(true, false, false, true, VkOem3);
|
|
|
|
public static readonly HotkeySettings DefaultNextTabHotkeyValue = new HotkeySettings(true, false, false, false, VkNext);
|
|
|
|
public static readonly HotkeySettings DefaultPrevTabHotkeyValue = new HotkeySettings(true, false, false, false, VkPrior);
|
2020-07-24 06:53:12 +08:00
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
public FZConfigProperties()
|
|
|
|
{
|
2020-07-24 06:53:12 +08:00
|
|
|
FancyzonesShiftDrag = new BoolProperty(ConfigDefaults.DefaultFancyzonesShiftDrag);
|
|
|
|
FancyzonesOverrideSnapHotkeys = new BoolProperty();
|
|
|
|
FancyzonesMouseSwitch = new BoolProperty();
|
|
|
|
FancyzonesMoveWindowsAcrossMonitors = new BoolProperty();
|
2020-08-21 18:53:03 +08:00
|
|
|
FancyzonesMoveWindowsBasedOnPosition = new BoolProperty();
|
2021-02-25 23:23:05 +08:00
|
|
|
FancyzonesOverlappingZonesAlgorithm = new IntProperty();
|
2020-07-24 06:53:12 +08:00
|
|
|
FancyzonesDisplayChangeMoveWindows = new BoolProperty();
|
|
|
|
FancyzonesZoneSetChangeMoveWindows = new BoolProperty();
|
|
|
|
FancyzonesAppLastZoneMoveWindows = new BoolProperty();
|
|
|
|
FancyzonesOpenWindowOnActiveMonitor = new BoolProperty();
|
|
|
|
FancyzonesRestoreSize = new BoolProperty();
|
2021-03-25 20:44:55 +08:00
|
|
|
FancyzonesQuickLayoutSwitch = new BoolProperty(ConfigDefaults.DefaultFancyzonesQuickLayoutSwitch);
|
|
|
|
FancyzonesFlashZonesOnQuickSwitch = new BoolProperty(ConfigDefaults.DefaultFancyzonesFlashZonesOnQuickSwitch);
|
2020-07-24 06:53:12 +08:00
|
|
|
UseCursorposEditorStartupscreen = new BoolProperty(ConfigDefaults.DefaultUseCursorposEditorStartupscreen);
|
|
|
|
FancyzonesShowOnAllMonitors = new BoolProperty();
|
2020-08-07 16:06:25 +08:00
|
|
|
FancyzonesSpanZonesAcrossMonitors = new BoolProperty();
|
2020-07-24 06:53:12 +08:00
|
|
|
FancyzonesZoneHighlightColor = new StringProperty(ConfigDefaults.DefaultFancyZonesZoneHighlightColor);
|
|
|
|
FancyzonesHighlightOpacity = new IntProperty(50);
|
2021-11-03 23:11:42 +08:00
|
|
|
FancyzonesEditorHotkey = new KeyboardKeysProperty(DefaultEditorHotkeyValue);
|
|
|
|
FancyzonesWindowSwitching = new BoolProperty(true);
|
|
|
|
FancyzonesNextTabHotkey = new KeyboardKeysProperty(DefaultNextTabHotkeyValue);
|
|
|
|
FancyzonesPrevTabHotkey = new KeyboardKeysProperty(DefaultPrevTabHotkeyValue);
|
2020-07-24 06:53:12 +08:00
|
|
|
FancyzonesMakeDraggedWindowTransparent = new BoolProperty();
|
2022-02-23 22:25:28 +08:00
|
|
|
FancyzonesAllowPopupWindowSnap = new BoolProperty();
|
|
|
|
FancyzonesAllowChildWindowSnap = new BoolProperty();
|
2022-04-02 00:28:19 +08:00
|
|
|
FancyzonesDisableRoundCornersOnSnap = new BoolProperty();
|
2020-07-24 06:53:12 +08:00
|
|
|
FancyzonesExcludedApps = new StringProperty();
|
|
|
|
FancyzonesInActiveColor = new StringProperty(ConfigDefaults.DefaultFancyZonesInActiveColor);
|
|
|
|
FancyzonesBorderColor = new StringProperty(ConfigDefaults.DefaultFancyzonesBorderColor);
|
2021-12-21 00:50:51 +08:00
|
|
|
FancyzonesNumberColor = new StringProperty(ConfigDefaults.DefaultFancyzonesNumberColor);
|
2021-11-04 22:30:06 +08:00
|
|
|
FancyzonesSystemTheme = new BoolProperty(true);
|
2021-12-21 00:50:51 +08:00
|
|
|
FancyzonesShowZoneNumber = new BoolProperty(true);
|
2020-04-17 02:45:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_shiftDrag")]
|
|
|
|
public BoolProperty FancyzonesShiftDrag { get; set; }
|
|
|
|
|
2020-05-08 04:29:02 +08:00
|
|
|
[JsonPropertyName("fancyzones_mouseSwitch")]
|
|
|
|
public BoolProperty FancyzonesMouseSwitch { get; set; }
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
[JsonPropertyName("fancyzones_overrideSnapHotkeys")]
|
|
|
|
public BoolProperty FancyzonesOverrideSnapHotkeys { get; set; }
|
|
|
|
|
2020-05-08 04:29:02 +08:00
|
|
|
[JsonPropertyName("fancyzones_moveWindowAcrossMonitors")]
|
|
|
|
public BoolProperty FancyzonesMoveWindowsAcrossMonitors { get; set; }
|
2020-04-17 02:45:27 +08:00
|
|
|
|
2020-08-21 18:53:03 +08:00
|
|
|
[JsonPropertyName("fancyzones_moveWindowsBasedOnPosition")]
|
|
|
|
public BoolProperty FancyzonesMoveWindowsBasedOnPosition { get; set; }
|
|
|
|
|
2021-02-25 23:23:05 +08:00
|
|
|
[JsonPropertyName("fancyzones_overlappingZonesAlgorithm")]
|
|
|
|
public IntProperty FancyzonesOverlappingZonesAlgorithm { get; set; }
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
[JsonPropertyName("fancyzones_displayChange_moveWindows")]
|
|
|
|
public BoolProperty FancyzonesDisplayChangeMoveWindows { get; set; }
|
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_zoneSetChange_moveWindows")]
|
|
|
|
public BoolProperty FancyzonesZoneSetChangeMoveWindows { get; set; }
|
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_appLastZone_moveWindows")]
|
|
|
|
public BoolProperty FancyzonesAppLastZoneMoveWindows { get; set; }
|
|
|
|
|
2020-07-08 16:37:42 +08:00
|
|
|
[JsonPropertyName("fancyzones_openWindowOnActiveMonitor")]
|
|
|
|
public BoolProperty FancyzonesOpenWindowOnActiveMonitor { get; set; }
|
|
|
|
|
2020-07-01 21:36:05 +08:00
|
|
|
[JsonPropertyName("fancyzones_restoreSize")]
|
|
|
|
public BoolProperty FancyzonesRestoreSize { get; set; }
|
|
|
|
|
2021-03-25 20:44:55 +08:00
|
|
|
[JsonPropertyName("fancyzones_quickLayoutSwitch")]
|
|
|
|
public BoolProperty FancyzonesQuickLayoutSwitch { get; set; }
|
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_flashZonesOnQuickSwitch")]
|
|
|
|
public BoolProperty FancyzonesFlashZonesOnQuickSwitch { get; set; }
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
[JsonPropertyName("use_cursorpos_editor_startupscreen")]
|
|
|
|
public BoolProperty UseCursorposEditorStartupscreen { get; set; }
|
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_show_on_all_monitors")]
|
|
|
|
public BoolProperty FancyzonesShowOnAllMonitors { get; set; }
|
|
|
|
|
2020-08-07 16:06:25 +08:00
|
|
|
[JsonPropertyName("fancyzones_span_zones_across_monitors")]
|
|
|
|
public BoolProperty FancyzonesSpanZonesAcrossMonitors { get; set; }
|
|
|
|
|
2020-05-08 04:29:02 +08:00
|
|
|
[JsonPropertyName("fancyzones_makeDraggedWindowTransparent")]
|
|
|
|
public BoolProperty FancyzonesMakeDraggedWindowTransparent { get; set; }
|
|
|
|
|
2022-02-23 22:25:28 +08:00
|
|
|
[JsonPropertyName("fancyzones_allowPopupWindowSnap")]
|
|
|
|
public BoolProperty FancyzonesAllowPopupWindowSnap { get; set; }
|
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_allowChildWindowSnap")]
|
|
|
|
public BoolProperty FancyzonesAllowChildWindowSnap { get; set; }
|
|
|
|
|
2022-04-02 00:28:19 +08:00
|
|
|
[JsonPropertyName("fancyzones_disableRoundCornersOnSnap")]
|
|
|
|
public BoolProperty FancyzonesDisableRoundCornersOnSnap { get; set; }
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
[JsonPropertyName("fancyzones_zoneHighlightColor")]
|
|
|
|
public StringProperty FancyzonesZoneHighlightColor { get; set; }
|
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_highlight_opacity")]
|
|
|
|
public IntProperty FancyzonesHighlightOpacity { get; set; }
|
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_editor_hotkey")]
|
2020-07-22 05:06:39 +08:00
|
|
|
public KeyboardKeysProperty FancyzonesEditorHotkey { get; set; }
|
2020-04-17 02:45:27 +08:00
|
|
|
|
2021-11-03 23:11:42 +08:00
|
|
|
[JsonPropertyName("fancyzones_windowSwitching")]
|
|
|
|
public BoolProperty FancyzonesWindowSwitching { get; set; }
|
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_nextTab_hotkey")]
|
|
|
|
public KeyboardKeysProperty FancyzonesNextTabHotkey { get; set; }
|
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_prevTab_hotkey")]
|
|
|
|
public KeyboardKeysProperty FancyzonesPrevTabHotkey { get; set; }
|
|
|
|
|
2020-04-17 02:45:27 +08:00
|
|
|
[JsonPropertyName("fancyzones_excluded_apps")]
|
|
|
|
public StringProperty FancyzonesExcludedApps { get; set; }
|
2020-04-18 06:25:08 +08:00
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_zoneBorderColor")]
|
|
|
|
public StringProperty FancyzonesBorderColor { get; set; }
|
|
|
|
|
|
|
|
[JsonPropertyName("fancyzones_zoneColor")]
|
|
|
|
public StringProperty FancyzonesInActiveColor { get; set; }
|
2020-05-08 23:22:57 +08:00
|
|
|
|
2021-12-21 00:50:51 +08:00
|
|
|
[JsonPropertyName("fancyzones_zoneNumberColor")]
|
|
|
|
public StringProperty FancyzonesNumberColor { get; set; }
|
|
|
|
|
2021-11-04 22:30:06 +08:00
|
|
|
[JsonPropertyName("fancyzones_systemTheme")]
|
|
|
|
public BoolProperty FancyzonesSystemTheme { get; set; }
|
|
|
|
|
2021-12-21 00:50:51 +08:00
|
|
|
[JsonPropertyName("fancyzones_showZoneNumber")]
|
|
|
|
public BoolProperty FancyzonesShowZoneNumber { get; set; }
|
|
|
|
|
2020-05-08 23:22:57 +08:00
|
|
|
// converts the current to a json string.
|
|
|
|
public string ToJsonString()
|
|
|
|
{
|
|
|
|
return JsonSerializer.Serialize(this);
|
|
|
|
}
|
2020-04-17 02:45:27 +08:00
|
|
|
}
|
|
|
|
}
|