Skip to content

Commit

Permalink
Fixed new game toggle button style
Browse files Browse the repository at this point in the history
  • Loading branch information
sakya committed Feb 26, 2022
1 parent 37c40f8 commit 1f15857
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 10 additions & 0 deletions CoreChess/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@
<Setter Property="CornerRadius" Value="5" />
</Style>

<Style Selector="ToggleButton.Left /template/ ContentPresenter">
<Setter Property="CornerRadius" Value="5,0,0,5" />
</Style>
<Style Selector="ToggleButton.Middle /template/ ContentPresenter">
<Setter Property="CornerRadius" Value="0" />
</Style>
<Style Selector="ToggleButton.Right /template/ ContentPresenter">
<Setter Property="CornerRadius" Value="0,5,5,0" />
</Style>

<Style Selector="Button.Accent">
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}"/>
</Style>
Expand Down
8 changes: 5 additions & 3 deletions CoreChess/Views/NewGameWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<ToggleButton Name="m_WhiteBtn" IsThreeState="False" IsChecked="True" Click="OnWhiteClick" Grid.Column="0" HorizontalAlignment="Stretch">
<ToggleButton Name="m_WhiteBtn" IsThreeState="False" IsChecked="True" Click="OnWhiteClick" Grid.Column="0" HorizontalAlignment="Stretch"
Classes="Left">
<Image Name="m_White" Height="100"></Image>
</ToggleButton>
<ToggleButton Name="m_RandomBtn" IsThreeState="False" Click="OnRandomClick" Grid.Column="1" HorizontalAlignment="Stretch"
Height="{Binding #m_WhiteBtn.Bounds.Height}">
Height="{Binding #m_WhiteBtn.Bounds.Height}" Classes="Middle">
<TextBlock Text="?" FontSize="36" VerticalAlignment="Center" HorizontalAlignment="Center" />
</ToggleButton>
<ToggleButton Name="m_BlackBtn" IsThreeState="False" Click="OnBlackClick" Grid.Column="2" HorizontalAlignment="Stretch">
<ToggleButton Name="m_BlackBtn" IsThreeState="False" Click="OnBlackClick" Grid.Column="2" HorizontalAlignment="Stretch"
Classes="Right">
<Image Name="m_Black" Height="100"></Image>
</ToggleButton>

Expand Down

0 comments on commit 1f15857

Please sign in to comment.