2024-05-09 10:32:03 -04:00
|
|
|
|
// 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;
|
|
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
using Settings.UI.Library.Attributes;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Library
|
|
|
|
|
|
{
|
|
|
|
|
|
public class AdvancedPasteProperties
|
|
|
|
|
|
{
|
|
|
|
|
|
public static readonly HotkeySettings DefaultAdvancedPasteUIShortcut = new HotkeySettings(true, false, false, true, 0x56); // Win+Shift+V
|
|
|
|
|
|
|
|
|
|
|
|
public static readonly HotkeySettings DefaultPasteAsPlainTextShortcut = new HotkeySettings(true, true, true, false, 0x56); // Ctrl+Win+Alt+V
|
|
|
|
|
|
|
|
|
|
|
|
public AdvancedPasteProperties()
|
|
|
|
|
|
{
|
|
|
|
|
|
AdvancedPasteUIShortcut = DefaultAdvancedPasteUIShortcut;
|
|
|
|
|
|
PasteAsPlainTextShortcut = DefaultPasteAsPlainTextShortcut;
|
|
|
|
|
|
PasteAsMarkdownShortcut = new();
|
|
|
|
|
|
PasteAsJsonShortcut = new();
|
|
|
|
|
|
ShowCustomPreview = true;
|
|
|
|
|
|
SendPasteKeyCombination = true;
|
2024-06-24 16:03:46 +02:00
|
|
|
|
CloseAfterLosingFocus = false;
|
2024-05-09 10:32:03 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[JsonConverter(typeof(BoolPropertyJsonConverter))]
|
|
|
|
|
|
public bool ShowCustomPreview { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonConverter(typeof(BoolPropertyJsonConverter))]
|
|
|
|
|
|
[CmdConfigureIgnore]
|
|
|
|
|
|
public bool SendPasteKeyCombination { get; set; }
|
|
|
|
|
|
|
2024-06-24 16:03:46 +02:00
|
|
|
|
[JsonConverter(typeof(BoolPropertyJsonConverter))]
|
|
|
|
|
|
public bool CloseAfterLosingFocus { get; set; }
|
|
|
|
|
|
|
2024-05-09 10:32:03 -04:00
|
|
|
|
[JsonPropertyName("advanced-paste-ui-hotkey")]
|
|
|
|
|
|
public HotkeySettings AdvancedPasteUIShortcut { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("paste-as-plain-hotkey")]
|
|
|
|
|
|
public HotkeySettings PasteAsPlainTextShortcut { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("paste-as-markdown-hotkey")]
|
|
|
|
|
|
public HotkeySettings PasteAsMarkdownShortcut { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("paste-as-json-hotkey")]
|
|
|
|
|
|
public HotkeySettings PasteAsJsonShortcut { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
=> JsonSerializer.Serialize(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|