Skip to content

Commit

Permalink
Make titlebars more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
Heufneutje committed Dec 2, 2024
1 parent 92c3547 commit cf302ed
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
4 changes: 3 additions & 1 deletion SpeedrunTracker/ViewModels/RunDetailsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ public EmbeddableUrl? SelectedVideo

public ICommand OpenLinkCommand => new AsyncRelayCommand<string>(OpenLinkAsync);

public string? Title => RunDetails == null ? "RunDetails" : $"{_runDetails?.Category?.Name} in {_runDetails?.Run?.Times?.PrimaryTimeSpan} by {_runDetails?.Run.Players[0].DisplayName}";
public string? Title => _runDetails == null ? "RunDetails" : $"{_runDetails.OrdinalPlace} - {_runDetails.Category?.Name} in {_runDetails.Run.Times?.PrimaryTimeSpan}";

public string? SubTitle => _runDetails == null ? "by <unknown>" : $"by {string.Join(" and ", _runDetails.Run.Players.Select(x => x.DisplayName))}";

public string? FormattedDate => RunDetails?.Run.Date?.ToString(_settingsService.UserSettings.DateFormat);

Expand Down
4 changes: 3 additions & 1 deletion SpeedrunTracker/Views/GameDetailsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
xmlns:viewmodels="clr-namespace:SpeedrunTracker.ViewModels"
x:DataType="viewmodels:GameDetailViewModel"
x:Class="SpeedrunTracker.Views.GameDetailPage"
Title="{Binding Game.Names.International}"
Appearing="ContentPage_Appearing">
<Shell.TitleView>
<Label Text="{Binding Game.Names.International}" TextColor="White" FontSize="Medium" FontAttributes="Bold" VerticalTextAlignment="Center" />
</Shell.TitleView>
<Grid>
<Image Source="{Binding Game.Assets.Background.Uri}" Style="{StaticResource CustomBackgroundImage}" />
<Grid Padding="20">
Expand Down
4 changes: 3 additions & 1 deletion SpeedrunTracker/Views/GameSeriesDetailsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
xmlns:viewmodels="clr-namespace:SpeedrunTracker.ViewModels"
x:Class="SpeedrunTracker.Views.GameSeriesDetailsPage"
x:DataType="viewmodels:GameSeriesDetailViewModel"
Title="{Binding Series.Names.International}"
Appearing="ContentPage_Appearing">
<Shell.TitleView>
<Label Text="{Binding Series.Names.International}" TextColor="White" FontSize="Medium" FontAttributes="Bold" VerticalTextAlignment="Center" />
</Shell.TitleView>
<Grid>
<Image Source="{Binding Series.Assets.Background.Uri}" Style="{StaticResource CustomBackgroundImage}" />
<Border Style="{StaticResource TransparentCollectionElementBorder}" IsVisible="{Binding IsRunningBackgroundTask}">
Expand Down
7 changes: 6 additions & 1 deletion SpeedrunTracker/Views/RunDetailsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
xmlns:markdown="clr-namespace:Indiko.Maui.Controls.Markdown;assembly=Indiko.Maui.Controls.Markdown"
x:DataType="viewmodels:RunDetailsViewModel"
x:Class="SpeedrunTracker.Views.RunDetailsPage"
Title="{Binding Title}"
Appearing="ContentPage_Appearing"
Shell.TabBarIsVisible="False"
Shell.FlyoutBehavior="Disabled">
<Shell.TitleView>
<VerticalStackLayout>
<Label Text="{Binding Title}" TextColor="White" FontSize="Medium" FontAttributes="Bold" VerticalTextAlignment="Center" />
<Label Text="{Binding SubTitle}" TextColor="White" FontSize="Small" FontAttributes="Bold" VerticalTextAlignment="Center" />
</VerticalStackLayout>
</Shell.TitleView>
<ContentPage.ToolbarItems>
<ToolbarItem IconImageSource="share" Text="Share" Command="{Binding ShareCommand}" />
</ContentPage.ToolbarItems>
Expand Down
4 changes: 3 additions & 1 deletion SpeedrunTracker/Views/UserDetailPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
xmlns:viewmodels="clr-namespace:SpeedrunTracker.ViewModels"
x:DataType="viewmodels:UserDetailsViewModel"
x:Class="SpeedrunTracker.Views.UserDetailPage"
Title="{Binding DisplayName}"
Appearing="ContentPage_Appearing">
<Shell.TitleView>
<Label Text="{Binding DisplayName}" TextColor="White" FontSize="Medium" FontAttributes="Bold" VerticalTextAlignment="Center" />
</Shell.TitleView>
<Grid Padding="20">
<CollectionView Style="{StaticResource ThresholdCollectionViewStyle}"
ItemsSource="{Binding PersonalBests}"
Expand Down

0 comments on commit cf302ed

Please sign in to comment.