[DevFiles]Update Monaco dependency to 0.47, new sticky scroll setting (#32410)

* Update Monaco dependency to 0.47

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

* Fix Xaml styling
This commit is contained in:
Aaron Junker-Wildi
2024-04-19 15:09:46 +02:00
committed by GitHub
parent af5293cfb4
commit 05249ac432
128 changed files with 832 additions and 874 deletions

View File

@@ -398,6 +398,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Monaco
_html = _html.Replace("[[PT_WRAP]]", _settings.Wrap ? "1" : "0", StringComparison.InvariantCulture);
_html = _html.Replace("[[PT_THEME]]", Settings.GetTheme(), StringComparison.InvariantCulture);
_html = _html.Replace("[[PT_CODE]]", _base64FileCode, StringComparison.InvariantCulture);
_html = _html.Replace("[[PT_STICKY_SCROLL]]", _settings.StickyScroll ? "1" : "0", StringComparison.InvariantCulture);
_html = _html.Replace("[[PT_URL]]", FilePreviewCommon.MonacoHelper.VirtualHostName, StringComparison.InvariantCulture);
}

View File

@@ -77,6 +77,26 @@ namespace Microsoft.PowerToys.PreviewHandler.Monaco
}
}
/// <summary>
/// Gets a value indicating whether sticky scroll should be enabled. Set by PT settings.
/// </summary>
public bool StickyScroll
{
get
{
try
{
return moduleSettings.GetSettings<PowerPreviewSettings>(PowerPreviewSettings.ModuleName).Properties.MonacoPreviewStickyScroll;
}
catch (FileNotFoundException)
{
// Couldn't read the settings.
// Assume default of true.
return true;
}
}
}
/// <summary>
/// Gets the color of the window background.
/// </summary>