From 4d7350fc6e512f22d80261b5014fd759d3e5ce74 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Tue, 24 Dec 2024 13:23:43 -0600 Subject: [PATCH] UI: Copy Title ID by clicking on it. --- src/Ryujinx/App.axaml.cs | 3 +++ .../UI/Controls/ApplicationListView.axaml | 20 ++++++++++++---- .../UI/Controls/ApplicationListView.axaml.cs | 23 +++++++++++++++++++ src/Ryujinx/UI/Windows/MainWindow.axaml.cs | 3 +++ 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src/Ryujinx/App.axaml.cs b/src/Ryujinx/App.axaml.cs index 15ada201c..9c1170d08 100644 --- a/src/Ryujinx/App.axaml.cs +++ b/src/Ryujinx/App.axaml.cs @@ -32,6 +32,9 @@ namespace Ryujinx.Ava .ApplicationLifetime.Cast() .MainWindow.Cast(); + public static IClassicDesktopStyleApplicationLifetime DesktopLifetime => Current! + .ApplicationLifetime.Cast(); + public static void SetTaskbarProgress(TaskBarProgressBarState state) => MainWindow.PlatformFeatures.SetTaskBarProgressBarState(state); public static void SetTaskbarProgressValue(ulong current, ulong total) => MainWindow.PlatformFeatures.SetTaskBarProgressBarValue(current, total); public static void SetTaskbarProgressValue(long current, long total) => SetTaskbarProgressValue(Convert.ToUInt64(current), Convert.ToUInt64(total)); diff --git a/src/Ryujinx/UI/Controls/ApplicationListView.axaml b/src/Ryujinx/UI/Controls/ApplicationListView.axaml index 8a72ebfbf..90b657ee0 100644 --- a/src/Ryujinx/UI/Controls/ApplicationListView.axaml +++ b/src/Ryujinx/UI/Controls/ApplicationListView.axaml @@ -101,11 +101,21 @@ VerticalAlignment="Top" Orientation="Vertical" Spacing="5"> - + it.IdString == idText.Text); + if (appData is null) + return; + + await clipboard.SetTextAsync(appData.IdString); + + NotificationHelper.Show("Copied Title ID", $"{appData.Name} ({appData.IdString})", NotificationType.Information); + } + } } } diff --git a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs index c433d7fdb..88e82c89e 100644 --- a/src/Ryujinx/UI/Windows/MainWindow.axaml.cs +++ b/src/Ryujinx/UI/Windows/MainWindow.axaml.cs @@ -98,6 +98,9 @@ namespace Ryujinx.Ava.UI.Windows StatusBarHeight = StatusBarView.StatusBar.MinHeight; MenuBarHeight = MenuBar.MinHeight; + ApplicationList.DataContext = DataContext; + ApplicationGrid.DataContext = DataContext; + SetWindowSizePosition(); if (Program.PreviewerDetached)