[Settings V2] Upated Fancy Zone and Shortcut Guid default values. (#2786)

* upated Fancy Zone and Shortcut Guid default values.

* upated fz tests
This commit is contained in:
Lavius Motileng
2020-05-08 08:22:57 -07:00
committed by GitHub
parent dad65998cc
commit 1ab0a5182f
10 changed files with 425 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Microsoft.PowerToys.Settings.UI.Lib
@@ -9,23 +10,32 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
{
public FZConfigProperties()
{
this.FancyzonesShiftDrag = new BoolProperty();
this.FancyzonesMouseSwitch = new BoolProperty();
this.FancyzonesShiftDrag = new BoolProperty(true);
this.FancyzonesOverrideSnapHotkeys = new BoolProperty();
this.FancyzonesMouseSwitch = new BoolProperty();
this.FancyzonesMoveWindowsAcrossMonitors = new BoolProperty();
this.FancyzonesDisplayChangeMoveWindows = new BoolProperty();
this.FancyzonesZoneSetChangeMoveWindows = new BoolProperty();
this.FancyzonesVirtualDesktopChangeMoveWindows = new BoolProperty();
this.FancyzonesAppLastZoneMoveWindows = new BoolProperty();
this.UseCursorposEditorStartupscreen = new BoolProperty();
this.UseCursorposEditorStartupscreen = new BoolProperty(true);
this.FancyzonesShowOnAllMonitors = new BoolProperty();
this.FancyzonesZoneHighlightColor = new StringProperty("#F5FCFF");
this.FancyzonesHighlightOpacity = new IntProperty(50);
this.FancyzonesEditorHotkey = new KeyBoardKeysProperty(
new HotkeySettings()
{
Win = true,
Ctrl = false,
Alt = false,
Shift = false,
Key = "`",
Code = 192,
});
this.FancyzonesMakeDraggedWindowTransparent = new BoolProperty();
this.FancyzonesZoneHighlightColor = new StringProperty();
this.FancyzonesHighlightOpacity = new IntProperty();
this.FancyzonesEditorHotkey = new KeyBoardKeysProperty();
this.FancyzonesExcludedApps = new StringProperty();
this.FancyzonesInActiveColor = new StringProperty();
this.FancyzonesBorderColor = new StringProperty();
this.FancyzonesInActiveColor = new StringProperty("#F5FCFF");
this.FancyzonesBorderColor = new StringProperty("#F5FCFF");
}
[JsonPropertyName("fancyzones_shiftDrag")]
@@ -78,5 +88,11 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
[JsonPropertyName("fancyzones_zoneColor")]
public StringProperty FancyzonesInActiveColor { get; set; }
// converts the current to a json string.
public string ToJsonString()
{
return JsonSerializer.Serialize(this);
}
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Microsoft.PowerToys.Settings.UI.Lib
{
public class FancyZonesSettingsIPCMessage
{
[JsonPropertyName("powertoys")]
public SndFancyZonesSettings Powertoys { get; set; }
public FancyZonesSettingsIPCMessage()
{
}
public FancyZonesSettingsIPCMessage(SndFancyZonesSettings settings)
{
this.Powertoys = settings;
}
public string ToJsonString()
{
return JsonSerializer.Serialize(this);
}
}
}

View File

@@ -20,6 +20,16 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
this.Code = 0;
}
public HotkeySettings(bool win, bool ctrl, bool alt, bool shift, string key, int code)
{
Win = win;
Ctrl = ctrl;
Alt = alt;
Shift = shift;
Key = key;
Code = code;
}
[JsonPropertyName("win")]
public bool Win { get; set; }

View File

@@ -16,6 +16,11 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
this.Value = new HotkeySettings();
}
public KeyBoardKeysProperty(HotkeySettings hkSettings)
{
this.Value = hkSettings;
}
[JsonPropertyName("value")]
public HotkeySettings Value { get; set; }
}

View File

@@ -14,9 +14,9 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
{
public ShortcutGuideProperties()
{
OverlayOpacity = new IntProperty();
PressTime = new IntProperty();
Theme = new StringProperty();
OverlayOpacity = new IntProperty(90);
PressTime = new IntProperty(900);
Theme = new StringProperty("light");
}
[JsonPropertyName("overlay_opacity")]

View File

@@ -10,6 +10,10 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
{
public FancyZonesSettings FancyZones { get; set; }
public SndFancyZonesSettings()
{
}
public SndFancyZonesSettings(FancyZonesSettings settings)
{
this.FancyZones = settings;