UI improvements
This commit is contained in:
parent
8d0cadbff0
commit
717fa6e111
4 changed files with 76 additions and 39 deletions
|
@ -58,8 +58,37 @@
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<Border Grid.Column="2">
|
<Border Grid.Column="2">
|
||||||
<Border Margin="2,0,0,0" Name="GameEdit">
|
<Border Margin="2,0,0,0">
|
||||||
<Grid RowDefinitions="*, 40, 10">
|
<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">
|
<ScrollViewer Grid.Row="0">
|
||||||
<StackPanel Orientation="Vertical" Margin="10">
|
<StackPanel Orientation="Vertical" Margin="10">
|
||||||
<TextBlock Foreground="White" Text="Display Name:" HorizontalAlignment="Center" Padding="0,10"/>
|
<TextBlock Foreground="White" Text="Display Name:" HorizontalAlignment="Center" Padding="0,10"/>
|
||||||
|
@ -81,6 +110,7 @@
|
||||||
Click="Save_OnClick"/>
|
Click="Save_OnClick"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
@ -52,9 +53,16 @@ public partial class MainWindow : Window
|
||||||
Console.Info("Selected " + selectedGame + " from ListView");
|
Console.Info("Selected " + selectedGame + " from ListView");
|
||||||
SetEditArea();
|
SetEditArea();
|
||||||
SetShowcaseArea();
|
SetShowcaseArea();
|
||||||
|
SwitchView(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SwitchView(bool welcome)
|
||||||
|
{
|
||||||
|
GameEdit.IsVisible = !welcome;
|
||||||
|
WelcomePanel.IsVisible = welcome;
|
||||||
|
}
|
||||||
|
|
||||||
private void SetShowcaseArea()
|
private void SetShowcaseArea()
|
||||||
{
|
{
|
||||||
if (GamesList.SelectedItem is Game selectedGame)
|
if (GamesList.SelectedItem is Game selectedGame)
|
||||||
|
@ -75,6 +83,7 @@ public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
if (GamesList.SelectedItem is Game selectedGame)
|
if (GamesList.SelectedItem is Game selectedGame)
|
||||||
{
|
{
|
||||||
|
ChecksumArea.IsVisible = false;
|
||||||
NameTextBox_Edit.Text = selectedGame.Name;
|
NameTextBox_Edit.Text = selectedGame.Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,6 +133,7 @@ public partial class MainWindow : Window
|
||||||
|
|
||||||
public void FetchGamesFromLibrary(object? sender = null, EventArgs? e = null)
|
public void FetchGamesFromLibrary(object? sender = null, EventArgs? e = null)
|
||||||
{
|
{
|
||||||
|
SwitchView(true);
|
||||||
Console.Info("Fetching games from library...");
|
Console.Info("Fetching games from library...");
|
||||||
List<Game> Games = new List<Game>();
|
List<Game> Games = new List<Game>();
|
||||||
Util.CheckDir(Path.Combine(settings.library_path.GetValue<string>(), "DVD"));
|
Util.CheckDir(Path.Combine(settings.library_path.GetValue<string>(), "DVD"));
|
||||||
|
@ -164,6 +174,16 @@ public partial class MainWindow : Window
|
||||||
|
|
||||||
//Game Edit Area/////////////////////////////////////////////////////////////
|
//Game Edit Area/////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
private void OnRepositoryLinkClicked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Console.Info("Repository Link Clicked");
|
||||||
|
Process.Start(new ProcessStartInfo
|
||||||
|
{
|
||||||
|
FileName = "https://git.weexnes.dev/WeeXnes/ps2_manager",
|
||||||
|
UseShellExecute = true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void Save_OnClick(object? sender, RoutedEventArgs e)
|
private void Save_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (GamesList.SelectedItem is Game selectedGame)
|
if (GamesList.SelectedItem is Game selectedGame)
|
||||||
|
@ -193,8 +213,8 @@ public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
string filePath = selectedGame.GamePath;
|
string filePath = selectedGame.GamePath;
|
||||||
|
|
||||||
MD5TextBlock.Text = "MD5: Loading...";
|
this.MD5Hash.Value = "Loading...";
|
||||||
SHATextBlock.Text = "SHA1: Loading...";
|
this.SHA1Hash.Value = "Loading...";
|
||||||
ChecksumArea.IsVisible = true;
|
ChecksumArea.IsVisible = true;
|
||||||
|
|
||||||
BackgroundWorker md5Worker = new BackgroundWorker();
|
BackgroundWorker md5Worker = new BackgroundWorker();
|
||||||
|
|
|
@ -4,12 +4,7 @@
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
x:Class="PS2_Manager.Welcome">
|
x:Class="PS2_Manager.Welcome">
|
||||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Center" Spacing="10">
|
<StackPanel >
|
||||||
<TextBlock Text="Welcome to the PS2 Games Manager" HorizontalAlignment="Center" FontSize="18" FontWeight="Bold"/>
|
|
||||||
<Separator HorizontalAlignment="Center"/>
|
|
||||||
<TextBlock Text="by WeeXnes" HorizontalAlignment="Center" FontStyle="Italic"/>
|
|
||||||
<Separator HorizontalAlignment="Center"/>
|
|
||||||
<TextBlock Text="Check out the source code and contribute at:" HorizontalAlignment="Center" Margin="10"/>
|
|
||||||
<Button Content="PS2 Manager Repository" HorizontalAlignment="Center" Click="OnRepositoryLinkClicked"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
|
@ -12,13 +12,5 @@ public partial class Welcome : UserControl
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
private void OnRepositoryLinkClicked(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
Console.Info("Repository Link Clicked");
|
|
||||||
Process.Start(new ProcessStartInfo
|
|
||||||
{
|
|
||||||
FileName = "https://git.weexnes.dev/WeeXnes/ps2_manager",
|
|
||||||
UseShellExecute = true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue