[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

@@ -55,6 +55,9 @@
IsChecked="{x:Bind ViewModel.SourceCodeTryFormat, Mode=TwoWay}"
IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard ContentAlignment="Left" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<CheckBox x:Uid="Peek_SourceCode_StickyScroll" IsChecked="{x:Bind ViewModel.SourceCodeStickyScroll, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
</tkcontrols:SettingsExpander.Items>
</tkcontrols:SettingsExpander>
</controls:SettingsGroup>

View File

@@ -89,6 +89,12 @@
SpinButtonPlacementMode="Compact"
Value="{x:Bind ViewModel.MonacoPreviewMaxFileSize, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard ContentAlignment="Left" IsEnabled="{x:Bind ViewModel.MonacoRenderIsEnabled, Mode=OneWay}">
<CheckBox
x:Uid="FileExplorerPreview_ToggleSwitch_Monaco_Sticky_Scroll"
IsChecked="{x:Bind ViewModel.MonacoPreviewStickyScroll, Mode=TwoWay}"
IsEnabled="{x:Bind ViewModel.MonacoRenderIsEnabled, Mode=OneWay}" />
</tkcontrols:SettingsCard>
</tkcontrols:SettingsExpander.Items>
</tkcontrols:SettingsExpander>

View File

@@ -4056,4 +4056,10 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="GPO_SomeThumbnailProvidersAreManaged.Title" xml:space="preserve">
<value>The enabled state of some thumbnail handlers is managed by your organization.</value>
</data>
<data name="FileExplorerPreview_ToggleSwitch_Monaco_Sticky_Scroll.Content" xml:space="preserve">
<value>Enable sticky scroll</value>
</data>
<data name="Peek_SourceCode_StickyScroll.Content" xml:space="preserve">
<value>Enable sticky scroll</value>
</data>
</root>

View File

@@ -173,6 +173,20 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
}
public bool SourceCodeStickyScroll
{
get => _peekPreviewSettings.SourceCodeStickyScroll.Value;
set
{
if (_peekPreviewSettings.SourceCodeStickyScroll.Value != value)
{
_peekPreviewSettings.SourceCodeStickyScroll.Value = value;
OnPropertyChanged(nameof(SourceCodeStickyScroll));
SavePreviewSettings();
}
}
}
private void NotifySettingsChanged()
{
// Using InvariantCulture as this is an IPC message

View File

@@ -92,6 +92,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
_monacoWrapText = Settings.Properties.EnableMonacoPreviewWordWrap;
_monacoPreviewTryFormat = Settings.Properties.MonacoPreviewTryFormat;
_monacoMaxFileSize = Settings.Properties.MonacoPreviewMaxFileSize.Value;
_monacoStickyScroll = Settings.Properties.MonacoPreviewStickyScroll;
_pdfRenderEnabledGpoRuleConfiguration = GPOWrapper.GetConfiguredPdfPreviewEnabledValue();
if (_pdfRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Disabled || _pdfRenderEnabledGpoRuleConfiguration == GpoRuleConfigured.Enabled)
@@ -231,6 +232,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
private bool _monacoWrapText;
private bool _monacoPreviewTryFormat;
private int _monacoMaxFileSize;
private bool _monacoStickyScroll;
private GpoRuleConfigured _pdfRenderEnabledGpoRuleConfiguration;
private bool _pdfRenderEnabledStateIsGPOConfigured;
@@ -595,6 +597,24 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
}
public bool MonacoPreviewStickyScroll
{
get
{
return _monacoStickyScroll;
}
set
{
if (_monacoStickyScroll != value)
{
_monacoStickyScroll = value;
Settings.Properties.MonacoPreviewStickyScroll = value;
RaisePropertyChanged();
}
}
}
public bool PDFRenderIsEnabled
{
get