Skip to content

Commit 0fb9700

Browse files
authored
Fix copybutton clipping (#1886)
XAML formatting + removing the hardcoded 30px height/width Closes #1885
1 parent a7b261f commit 0fb9700

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

WinUIGallery/Controls/SampleCodePresenter.xaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,35 @@
1010
Loaded="SampleCodePresenter_Loaded"
1111
mc:Ignorable="d">
1212

13-
<Grid Background="{x:Bind Background, Mode=OneWay}"
14-
BorderBrush="{x:Bind BorderBrush, Mode=OneWay}"
15-
BorderThickness="{x:Bind BorderThickness, Mode=OneWay}"
16-
CornerRadius="{x:Bind CornerRadius, Mode=OneWay}">
13+
<Grid
14+
Background="{x:Bind Background, Mode=OneWay}"
15+
BorderBrush="{x:Bind BorderBrush, Mode=OneWay}"
16+
BorderThickness="{x:Bind BorderThickness, Mode=OneWay}"
17+
CornerRadius="{x:Bind CornerRadius, Mode=OneWay}">
1718
<ScrollViewer
1819
x:Name="CodeScrollViewer"
1920
VerticalAlignment="{x:Bind VerticalContentAlignment, Mode=OneWay}"
2021
HorizontalScrollBarVisibility="Auto"
2122
HorizontalScrollMode="Auto"
23+
Loaded="CodeScrollViewer_Loaded"
2224
VerticalScrollBarVisibility="Auto"
23-
VerticalScrollMode="Auto"
24-
Loaded="CodeScrollViewer_Loaded">
25+
VerticalScrollMode="Auto">
2526
<ContentPresenter
2627
x:Name="CodePresenter"
2728
Padding="16,0,16,16"
2829
Loaded="CodePresenter_Loaded" />
2930
</ScrollViewer>
30-
<Border x:Name="CopyButtonBorder"
31-
Margin="0,0,8,0"
32-
CornerRadius="{ThemeResource ControlCornerRadius}"
33-
Background="{ThemeResource ControlOnImageFillColorDefaultBrush}"
34-
HorizontalAlignment="Right"
35-
VerticalAlignment="Top"
36-
Width="30" Height="30">
37-
<local:CopyButton x:Name="CopyCodeButton"
38-
Click="CopyCodeButton_Click"
39-
Content="&#xE8C8;" />
31+
<Border
32+
x:Name="CopyButtonBorder"
33+
Margin="0,0,8,0"
34+
HorizontalAlignment="Right"
35+
VerticalAlignment="Top"
36+
Background="{ThemeResource ControlOnImageFillColorDefaultBrush}"
37+
CornerRadius="{ThemeResource ControlCornerRadius}">
38+
<local:CopyButton
39+
x:Name="CopyCodeButton"
40+
Click="CopyCodeButton_Click"
41+
Content="&#xE8C8;" />
4042
</Border>
4143
<VisualStateManager.VisualStateGroups>
4244
<VisualStateGroup x:Name="SampleProgrammingLanguageState">

0 commit comments

Comments
 (0)