[Monaco]Add option to set font size (#32559)

* Add setting to enable/disable it and add Peek support

* Add ability to set font size
This commit is contained in:
Aaron Junker-Wildi
2024-04-24 14:17:29 +02:00
committed by GitHub
parent 5b4da37a43
commit d9008186cf
14 changed files with 109 additions and 4 deletions

View File

@@ -16,12 +16,15 @@ namespace Settings.UI.Library
public BoolProperty SourceCodeTryFormat { get; set; }
public IntProperty SourceCodeFontSize { get; set; }
public BoolProperty SourceCodeStickyScroll { get; set; }
public PeekPreviewSettings()
{
SourceCodeWrapText = new BoolProperty(false);
SourceCodeTryFormat = new BoolProperty(false);
SourceCodeFontSize = new IntProperty(14);
SourceCodeStickyScroll = new BoolProperty(true);
}

View File

@@ -15,6 +15,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{
public const string DefaultStlThumbnailColor = "#FFC924";
public const int DefaultMonacoMaxFileSize = 50;
public const int DefaultMonacoFontSize = 14;
public const int DefaultSvgBackgroundColorMode = (int)SvgPreviewColorMode.Default;
public const string DefaultSvgBackgroundSolidColor = "#FFFFFF";
public const int DefaultSvgBackgroundCheckeredShade = (int)SvgPreviewCheckeredShade.Light;
@@ -133,6 +134,9 @@ namespace Microsoft.PowerToys.Settings.UI.Library
[JsonPropertyName("monaco-previewer-max-file-size")]
public IntProperty MonacoPreviewMaxFileSize { get; set; }
[JsonPropertyName("monaco-previewer-font-size")]
public IntProperty MonacoPreviewFontSize { get; set; }
private bool monacoPreviewStickyScroll = true;
[JsonPropertyName("monaco-previewer-sticky-scroll")]
@@ -279,6 +283,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library
SvgBackgroundCheckeredShade = new IntProperty(DefaultSvgBackgroundCheckeredShade);
StlThumbnailColor = new StringProperty(DefaultStlThumbnailColor);
MonacoPreviewMaxFileSize = new IntProperty(DefaultMonacoMaxFileSize);
MonacoPreviewFontSize = new IntProperty(DefaultMonacoFontSize);
}
public override string ToString()