Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions WheelWizard/Views/Layout.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,9 @@
PageType="{x:Type pages:FriendsPage}"
BoxText="0/0" />

<TextBlock Text="{loc:T category.other}" Classes="SidebarSectionText" />
<TextBlock Text="{loc:T category.other}" Classes="SidebarSectionText"
x:Name="OtherSectionText" IsVisible="False" />
<!-- Repurposing this translation from settings -->
<patterns:SidebarRadioButton IconData="{StaticResource Settings}"
PageType="{x:Type pages:SettingsPage}"
Text="{loc:T page_title.settings}" x:Name="SettingsButton" />
<patterns:SidebarRadioButton IconData="{StaticResource Code}"
PageType="{x:Type pages:TestingPage}"
Text="Testing Mode" x:Name="TestingButton" IsVisible="False" />
Expand All @@ -142,7 +140,7 @@
Text="Kitchen Sink" x:Name="KitchenSinkButton" />
</StackPanel>

<Grid Grid.Column="0" Grid.Row="5" ColumnDefinitions="28,8,28,8,*"
<Grid Grid.Column="0" Grid.Row="5" ColumnDefinitions="28,8,28,8,28,8,*"
VerticalAlignment="Bottom" Margin="10,0,13,12" x:Name="SidebarBottomBar">
<Border Grid.Column="0"
ToolTip.Tip="This only shows regions YOU have played on"
Expand Down Expand Up @@ -252,6 +250,22 @@
</Border>

<Border Grid.Column="4"
x:Name="SidebarSettingsButton"
Width="28" Height="28"
Classes="BottomSidebarIcon"
ToolTip.Tip="{loc:T page_title.settings}"
ToolTip.Placement="Top"
ToolTip.ShowDelay="20"
PointerPressed="SidebarSettingsButton_OnPointerPressed">
<PathIcon Data="{StaticResource Gear}"
x:Name="SidebarSettingsIcon"
Width="22" Height="22"
Margin="-1"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Border>

<Border Grid.Column="6"
Height="26"
BorderThickness="1"
BorderBrush="{StaticResource Neutral600}"
Expand All @@ -277,9 +291,15 @@
<Style Selector="PathIcon#SidebarInfoIcon">
<Setter Property="Foreground" Value="{StaticResource Neutral500}" />
</Style>
<Style Selector="PathIcon#SidebarSettingsIcon">
<Setter Property="Foreground" Value="{StaticResource Neutral500}" />
</Style>
<Style Selector="Border#SidebarInfoButton:pointerover PathIcon#SidebarInfoIcon">
<Setter Property="Foreground" Value="{StaticResource Neutral300}" />
</Style>
<Style Selector="Border#SidebarSettingsButton:pointerover PathIcon#SidebarSettingsIcon">
<Setter Property="Foreground" Value="{StaticResource Neutral300}" />
</Style>
<Style Selector="Border#LiveStatusBorder:pointerover PathIcon">
<Setter Property="Foreground" Value="{StaticResource Neutral300}" />
</Style>
Expand Down
13 changes: 13 additions & 0 deletions WheelWizard/Views/Layout.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public Layout()
#if DEBUG
KitchenSinkButton.IsVisible = true;
#endif
UpdateOtherSectionVisibility();
}

protected override void OnLoaded(RoutedEventArgs e)
Expand Down Expand Up @@ -365,6 +366,12 @@ private async void TitleLabel_OnPointerPressed(object? sender, PointerPressedEve
private void UpdateTestingButtonVisibility()
{
TestingButton.IsVisible = SettingsService.Get<bool>(SettingsService.TESTING_MODE_ENABLED);
UpdateOtherSectionVisibility();
}

private void UpdateOtherSectionVisibility()
{
OtherSectionText.IsVisible = TestingButton.IsVisible || KitchenSinkButton.IsVisible;
}

private void SidebarInfoButton_OnPointerPressed(object? sender, PointerPressedEventArgs e)
Expand All @@ -373,6 +380,12 @@ private void SidebarInfoButton_OnPointerPressed(object? sender, PointerPressedEv
e.Handled = true;
}

private void SidebarSettingsButton_OnPointerPressed(object? sender, PointerPressedEventArgs e)
{
NavigationManager.NavigateTo<SettingsPage>();
e.Handled = true;
}

private void SidebarProfileBlock_OnPointerEntered(object? sender, PointerEventArgs e)
{
SidebarProfileBlock.Background = GetResourceBrush("Neutral800");
Expand Down
Loading
Loading