2023-10-24 15:32:35 +02: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 Microsoft.PowerToys.Settings.UI.Library;
|
|
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Settings.UI.Library
|
|
|
|
|
|
{
|
|
|
|
|
|
public class PeekPreviewSettings : ISettingsConfig
|
|
|
|
|
|
{
|
|
|
|
|
|
public const string FileName = "preview-settings.json";
|
|
|
|
|
|
|
|
|
|
|
|
public BoolProperty SourceCodeWrapText { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public BoolProperty SourceCodeTryFormat { get; set; }
|
|
|
|
|
|
|
2024-04-24 14:17:29 +02:00
|
|
|
|
public IntProperty SourceCodeFontSize { get; set; }
|
|
|
|
|
|
|
2024-04-19 15:09:46 +02:00
|
|
|
|
public BoolProperty SourceCodeStickyScroll { get; set; }
|
|
|
|
|
|
|
2023-10-24 15:32:35 +02:00
|
|
|
|
public PeekPreviewSettings()
|
|
|
|
|
|
{
|
|
|
|
|
|
SourceCodeWrapText = new BoolProperty(false);
|
|
|
|
|
|
SourceCodeTryFormat = new BoolProperty(false);
|
2024-04-24 14:17:29 +02:00
|
|
|
|
SourceCodeFontSize = new IntProperty(14);
|
2024-04-19 15:09:46 +02:00
|
|
|
|
SourceCodeStickyScroll = new BoolProperty(true);
|
2023-10-24 15:32:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string ToJsonString()
|
|
|
|
|
|
{
|
|
|
|
|
|
return JsonSerializer.Serialize(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetModuleName()
|
|
|
|
|
|
{
|
|
|
|
|
|
return PeekSettings.ModuleName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool UpgradeSettingsConfiguration()
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|