mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
SvgPreviewControl: Add Background so that white .svg are visible (#25397)
* SvgPreviewControl: Add checkered background so that white .svg are visible * SvgPreviewControl: Move preview generation logic into own class * SvgPreviewControl: Add possibility to configure background of svg preview pane via the settings ui * SvgPreviewControl: Take user configuration into consideration when generating svg preview * SvgPreviewControl: Do not generate preview file, if the actual size is under the 2mb limiation of WebView2 * SvgPreviewControl: Introduce SvgPreviewColorMode enumeration instead of using magic values * SvgPreviewControl: Add additional checkered pattern shades * SvgPreviewControl: Use newly introduced enums as default values
This commit is contained in:
@@ -115,7 +115,7 @@
|
||||
IsOn="{x:Bind IsShown, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
OffContent=""
|
||||
OnContent="" />
|
||||
|
||||
|
||||
<Button
|
||||
x:Uid="More_Options_Button"
|
||||
Grid.Column="1"
|
||||
|
||||
@@ -22,14 +22,39 @@
|
||||
IsOpen="True"
|
||||
IsTabStop="True"
|
||||
Severity="Warning" />
|
||||
<labs:SettingsCard
|
||||
<labs:SettingsExpander
|
||||
x:Uid="FileExplorerPreview_ToggleSwitch_Preview_SVG"
|
||||
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=}"
|
||||
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsSVGRenderEnabledGpoConfigured, Converter={StaticResource BoolNegationConverter}}">
|
||||
<ToggleSwitch
|
||||
x:Uid="ToggleSwitch"
|
||||
IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.SVGRenderIsEnabled}" />
|
||||
</labs:SettingsCard>
|
||||
<labs:SettingsExpander.Items>
|
||||
<labs:SettingsCard x:Uid="FileExplorerPreview_Preview_SVG_Color_Mode">
|
||||
<ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind Path=ViewModel.SVGRenderBackgroundColorMode, Mode=TwoWay}"
|
||||
IsEnabled="{x:Bind ViewModel.SVGRenderIsEnabled, Mode=OneWay}">
|
||||
<ComboBoxItem x:Uid="FileExplorerPreview_Preview_SVG_Color_Mode_Default" />
|
||||
<ComboBoxItem x:Uid="FileExplorerPreview_Preview_SVG_Color_Solid_Color" />
|
||||
<ComboBoxItem x:Uid="FileExplorerPreview_Preview_SVG_Checkered_Shade" />
|
||||
</ComboBox>
|
||||
</labs:SettingsCard>
|
||||
<labs:SettingsCard x:Uid="FileExplorerPreview_Preview_SVG_Background_Color"
|
||||
Visibility="{x:Bind ViewModel.IsSvgBackgroundColorVisible, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}">
|
||||
<controls:ColorPickerButton
|
||||
IsEnabled="{x:Bind ViewModel.SVGRenderIsEnabled, Mode=OneWay}"
|
||||
SelectedColor="{x:Bind Path=ViewModel.SVGRenderBackgroundSolidColor, Mode=TwoWay}" />
|
||||
</labs:SettingsCard>
|
||||
<labs:SettingsCard x:Uid="FileExplorerPreview_Preview_SVG_Checkered_Shade_Mode"
|
||||
Visibility="{x:Bind ViewModel.IsSvgCheckeredShadeVisible, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}">
|
||||
<ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind Path=ViewModel.SVGRenderBackgroundCheckeredShade, Mode=TwoWay}"
|
||||
IsEnabled="{x:Bind ViewModel.SVGRenderIsEnabled, Mode=OneWay}">
|
||||
<ComboBoxItem x:Uid="FileExplorerPreview_Preview_SVG_Checkered_Shade_1" />
|
||||
<ComboBoxItem x:Uid="FileExplorerPreview_Preview_SVG_Checkered_Shade_2" />
|
||||
<ComboBoxItem x:Uid="FileExplorerPreview_Preview_SVG_Checkered_Shade_3" />
|
||||
</ComboBox>
|
||||
</labs:SettingsCard>
|
||||
</labs:SettingsExpander.Items>
|
||||
</labs:SettingsExpander>
|
||||
|
||||
<InfoBar
|
||||
x:Uid="GPO_IsSettingForced"
|
||||
|
||||
Reference in New Issue
Block a user