mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
[Monaco]Make minimap toggleable (#33742)
This commit is contained in:
@@ -396,13 +396,14 @@ namespace Microsoft.PowerToys.PreviewHandler.Monaco
|
||||
// prepping index html to load in
|
||||
_html = FilePreviewCommon.MonacoHelper.ReadIndexHtml();
|
||||
_html = _html.Replace("[[PT_LANG]]", _vsCodeLangSet, StringComparison.InvariantCulture);
|
||||
_html = _html.Replace("[[PT_WRAP]]", _settings.Wrap ? "1" : "0", StringComparison.InvariantCulture);
|
||||
_html = _html.Replace("[[PT_CONTEXTMENU]]", "1", StringComparison.InvariantCulture);
|
||||
_html = _html.Replace("[[PT_WRAP]]", _settings.Wrap ? "true" : "false", StringComparison.InvariantCulture);
|
||||
_html = _html.Replace("[[PT_CONTEXTMENU]]", "true", StringComparison.InvariantCulture);
|
||||
_html = _html.Replace("[[PT_THEME]]", Settings.GetTheme(), StringComparison.InvariantCulture);
|
||||
_html = _html.Replace("[[PT_STICKY_SCROLL]]", _settings.StickyScroll ? "1" : "0", StringComparison.InvariantCulture);
|
||||
_html = _html.Replace("[[PT_STICKY_SCROLL]]", _settings.StickyScroll ? "true" : "false", StringComparison.InvariantCulture);
|
||||
_html = _html.Replace("[[PT_FONT_SIZE]]", _settings.FontSize.ToString(CultureInfo.InvariantCulture), StringComparison.InvariantCulture);
|
||||
_html = _html.Replace("[[PT_CODE]]", _base64FileCode, StringComparison.InvariantCulture);
|
||||
_html = _html.Replace("[[PT_URL]]", FilePreviewCommon.MonacoHelper.VirtualHostName, StringComparison.InvariantCulture);
|
||||
_html = _html.Replace("[[PT_MINIMAP]]", _settings.Minimap ? "true" : "false", StringComparison.InvariantCulture);
|
||||
}
|
||||
|
||||
private async void DownloadLink_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -118,6 +118,26 @@ namespace Microsoft.PowerToys.PreviewHandler.Monaco
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the minimap should be enabled. Set by PT settings.
|
||||
/// </summary>
|
||||
public bool Minimap
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return moduleSettings.GetSettings<PowerPreviewSettings>(PowerPreviewSettings.ModuleName).Properties.MonacoPreviewMinimap;
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
// Couldn't read the settings
|
||||
// Assume default of false
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the color of the window background.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user