Skip to content

Commit

Permalink
UI: misc: Collapse repeated identical Border usages into a helper con…
Browse files Browse the repository at this point in the history
…trol.
  • Loading branch information
GreemDev committed Dec 25, 2024
1 parent 7aede70 commit 41acc4b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 62 deletions.
71 changes: 9 additions & 62 deletions src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
xmlns:local="clr-namespace:Ryujinx.Ava.UI.Views.Main"
xmlns:config="clr-namespace:Ryujinx.Common.Configuration;assembly=Ryujinx.Common"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Ryujinx.Ava.UI.Views.Main.MainStatusBarView"
Expand Down Expand Up @@ -132,14 +133,7 @@
</Flyout>
</Button.Flyout>
</Button>
<Border
Width="2"
Height="12"
Margin="0"
BorderBrush="Gray"
Background="Gray"
BorderThickness="1"
IsVisible="{Binding !ShowLoadProgress}" />
<local:StatusBarSeparator IsVisible="{Binding !ShowLoadProgress}" />
<TextBlock
Name="DockedStatus"
Margin="5,0,5,0"
Expand All @@ -149,14 +143,7 @@
PointerReleased="DockedStatus_PointerReleased"
Text="{Binding DockedStatusText}"
TextAlignment="Start" />
<Border
Width="2"
Height="12"
Margin="0"
BorderBrush="Gray"
Background="Gray"
BorderThickness="1"
IsVisible="{Binding !ShowLoadProgress}" />
<local:StatusBarSeparator IsVisible="{Binding !ShowLoadProgress}" />
<SplitButton
Name="AspectRatioStatus"
Padding="5,0,5,0"
Expand Down Expand Up @@ -203,14 +190,7 @@
</MenuFlyout>
</SplitButton.Flyout>
</SplitButton>
<Border
Width="2"
Height="12"
Margin="0"
BorderBrush="Gray"
Background="Gray"
BorderThickness="1"
IsVisible="{Binding !ShowLoadProgress}" />
<local:StatusBarSeparator IsVisible="{Binding !ShowLoadProgress}" />
<ToggleSplitButton
Name="VolumeStatus"
Padding="5,0,5,0"
Expand Down Expand Up @@ -254,29 +234,15 @@
</Flyout>
</ToggleSplitButton.Flyout>
</ToggleSplitButton>
<Border
Width="2"
Height="12"
Margin="0"
BorderBrush="Gray"
Background="Gray"
BorderThickness="1"
IsVisible="{Binding !ShowLoadProgress}" />
<local:StatusBarSeparator IsVisible="{Binding !ShowLoadProgress}" />
<TextBlock
Margin="5,0,5,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
IsVisible="{Binding !ShowLoadProgress}"
Text="{Binding GameStatusText}"
TextAlignment="Start" />
<Border
Width="2"
Height="12"
Margin="0"
BorderBrush="Gray"
Background="Gray"
BorderThickness="1"
IsVisible="{Binding !ShowLoadProgress}" />
<local:StatusBarSeparator IsVisible="{Binding !ShowLoadProgress}" />
<TextBlock
Margin="5,0,5,0"
HorizontalAlignment="Left"
Expand All @@ -298,28 +264,15 @@
VerticalAlignment="Center"
IsVisible="{Binding ShowShaderCompilationHint}"
Text="{Binding ShaderCountText}" />
<Border
Width="2"
Height="12"
Margin="0"
BorderBrush="Gray"
BorderThickness="1"
IsVisible="{Binding ShowShaderCompilationHint}" />
<local:StatusBarSeparator IsVisible="{Binding ShowShaderCompilationHint}" />
<TextBlock
Margin="5,0,5,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
IsVisible="{Binding !ShowLoadProgress}"
Text="{Binding BackendText}"
TextAlignment="Start" />
<Border
Width="2"
Height="12"
Margin="0"
BorderBrush="Gray"
Background="Gray"
BorderThickness="1"
IsVisible="{Binding !ShowLoadProgress}" />
<local:StatusBarSeparator IsVisible="{Binding !ShowLoadProgress}" />
<TextBlock
Margin="5,0,0,0"
HorizontalAlignment="Left"
Expand All @@ -334,13 +287,7 @@
VerticalAlignment="Center"
IsVisible="{Binding ShowFirmwareStatus}"
Orientation="Horizontal">
<Border
Width="2"
Height="12"
Margin="0"
BorderBrush="Gray"
BorderThickness="1"
IsVisible="{Binding IsGameRunning}" />
<local:StatusBarSeparator IsVisible="{Binding IsGameRunning}" />
<TextBlock
Name="FirmwareStatus"
Margin="5, 0, 0, 0"
Expand Down
23 changes: 23 additions & 0 deletions src/Ryujinx/UI/Views/Main/MainStatusBarView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Avalonia.Threading;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Windows;
Expand Down Expand Up @@ -72,4 +73,26 @@ private void VolumeStatus_OnPointerWheelChanged(object sender, PointerWheelEvent
e.Handled = true;
}
}

public class StatusBarSeparator : Border
{
public StatusBarSeparator()
{
Width = 2;
Height = 12;
Margin = new Thickness();
BorderBrush = Brushes.Gray;
Background = Brushes.Gray;
BorderThickness = new Thickness(1);
}
/*
<Border
Width="2"
Height="12"
Margin="0"
BorderBrush="Gray"
Background="Gray"
BorderThickness="1"
IsVisible="{Binding !ShowLoadProgress}" />*/
}
}

0 comments on commit 41acc4b

Please sign in to comment.