Skip to content

Commit

Permalink
Redesigned the achievement item (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Jul 7, 2023
1 parent af8cead commit bdd39df
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Gavilya/Pages/GameInfoPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
</Button>
</StackPanel>

<StackPanel x:Name="AchievementsDisplayer" />
<WrapPanel x:Name="AchievementsDisplayer" />
</StackPanel>
</Grid>
</Grid>
Expand Down
23 changes: 11 additions & 12 deletions Gavilya/UserControls/AchievementItem.xaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<UserControl x:Class="Gavilya.UserControls.AchievementItem" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Gavilya.UserControls" FontFamily="../Fonts/#Hauora" Foreground="{DynamicResource Foreground}" mc:Ignorable="d" Height="85" d:DesignWidth="800" Margin="5" MaxWidth="800">
<UserControl x:Class="Gavilya.UserControls.AchievementItem" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Gavilya.UserControls" FontFamily="../Fonts/#Hauora" Foreground="{DynamicResource Foreground}" mc:Ignorable="d" Height="350" Width="250" Margin="5" MaxWidth="250">
<Border CornerRadius="10" Background="{DynamicResource Background2}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<Image x:Name="AchievementImg" Grid.Column="0" Margin="10" />
<StackPanel MaxWidth="800" Grid.Column="1">
<TextBlock x:Name="AchievementNameTxt" d:Text="AchievementName" FontSize="18" FontWeight="ExtraBold" Margin="0,10,0,0" />
<TextBlock x:Name="AchievementDescriptionTxt" d:Text="AchievementDescription" FontSize="12" TextWrapping="Wrap" />
<TextBlock x:Name="AchievementPourcentTxt" d:Text="AchievementPourcent" FontSize="12" TextWrapping="Wrap" VerticalAlignment="Bottom" Margin="0,10,0,0" />
<Grid MaxWidth="250">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel>
<Image x:Name="AchievementImg" Margin="10" HorizontalAlignment="Center" Height="100" Width="100"/>
<TextBlock TextAlignment="Center" x:Name="AchievementNameTxt" d:Text="AchievementName" TextWrapping="Wrap" FontSize="18" FontWeight="ExtraBold" Margin="0,10,0,0" HorizontalAlignment="Center" />
<TextBlock TextAlignment="Center" x:Name="AchievementDescriptionTxt" d:Text="AchievementDescription" FontSize="12" TextWrapping="Wrap" HorizontalAlignment="Center" />
</StackPanel>
<TextBlock TextAlignment="Center" x:Name="AchievementPourcentTxt" d:Text="AchievementPourcent" FontSize="12" TextWrapping="Wrap" VerticalAlignment="Bottom" Margin="0,10,0,10" HorizontalAlignment="Center" Grid.Row="1" />
</Grid>
</Border>
</UserControl>
2 changes: 1 addition & 1 deletion Gavilya/UserControls/AchievementItem.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void InitUI(Achievement achievement)
var image = new BitmapImage();
image.BeginInit();
image.UriSource = new Uri(achievement.image);
image.DecodePixelWidth = 50;
image.DecodePixelWidth = 100;
image.EndInit();

AchievementImg.Source = image; // Set the image
Expand Down

0 comments on commit bdd39df

Please sign in to comment.