Add SVG Thumbnail Provider for Windows Explorer (#5048)

* Add SVG Thumbnail Provider

* Some cleanup

* Small settings changes

* Update PowerToys.sln

Remove Any CPU entries

* Fix project configuration issues

* Fix bad merge

* Update output path for SVG thumbnail provider

* Sync with latest
This commit is contained in:
Chris Davis
2020-07-21 16:27:12 -07:00
committed by GitHub
parent 8e5a877997
commit 40d2ef4f0a
28 changed files with 1610 additions and 687 deletions

View File

@@ -422,6 +422,9 @@
</data>
<data name="FileExplorerPreview_ToggleSwitch_Preview_SVG.Header" xml:space="preserve">
<value>Enable SVG (.svg) preview</value>
</data>
<data name="FileExplorerPreview_ToggleSwitch_SVG_Thumbnail.Header" xml:space="preserve">
<value>Enable SVG (.svg) thumbnails</value>
</data>
<data name="FileExplorerPreview_Description.Text" xml:space="preserve">
<value>These settings allow you to manage your Windows File Explorer custom preview handlers.</value>

View File

@@ -27,12 +27,14 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
SettingsUtils.SaveSettings(Settings.ToJsonString(), ModuleName);
}
this._svgRenderIsEnabled = Settings.properties.EnableSvg;
this._mdRenderIsEnabled = Settings.properties.EnableMd;
this._svgRenderIsEnabled = Settings.properties.EnableSvgPreview;
this._svgThumbnailIsEnabled = Settings.properties.EnableSvgThumbnail;
this._mdRenderIsEnabled = Settings.properties.EnableMdPreview;
}
private bool _svgRenderIsEnabled = false;
private bool _mdRenderIsEnabled = false;
private bool _svgThumbnailIsEnabled = false;
public bool SVGRenderIsEnabled
{
@@ -46,7 +48,25 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
if (value != _svgRenderIsEnabled)
{
_svgRenderIsEnabled = value;
Settings.properties.EnableSvg = value;
Settings.properties.EnableSvgPreview = value;
RaisePropertyChanged();
}
}
}
public bool SVGThumbnailIsEnabled
{
get
{
return _svgThumbnailIsEnabled;
}
set
{
if (value != _svgThumbnailIsEnabled)
{
_svgThumbnailIsEnabled = value;
Settings.properties.EnableSvgThumbnail = value;
RaisePropertyChanged();
}
}
@@ -64,7 +84,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
if (value != _mdRenderIsEnabled)
{
_mdRenderIsEnabled = value;
Settings.properties.EnableMd = value;
Settings.properties.EnableMdPreview = value;
RaisePropertyChanged();
}
}

View File

@@ -50,6 +50,10 @@
Margin="{StaticResource MediumTopMargin}"
IsOn="{Binding Mode=TwoWay, Path=SVGRenderIsEnabled}" />
<ToggleSwitch x:Uid="FileExplorerPreview_ToggleSwitch_SVG_Thumbnail"
Margin="{StaticResource SmallTopMargin}"
IsOn="{Binding Mode=TwoWay, Path=SVGThumbnailIsEnabled}" />
<ToggleSwitch x:Uid="FileExplorerPreview_ToggleSwitch_Preview_MD"
Margin="{StaticResource SmallTopMargin}"
IsOn="{Binding Mode=TwoWay, Path=MDRenderIsEnabled}" />