Skip to content

Commit 94461a7

Browse files
committed
Centered pegs
1 parent 2eb0935 commit 94461a7

1 file changed

Lines changed: 41 additions & 36 deletions

File tree

src/Codebreaker.MAUI/Views/Templates/CodebreakerTemplates.xaml

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,47 +22,52 @@
2222

2323
<DataTemplate x:Key="PegsTemplate">
2424
<ViewCell>
25-
<Grid ColumnDefinitions="Auto, Auto, Auto">
26-
<Border Grid.Column="1" StrokeThickness="2" Stroke="{StaticResource Black}">
27-
<HorizontalStackLayout Margin="16,0,0,0" BindableLayout.ItemsSource="{Binding Path=GuessPegs}">
28-
<HorizontalStackLayout.Resources>
29-
<Style TargetType="Ellipse">
30-
<Setter Property="WidthRequest" Value="38" />
31-
<Setter Property="HeightRequest" Value="38" />
32-
<Setter Property="Margin" Value="6, 4" />
33-
</Style>
34-
</HorizontalStackLayout.Resources>
35-
<BindableLayout.ItemTemplate>
36-
<DataTemplate>
37-
<Ellipse Fill="{Binding Converter={StaticResource ColorConverter}}" />
38-
</DataTemplate>
39-
</BindableLayout.ItemTemplate>
40-
</HorizontalStackLayout>
41-
</Border>
42-
43-
<Border
44-
Grid.Column="2"
45-
StrokeThickness="2"
46-
Stroke="{StaticResource Black}">
47-
<Grid Margin="12,0,0,0" RowDefinitions="*, *">
48-
<Grid.Resources>
49-
<Style TargetType="Ellipse">
50-
<Setter Property="Stroke" Value="White" />
51-
<Setter Property="StrokeThickness" Value="2" />
52-
<Setter Property="WidthRequest" Value="16" />
53-
<Setter Property="HeightRequest" Value="16" />
54-
<Setter Property="Margin" Value="8" />
55-
</Style>
56-
</Grid.Resources>
57-
<HorizontalStackLayout BindableLayout.ItemsSource="{Binding Path=KeyPegs}">
25+
<Grid ColumnDefinitions="*, 400, *" HorizontalOptions="FillAndExpand">
26+
<HorizontalStackLayout Grid.Column="1">
27+
<Border
28+
HorizontalOptions="Start"
29+
StrokeThickness="2"
30+
Stroke="{StaticResource Black}">
31+
<HorizontalStackLayout Margin="16,0,0,0" BindableLayout.ItemsSource="{Binding Path=GuessPegs}">
32+
<HorizontalStackLayout.Resources>
33+
<Style TargetType="Ellipse">
34+
<Setter Property="WidthRequest" Value="38" />
35+
<Setter Property="HeightRequest" Value="38" />
36+
<Setter Property="Margin" Value="6, 4" />
37+
</Style>
38+
</HorizontalStackLayout.Resources>
5839
<BindableLayout.ItemTemplate>
5940
<DataTemplate>
60-
<Ellipse Fill="{Binding Converter={StaticResource PegColorConverter}}" />
41+
<Ellipse Fill="{Binding Converter={StaticResource ColorConverter}}" />
6142
</DataTemplate>
6243
</BindableLayout.ItemTemplate>
6344
</HorizontalStackLayout>
64-
</Grid>
65-
</Border>
45+
</Border>
46+
47+
<Border
48+
HorizontalOptions="Start"
49+
StrokeThickness="2"
50+
Stroke="{StaticResource Black}">
51+
<Grid Margin="12,0,0,0" RowDefinitions="*, *">
52+
<Grid.Resources>
53+
<Style TargetType="Ellipse">
54+
<Setter Property="Stroke" Value="White" />
55+
<Setter Property="StrokeThickness" Value="2" />
56+
<Setter Property="WidthRequest" Value="16" />
57+
<Setter Property="HeightRequest" Value="16" />
58+
<Setter Property="Margin" Value="8" />
59+
</Style>
60+
</Grid.Resources>
61+
<HorizontalStackLayout BindableLayout.ItemsSource="{Binding Path=KeyPegs}">
62+
<BindableLayout.ItemTemplate>
63+
<DataTemplate>
64+
<Ellipse Fill="{Binding Converter={StaticResource PegColorConverter}}" />
65+
</DataTemplate>
66+
</BindableLayout.ItemTemplate>
67+
</HorizontalStackLayout>
68+
</Grid>
69+
</Border>
70+
</HorizontalStackLayout>
6671
</Grid>
6772
</ViewCell>
6873
</DataTemplate>

0 commit comments

Comments
 (0)