ps2_manager/PS2_Manager/MainWindow.axaml
2025-04-26 17:33:46 +02:00

148 lines
8.6 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PS2_Manager.Core"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="PS2_Manager.MainWindow"
Title="PS2_Manager"
Background="#201c29"
Width="990"
Height="520"
MinHeight="490"
MinWidth="600"
WindowStartupLocation="CenterScreen"
Loaded="Control_OnLoaded"
Resized="WindowBase_OnResized"
Foreground="White">
<Grid ColumnDefinitions="*, 10, *, 10, 320" Background="Transparent">
<Grid Grid.Column="0">
<Border CornerRadius="0,0,10,10">
<Border CornerRadius="10" Margin="5">
<ListBox Name="GamesList" Background="Transparent"
SelectionChanged="GamesList_OnSelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate x:DataType="local:Game">
<Border Background="Transparent" Padding="10">
<Border.ContextMenu>
<ContextMenu>
<MenuItem Header="Remove Game" Click="DeleteButton"/>
<MenuItem Header="Show Details"/>
</ContextMenu>
</Border.ContextMenu>
<TextBlock Foreground="White" Text="{Binding Name}"/>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ContextMenu>
<ContextMenu x:Name="EmptyAreaContextMenu">
<MenuItem Header="Add New Game" Click="OpenFileButton_Clicked"/>
<MenuItem Header="Refresh List" Click="Context_RefreshGames"/>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.Styles>
<Style Selector="ListBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="#35313d"/>
</Style>
<Style Selector="ListBoxItem">
<Setter Property="Padding" Value="0"/>
<Setter Property="CornerRadius" Value="10"/>
</Style>
</ListBox.Styles>
</ListBox>
</Border>
</Border>
</Grid>
<Border Grid.Column="1">
<Border Width="1" Background="#35313d" Margin="2,10"/>
</Border>
<Border Grid.Column="2">
<Border Margin="2,0,0,0">
<Grid>
<StackPanel Name="WelcomePanel"
Orientation="Vertical"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Spacing="10">
<TextBlock Text="Welcome to the PS2 Games Manager"
HorizontalAlignment="Center"
TextAlignment="Center"
FontSize="18"
FontWeight="Bold"
TextWrapping="Wrap"/>
<Separator HorizontalAlignment="Center"/>
<TextBlock Text="by WeeXnes"
HorizontalAlignment="Center"
TextAlignment="Center"
FontStyle="Italic"
TextWrapping="Wrap"/>
<Separator HorizontalAlignment="Center"/>
<TextBlock Text="Check out the source code and contribute at:"
HorizontalAlignment="Center"
TextAlignment="Center"
Margin="10"
TextWrapping="Wrap"/>
<Button Content="PS2 Manager Repository"
HorizontalAlignment="Center"
Click="OnRepositoryLinkClicked"/>
</StackPanel>
<Grid RowDefinitions="*, 40, 10" Name="GameEdit" IsVisible="False">
<ScrollViewer Grid.Row="0">
<StackPanel Orientation="Vertical" Margin="10">
<TextBlock Foreground="White" Text="Display Name:" HorizontalAlignment="Center" Padding="0,10"/>
<TextBox Foreground="White" Name="NameTextBox_Edit"/>
<Separator/>
<Button Foreground="White" Content="Calculate Checksums" Click="ChecksumButtonOnClick" HorizontalAlignment="Stretch"></Button>
<Border Background="#35313d" CornerRadius="5" Padding="10" Margin="0,5" IsVisible="False" Name="ChecksumArea">
<StackPanel>
<TextBlock Foreground="White" FontSize="10" Name="MD5TextBlock"/>
<TextBlock Foreground="White" FontSize="10" Name="SHATextBlock"/>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
<Grid Grid.Row="1" ColumnDefinitions="*,*">
<Button Foreground="White" Content="Undo" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"
Click="Undo_OnClick"/>
<Button Foreground="White" Content="Save" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"
Click="Save_OnClick"/>
</Grid>
</Grid>
</Grid>
</Border>
</Border>
<Border Grid.Column="4" Background="#35313d" CornerRadius="10" Name="InfoWindow" Margin="10">
<Grid>
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" Name="GameInfoPlaceholder">
<TextBlock Text="Select a Game"/>
</StackPanel>
<Grid RowDefinitions="*, 350, 20, 20, 20, 20, *" Name="GameInfo" IsVisible="False">
<Grid Grid.Row="1" ColumnDefinitions="*, 205, *">
<Button Foreground="White" Grid.Column="0" Content="←" HorizontalAlignment="Center" VerticalAlignment="Center" Click="PrevButton"/>
<Button Foreground="White" Grid.Column="2" Content="→" HorizontalAlignment="Center" VerticalAlignment="Center" Click="NextButton"/>
<Border Grid.Column="1" Width="205" Height="292" Background="Transparent" CornerRadius="5" HorizontalAlignment="Center" VerticalAlignment="Center"
PointerPressed="CoverImage_OnPointerPressed" Name="CoverContainer">
<Grid>
<Image Name="CoverImage" Source="Images/missing.png" Stretch="UniformToFill"/>
<TextBlock Name="CoverTextHint" HorizontalAlignment="Center" VerticalAlignment="Center" IsVisible="False"/>
</Grid>
</Border>
</Grid>
<TextBlock Foreground="White" Grid.Row="2" Text="" HorizontalAlignment="Center"
Name="GameNameTextBlock"/>
<TextBlock Foreground="White" Grid.Row="3" Text="" HorizontalAlignment="Center"
Name="GameIdTextBlock"/>
<TextBlock Foreground="White" Grid.Row="4" Text="" HorizontalAlignment="Center"
Name="IsoSizeTextBlock"/>
<TextBlock Foreground="White" Grid.Row="5" Text="" HorizontalAlignment="Center"
Name="GameDateTextBlock"/>
</Grid>
</Grid>
</Border>
</Grid>
</Window>