[AlwaysOnTop] Round corners on Windows 11 (#19109)

* check window corners

* draw rounded rectangle

* draw rounded corners

* switch between rounded and not rounded rects

* added enabled corners setting

* update corner
This commit is contained in:
Seraphima Zykova
2022-07-01 17:56:45 +02:00
committed by GitHub
parent 35bb4280d0
commit d201ae4335
14 changed files with 175 additions and 28 deletions

View File

@@ -1996,7 +1996,7 @@ From there, simply click on one of the supported files in the File Explorer and
<data name="FileExplorerPreview_ToggleSwitch_Preview_GCODE.Header" xml:space="preserve">
<value>Geometric Code</value>
<comment>File type, do not translate</comment>
</data>
</data>
<data name="FileExplorerPreview_ToggleSwitch_Preview_GCODE.Description" xml:space="preserve">
<value>Only .gcode files with embedded thumbnails are supported</value>
</data>
@@ -2125,4 +2125,7 @@ From there, simply click on one of the supported files in the File Explorer and
<data name="FancyZones_DisableRoundCornersOnWindowSnap.Content" xml:space="preserve">
<value>Disable round corners when window is snapped</value>
</data>
</root>
<data name="AlwaysOnTop_RoundCorners.Content" xml:space="preserve">
<value>Enable round corners</value>
</data>
</root>

View File

@@ -12,6 +12,7 @@
<Page.Resources>
<converters:BoolToObjectConverter x:Key="BoolToComboBoxIndexConverter" TrueValue="1" FalseValue="0"/>
<converters:BoolToVisibilityConverter x:Key="FalseToVisibleConverter" TrueValue="Collapsed" FalseValue="Visible"/>
<converters:BoolToVisibilityConverter x:Key="TrueToVisibleConverter" TrueValue="Visible" FalseValue="Collapsed"/>
</Page.Resources>
<controls:SettingsPageControl x:Uid="AlwaysOnTop" IsTabStop="False"
@@ -84,6 +85,12 @@
LargeChange="5"/>
</controls:Setting.ActionContent>
</controls:Setting>
<CheckBox x:Uid="AlwaysOnTop_RoundCorners"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.RoundCornersEnabled}"
Margin="{StaticResource ExpanderSettingMargin}"
Visibility="{x:Bind Mode=OneWay, Path=ViewModel.Windows11, Converter={StaticResource TrueToVisibleConverter}}"/>
</StackPanel>
</controls:SettingExpander.Content>
</controls:SettingExpander>