mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[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:
committed by
GitHub
parent
af5293cfb4
commit
05249ac432
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user