initial Layout

This commit is contained in:
Isaac Marovitz 2023-10-30 00:42:05 -04:00
parent 09214d3faf
commit a665f92127
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1
3 changed files with 75 additions and 43 deletions

View file

@ -594,7 +594,7 @@
"DlcWindowTitle": "Manage Downloadable Content for {0} ({1})", "DlcWindowTitle": "Manage Downloadable Content for {0} ({1})",
"UpdateWindowTitle": "Title Update Manager", "UpdateWindowTitle": "Title Update Manager",
"CheatWindowHeading": "Manage Cheats for {0} ({1})", "CheatWindowHeading": "Manage Cheats for {0} ({1})",
"BuildId": "BuildId:", "BuildId": "Build ID:",
"DlcWindowHeading": "{0} Downloadable Content(s)", "DlcWindowHeading": "{0} Downloadable Content(s)",
"UserProfilesEditProfile": "Edit Selected", "UserProfilesEditProfile": "Edit Selected",
"Cancel": "Cancel", "Cancel": "Cancel",

View file

@ -1,4 +1,6 @@
using Avalonia;
using Avalonia.Collections; using Avalonia.Collections;
using Avalonia.Controls.ApplicationLifetimes;
using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.Models;
using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.FileSystem;
using Ryujinx.HLE.HOS; using Ryujinx.HLE.HOS;
@ -59,6 +61,14 @@ namespace Ryujinx.Ava.UI.ViewModels
} }
} }
public async void CopyToClipboard()
{
if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
await desktop.MainWindow.Clipboard.SetTextAsync(BuildId);
}
}
public void Save() public void Save()
{ {
List<string> enabledCheats = new(); List<string> enabledCheats = new();

View file

@ -11,50 +11,53 @@
x:DataType="viewModels:CheatWindowViewModel" x:DataType="viewModels:CheatWindowViewModel"
mc:Ignorable="d" mc:Ignorable="d"
Focusable="True"> Focusable="True">
<Grid Name="CheatGrid" Margin="15"> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Panel
<ColumnDefinition Width="*" /> Margin="0 0 0 10"
<ColumnDefinition Width="*" /> Grid.Row="0">
</Grid.ColumnDefinitions> <Grid>
<TextBlock <Grid.ColumnDefinitions>
Grid.Row="2" <ColumnDefinition Width="Auto" />
Grid.Column="0" <ColumnDefinition Width="*" />
MaxWidth="500" </Grid.ColumnDefinitions>
Margin="140,15,20,5" <StackPanel
HorizontalAlignment="Center" Orientation="Horizontal"
VerticalAlignment="Center" Grid.Column="0">
LineHeight="30" <TextBlock
Text="{locale:Locale BuildId}" Padding="0 0 10 0"
TextAlignment="Center" Text="{locale:Locale BuildId}" />
TextWrapping="Wrap" /> <Button
<TextBox Name="CopyButton"
Grid.Row="2" Command="{Binding CopyToClipboard}">
Grid.Column="1" <TextBlock Text="{Binding BuildId}" />
Margin="0,5,110,5" </Button>
MinWidth="160" </StackPanel>
HorizontalAlignment="Center" <TextBox
VerticalAlignment="Center" Grid.Column="1"
Text="{Binding BuildId}" MinHeight="29"
IsReadOnly="True" /> MaxHeight="29"
HorizontalAlignment="Stretch"
Watermark="{locale:Locale Search}"
Text="{Binding}" />
</Grid>
</Panel>
<Border <Border
Grid.Row="3" Grid.Row="1"
Grid.Column="0" Margin="0 0 0 24"
Grid.ColumnSpan="2"
Margin="5"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
BorderBrush="Gray" BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
BorderThickness="1"> BorderThickness="1"
CornerRadius="5"
Padding="2.5">
<TreeView <TreeView
Name="CheatsView" Name="CheatsView"
MinHeight="300" SelectionMode="Multiple, Toggle"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
ItemsSource="{Binding LoadedCheats}"> ItemsSource="{Binding LoadedCheats}">
@ -77,13 +80,32 @@
</TreeView.ItemTemplate> </TreeView.ItemTemplate>
</TreeView> </TreeView>
</Border> </Border>
<DockPanel <Panel
Grid.Row="4" Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="2"
Margin="0"
HorizontalAlignment="Stretch"> HorizontalAlignment="Stretch">
<DockPanel Margin="0" HorizontalAlignment="Right"> <StackPanel
Orientation="Horizontal"
Spacing="10"
HorizontalAlignment="Left">
<Button
Name="AddButton"
MinWidth="90"
Margin="5"
Command="{Binding}">
<TextBlock Text="{locale:Locale SettingsTabGeneralAdd}" />
</Button>
<Button
Name="RemoveAllButton"
MinWidth="90"
Margin="5"
Command="{Binding}">
<TextBlock Text="{locale:Locale DlcManagerRemoveAllButton}" />
</Button>
</StackPanel>
<StackPanel
Orientation="Horizontal"
Spacing="10"
HorizontalAlignment="Right">
<Button <Button
Name="SaveButton" Name="SaveButton"
MinWidth="90" MinWidth="90"
@ -98,7 +120,7 @@
Click="Close"> Click="Close">
<TextBlock Text="{locale:Locale InputDialogCancel}" /> <TextBlock Text="{locale:Locale InputDialogCancel}" />
</Button> </Button>
</DockPanel> </StackPanel>
</DockPanel> </Panel>
</Grid> </Grid>
</UserControl> </UserControl>