mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-07-06 02:59:06 +00:00
UI: Actions Menu (Part 2 of 4) → XCI Trimmer (#146)
Ayyyy, welcome to the UI: Actions Menu → XCI Trimmer PR!
Let's keep it up!
This is the second PR in a series aimed at delivering the largest overhaul and improvements to the `Actions` menu yet.
This second PR introduces visual improvements to the `XCI Trimmer` and also fixes some bugs.
### GENERAL:
* **Renamed:** `XCI Trimmer` files to use the capitalised XCI instead of Xci
* Files were inconsistently named with either Xci or XCI. As such, they were all renamed to use XCI.
### LOCALISATION:
* **Fractured:** More locales
* `Common_Search.json` - search-related locales
* `Common_Sort.json` - sorting fields, ascending/descending locales
* `Dialog_XCITrimmer.json` - XCI trimmer dialogs
* `GameListContextMenu.json` - all UI dialogs related to the game list menu (right-click game)
* `XCITrimmer.json` - all UI-related locales for the XCI Trimmer window
* **Added:** Additional entry to `StatusBar.json`
* **Added:** `Simulate Wake-Up Message` to `MenuBar_Actions.json` (previously did not exist there, for some reason).
**NOTE:** `Common_Search.json` and `Common_Sort.json` were not fully populated, but many more locales will be added and cleaned up in future PRs.
### XCI TRIMMER:
* **Renamed:** `Trim XCI Files` menu → `XCI Trimmer`
* **XCI Trimmer (Window):**
* **Renamed:** Window title from `XCI File Trimmer` → `XCI Trimmer`
* **Renamed:** `X of Y Title(s) Selected` → `XCI Selected: X/Y`
* `Z Displayed` was renamed to `Displayed: Z` and, as usual, appears only when searching for particular XCIs in the search bar.
* **Fixed:** Counting bug
* Pressing `Select Shown` continuously would increment the amount of XCIs selected to infinity (e.g. if 5 XCIs are in the list, then you could get 1201312 of 5 Title(s) Selected). Furthermore, when you were trimming a specific number of XCIs (not the all XCIs) at once, it would show that its trimming all titles from the list (e.g. "Trimming 5 Titles" when only 1 was being trimmed).
* **Changed:** Button structure
* Previous structure included 2 buttons: `Select Shown` and `Deselect Shown`. Initially, they were renamed to `Select All` and `Deselect All`, as that sounded more natural. However, after further consideration, they were both removed and replaced by a single button, whose action and label would change depending on the state it was in:
* If no XCIs were selected → `Select All`
* If at least one XCI is selected →`Clear Selection`
* `Clear Selection` was used instead of Deselect All, because some translations were quite awkward.
* Furthermore, this reflects the way the button works: you are not "deselecting all" when only 2 out of 5 XCIs are selected - you are clearing that particular selection of XCIs.
* **Improved:** Button and Control Layout (above list)
* Sorting dropdown was expanded a bit further (150 default to 170 width), as some locales would get cutoff. This will be further adjusted in a future PR, which will tackle all of Ryujinx's sorting features.
* Added a new sorting: Trim Status
* See images for visual comparison.
* **Improved:** XCI List Layout
* The entire list was revamped to be more modern and cleaner to look at.
* Instead of displaying the file status (Trimmed, Untrimmed, Partial, Failed, Unknown), it now shows icons: Checkmark (Trimmed), Cross (Untrimmed), Wrench (Partial), Exclamation Mark (Failed), Question mark (everything else/Unknown), No Icon (when it's not XCI).
* Furthermore, it shows a Sync icon when performing the trimming/untrimming operation.
* Additionally, it shows the said status when you hover above the icons.
* Save X MB and Saved Y MB were both removed and replaced with just the amount and a percentage value (how much you save per file).
* See images for visual comparison.
* NOTE: Icons are still under consideration and may be changed in the future.
* **Improved:** Bottom Savings Display
* Instead of showing `Potential Savings`" and `Actual Savings`, the bottom row now shows the amount `Saved` AND the amount `Remaining`.
### GAME LIST CONTEXT MENU (Right-Click Game):
* **Renamed:** `Check & Trim XCI File` → `Trim XCI`
* The option already performs a check regardless.
* **Remove:** `Trim XCI` Tooltip
* The user can press the option and will be confronted with a dialog, which explains what the feature does. Furthermore, the action itself is reversible at any moment (i.e. before trimming and after trimming in the XCI Trimmer).
* It is planned to either add a message that tells the user they can untrim the XCI in the XCI Trimmer, or to make the option work both ways (Trim & Untrim). This is still under consideration, but, if chosen to be implemented, it will be a part of the Game List Context Menu PR.
* **Added:** IsVisible parameter to `Trim XCI`
* Instead of displaying `Trim XCI` for every single game (NSP, NSO, etc.), it will only be displayed for XCIs (as they are the only ones that can be trimmed). It is still _enabled_ only if an XCI is untrimmed.
* **Improved:** `Trim XCI` Dialog
* Some minor visual adjustment and organisation improvements.
* **Changed:** Value formatting for "File Size", "Game Size", and "Space Savings"
* Previously they were very long numbers, expressed in MB, with all the decimals. Instead of displaying them as such, they were shortened to display the same amount as they do in the XCI Trimmer window already.
* All further dialogs will be improved in a separate PR, because they desperately need consistency.
### STATUS BAR:
* **Adjusted:** Formatting of XCI Trimming Status on status bar
* **Forced:** Filename without extension (as we are already trimming an XCI already).
* **Fixed:** Trimming Position when Playtime is not available
* **Fixed:** Progress bar position (will be further adjusted in a Status Bar PR…boy there will be a lot of PRs, which is good)
_If there are any features or changes that you wish to be implemented, please comment down below and I'll be happy to accommodate!_
Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/146
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Systems.AppLibrary;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Common.Utilities;
|
||||
@@ -11,6 +12,7 @@ namespace Ryujinx.Ava.Common.Models
|
||||
bool Untrimmable,
|
||||
long PotentialSavingsB,
|
||||
long CurrentSavingsB,
|
||||
long OriginalSizeB,
|
||||
int? PercentageProgress,
|
||||
XCIFileTrimmer.OperationOutcome ProcessingOutcome)
|
||||
{
|
||||
@@ -25,31 +27,57 @@ namespace Ryujinx.Ava.Common.Models
|
||||
trimmer.CanBeUntrimmed,
|
||||
trimmer.DiskSpaceSavingsB,
|
||||
trimmer.DiskSpaceSavedB,
|
||||
applicationData.FileSize,
|
||||
null,
|
||||
XCIFileTrimmer.OperationOutcome.Undetermined
|
||||
);
|
||||
}
|
||||
|
||||
public bool IsFailed
|
||||
public bool IsFailed =>
|
||||
ProcessingOutcome is not XCIFileTrimmer.OperationOutcome.Undetermined
|
||||
and not XCIFileTrimmer.OperationOutcome.Successful;
|
||||
|
||||
public string StatusText
|
||||
{
|
||||
get
|
||||
{
|
||||
return ProcessingOutcome is not XCIFileTrimmer.OperationOutcome.Undetermined and
|
||||
not XCIFileTrimmer.OperationOutcome.Successful;
|
||||
if (IsFailed)
|
||||
return LocaleManager.Instance[LocaleKeys.XCITrimmer_FailedLabel];
|
||||
|
||||
return ProcessingOutcome switch
|
||||
{
|
||||
XCIFileTrimmer.OperationOutcome.Successful =>
|
||||
CurrentSavingsB > 0
|
||||
? LocaleManager.Instance[LocaleKeys.XCITrimmer_UntrimmedLabel]
|
||||
: LocaleManager.Instance[LocaleKeys.XCITrimmer_TrimmedLabel],
|
||||
|
||||
XCIFileTrimmer.OperationOutcome.Undetermined =>
|
||||
Trimmable && Untrimmable
|
||||
? LocaleManager.Instance[LocaleKeys.XCITrimmer_PartialLabel]
|
||||
|
||||
: Trimmable
|
||||
? LocaleManager.Instance[LocaleKeys.XCITrimmer_UntrimmedLabel]
|
||||
|
||||
: Untrimmable
|
||||
? LocaleManager.Instance[LocaleKeys.XCITrimmer_TrimmedLabel]
|
||||
|
||||
: LocaleManager.Instance[LocaleKeys.XCITrimmer_UnknownLabel],
|
||||
|
||||
_ => LocaleManager.Instance[LocaleKeys.XCITrimmer_UnknownLabel]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasStatusDetail =>
|
||||
ProcessingOutcome != XCIFileTrimmer.OperationOutcome.Undetermined;
|
||||
|
||||
public virtual bool Equals(XCITrimmerFileModel obj)
|
||||
{
|
||||
if (obj == null)
|
||||
if (obj is null)
|
||||
return false;
|
||||
|
||||
return this.Path == obj.Path;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return this.Path.GetHashCode();
|
||||
return Path == obj.Path;
|
||||
}
|
||||
public override int GetHashCode() => Path.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,9 +26,9 @@ namespace Ryujinx.Ava.Common
|
||||
|
||||
internal class TrimmerWindow : Ryujinx.Common.Logging.XCIFileTrimmerLog
|
||||
{
|
||||
private readonly XciTrimmerViewModel _viewModel;
|
||||
private readonly XCITrimmerViewModel _viewModel;
|
||||
|
||||
public TrimmerWindow(XciTrimmerViewModel viewModel)
|
||||
public TrimmerWindow(XCITrimmerViewModel viewModel)
|
||||
{
|
||||
_viewModel = viewModel;
|
||||
}
|
||||
|
||||
@@ -103,10 +103,10 @@
|
||||
<MenuItem
|
||||
Command="{Binding TrimXci}"
|
||||
CommandParameter="{Binding}"
|
||||
Header="{ext:Locale GameListContextMenuTrimXCI}"
|
||||
Header="{ext:Locale GameListContextMenu_TrimXCIButton}"
|
||||
IsEnabled="{Binding TrimXCIEnabled}"
|
||||
Icon="{ext:Icon fa-solid fa-scissors}"
|
||||
ToolTip.Tip="{ext:Locale GameListContextMenuTrimXCIToolTip}" />
|
||||
IsVisible="{Binding IsXCIFile}"
|
||||
Icon="{ext:Icon fa-solid fa-scissors}" />
|
||||
<MenuItem Header="{ext:Locale GameListContextMenuCacheManagement}" Icon="{ext:Icon fa-solid fa-memory}">
|
||||
<MenuItem
|
||||
Command="{Binding PurgePtcCache}"
|
||||
|
||||
@@ -12,32 +12,57 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
internal class XCITrimmerFileSpaceSavingsConverter : IValueConverter
|
||||
{
|
||||
private const long _bytesPerMB = 1024 * 1024;
|
||||
|
||||
public static readonly XCITrimmerFileSpaceSavingsConverter Instance = new();
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is UnsetValueType)
|
||||
{
|
||||
if (value == null || value == AvaloniaProperty.UnsetValue)
|
||||
return BindingOperations.DoNothing;
|
||||
}
|
||||
|
||||
if (!targetType.IsAssignableFrom(typeof(string)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (value is not XCITrimmerFileModel app)
|
||||
{
|
||||
return null;
|
||||
|
||||
long originalSize = app.OriginalSizeB;
|
||||
long currentSavings = app.CurrentSavingsB;
|
||||
long potentialSavings = app.PotentialSavingsB;
|
||||
|
||||
if (originalSize <= 0)
|
||||
{
|
||||
return GetFormattedString(app, 0, 0);
|
||||
}
|
||||
|
||||
long mbValue = 0;
|
||||
double percentage = 0;
|
||||
|
||||
if (currentSavings > 0)
|
||||
{
|
||||
mbValue = (currentSavings / _bytesPerMB).CoerceAtLeast(0);
|
||||
percentage = (currentSavings / (double)originalSize) * 100;
|
||||
}
|
||||
else if (potentialSavings > 0)
|
||||
{
|
||||
mbValue = (potentialSavings / _bytesPerMB).CoerceAtLeast(0);
|
||||
percentage = (potentialSavings / (double)originalSize) * 100;
|
||||
}
|
||||
|
||||
return GetFormattedString(app, mbValue, percentage);
|
||||
}
|
||||
|
||||
private string GetFormattedString(XCITrimmerFileModel app, long mb, double percentage)
|
||||
{
|
||||
// Round percentage to 1 decimal place
|
||||
double roundedPercentage = Math.Round(percentage, 1);
|
||||
|
||||
if (app.CurrentSavingsB < app.PotentialSavingsB)
|
||||
{
|
||||
return LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.TitleXCICanSaveLabel, ((app.PotentialSavingsB - app.CurrentSavingsB) / _bytesPerMB).CoerceAtLeast(0));
|
||||
return LocaleManager.Instance.UpdateAndGetDynamicValue(
|
||||
LocaleKeys.XCITrimmer_CalculatedSavingsLabel, mb, roundedPercentage);
|
||||
}
|
||||
else
|
||||
{
|
||||
return LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.TitleXCISavingLabel, (app.CurrentSavingsB / _bytesPerMB).CoerceAtLeast(0));
|
||||
return LocaleManager.Instance.UpdateAndGetDynamicValue(
|
||||
LocaleKeys.XCITrimmer_CalculatedSavingsLabel, mb, roundedPercentage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Data.Converters;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using Ryujinx.Ava.Common.Models;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
@@ -16,26 +16,30 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is UnsetValueType)
|
||||
{
|
||||
return BindingOperations.DoNothing;
|
||||
}
|
||||
|
||||
if (!targetType.IsAssignableFrom(typeof(string)))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (value is not XCITrimmerFileModel app)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return default(Symbol);
|
||||
|
||||
bool isProcessing = app.PercentageProgress != null;
|
||||
|
||||
if (isProcessing)
|
||||
return Symbol.Sync;
|
||||
|
||||
return app.PercentageProgress != null ? String.Empty :
|
||||
app.ProcessingOutcome is not OperationOutcome.Successful and not OperationOutcome.Undetermined ? LocaleManager.Instance[LocaleKeys.TitleXCIStatusFailedLabel] :
|
||||
app.Trimmable & app.Untrimmable ? LocaleManager.Instance[LocaleKeys.TitleXCIStatusPartialLabel] :
|
||||
app.Trimmable ? LocaleManager.Instance[LocaleKeys.TitleXCIStatusTrimmableLabel] :
|
||||
app.Untrimmable ? LocaleManager.Instance[LocaleKeys.TitleXCIStatusUntrimmableLabel] :
|
||||
String.Empty;
|
||||
if (app.ProcessingOutcome is not OperationOutcome.Successful
|
||||
and not OperationOutcome.Undetermined)
|
||||
return Symbol.ImportantFilled;
|
||||
|
||||
if (app.Trimmable && app.Untrimmable)
|
||||
return Symbol.Repair;
|
||||
|
||||
if (app.Trimmable)
|
||||
return Symbol.Clear;
|
||||
|
||||
if (app.Untrimmable)
|
||||
return Symbol.Checkmark;
|
||||
|
||||
return Symbol.Help;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
|
||||
@@ -9,17 +9,15 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||
{
|
||||
public string LocalizedText => opOutcome switch
|
||||
{
|
||||
OperationOutcome.NoTrimNecessary => LocaleManager.Instance[LocaleKeys.TrimXCIFileNoTrimNecessary],
|
||||
OperationOutcome.NoUntrimPossible => LocaleManager.Instance[LocaleKeys.TrimXCIFileNoUntrimPossible],
|
||||
OperationOutcome.ReadOnlyFileCannotFix => LocaleManager.Instance[
|
||||
LocaleKeys.TrimXCIFileReadOnlyFileCannotFix],
|
||||
OperationOutcome.FreeSpaceCheckFailed => LocaleManager.Instance[
|
||||
LocaleKeys.TrimXCIFileFreeSpaceCheckFailed],
|
||||
OperationOutcome.InvalidXCIFile => LocaleManager.Instance[LocaleKeys.TrimXCIFileInvalidXCIFile],
|
||||
OperationOutcome.FileIOWriteError => LocaleManager.Instance[LocaleKeys.TrimXCIFileFileIOWriteError],
|
||||
OperationOutcome.FileSizeChanged => LocaleManager.Instance[LocaleKeys.TrimXCIFileFileSizeChanged],
|
||||
OperationOutcome.Cancelled => LocaleManager.Instance[LocaleKeys.TrimXCIFileCancelled],
|
||||
OperationOutcome.Undetermined => LocaleManager.Instance[LocaleKeys.TrimXCIFileFileUndertermined],
|
||||
OperationOutcome.NoTrimNecessary => LocaleManager.Instance[LocaleKeys.Dialog_XCITrimmer_NoTrimNecessaryMessage],
|
||||
OperationOutcome.NoUntrimPossible => LocaleManager.Instance[LocaleKeys.Dialog_XCITrimmer_NoUntrimPossibleMessage],
|
||||
OperationOutcome.ReadOnlyFileCannotFix => LocaleManager.Instance[LocaleKeys.Dialog_XCITrimmer_ReadOnlyFileCannotFixMessage],
|
||||
OperationOutcome.FreeSpaceCheckFailed => LocaleManager.Instance[LocaleKeys.Dialog_XCITrimmer_FreeSpaceCheckFailedMessage],
|
||||
OperationOutcome.InvalidXCIFile => LocaleManager.Instance[LocaleKeys.Dialog_XCITrimmer_InvalidDataMessage],
|
||||
OperationOutcome.FileIOWriteError => LocaleManager.Instance[LocaleKeys.Dialog_XCITrimmer_WriteErrorMessage],
|
||||
OperationOutcome.FileSizeChanged => LocaleManager.Instance[LocaleKeys.Dialog_XCITrimmer_SizeChangedMessage],
|
||||
OperationOutcome.Cancelled => LocaleManager.Instance[LocaleKeys.Dialog_XCITrimmer_TrimCancelledMessage],
|
||||
OperationOutcome.Undetermined => LocaleManager.Instance[LocaleKeys.Dialog_XCITrimmer_NoOperationPerformedMessage],
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
||||
@@ -496,6 +496,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
public bool HasCompatibilityEntry => SelectedApplication.HasPlayabilityInfo;
|
||||
|
||||
public bool IsXCIFile => Path.GetExtension(SelectedApplication.Path)?.ToLower() == ".xci";
|
||||
|
||||
public bool HasDlc => ApplicationLibrary.HasDlcs(SelectedApplication.Id);
|
||||
|
||||
public bool OpenUserSaveDirectoryEnabled => SelectedApplication.HasControlHolder &&
|
||||
@@ -790,7 +792,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
ApplicationSort.Favorite => LocaleManager.Instance[LocaleKeys.CommonFavorite],
|
||||
ApplicationSort.TitleId => LocaleManager.Instance[LocaleKeys.DlcManagerTableHeadingTitleIdLabel],
|
||||
ApplicationSort.Title => LocaleManager.Instance[LocaleKeys.GameListHeaderApplication],
|
||||
ApplicationSort.Title => LocaleManager.Instance[LocaleKeys.Common_Sort_NameLabel],
|
||||
ApplicationSort.Developer => LocaleManager.Instance[LocaleKeys.GameListSortDeveloper],
|
||||
ApplicationSort.LastPlayed => LocaleManager.Instance[LocaleKeys.GameListSortLastPlayed],
|
||||
ApplicationSort.TotalTimePlayed => LocaleManager.Instance[LocaleKeys.GameListSortTimePlayed],
|
||||
@@ -1935,13 +1937,13 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
if (version != null)
|
||||
{
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.StatusBar_FirmwareVersion, version.VersionString);
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.StatusBar_FirmwareVersionLabel, version.VersionString);
|
||||
|
||||
hasApplet = version.Major > 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.StatusBar_FirmwareVersion, "NaN");
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.StatusBar_FirmwareVersionLabel, "NaN");
|
||||
}
|
||||
|
||||
IsAppletMenuActive = hasApplet;
|
||||
@@ -2317,7 +2319,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
if (notifyUser != null)
|
||||
{
|
||||
await ContentDialogHelper.CreateWarningDialog(
|
||||
LocaleManager.Instance[LocaleKeys.TrimXCIFileFailedPrimaryText],
|
||||
LocaleManager.Instance[LocaleKeys.Dialog_XCITrimmer_TrimFailedMessage],
|
||||
notifyUser
|
||||
);
|
||||
}
|
||||
@@ -2343,18 +2345,18 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
if (trimmer.CanBeTrimmed)
|
||||
{
|
||||
double savings = (double)trimmer.DiskSpaceSavingsB / 1024.0 / 1024.0;
|
||||
double currentFileSize = (double)trimmer.FileSizeB / 1024.0 / 1024.0;
|
||||
double cartDataSize = (double)trimmer.DataSizeB / 1024.0 / 1024.0;
|
||||
int savings = (int)Math.Round((double)trimmer.DiskSpaceSavingsB / 1024.0 / 1024.0);
|
||||
int currentFileSize = (int)Math.Round((double)trimmer.FileSizeB / 1024.0 / 1024.0);
|
||||
int cartDataSize = (int)Math.Round((double)trimmer.DataSizeB / 1024.0 / 1024.0);
|
||||
string secondaryText = LocaleManager.Instance.UpdateAndGetDynamicValue(
|
||||
LocaleKeys.TrimXCIFileDialogSecondaryText, currentFileSize, cartDataSize, savings);
|
||||
LocaleKeys.Dialog_XCITrimmer_SecondaryMessage, currentFileSize.ToString("0"), cartDataSize.ToString("0"), savings.ToString("0"));
|
||||
|
||||
UserResult result = await ContentDialogHelper.CreateConfirmationDialog(
|
||||
LocaleManager.Instance[LocaleKeys.TrimXCIFileDialogPrimaryText],
|
||||
LocaleManager.Instance[LocaleKeys.Dialog_XCITrimmer_PrimaryMessage],
|
||||
secondaryText,
|
||||
LocaleManager.Instance[LocaleKeys.Continue],
|
||||
LocaleManager.Instance[LocaleKeys.Cancel],
|
||||
LocaleManager.Instance[LocaleKeys.GameListContextMenuTrimXCI]
|
||||
LocaleManager.Instance[LocaleKeys.GameListContextMenu_TrimXCIButton]
|
||||
);
|
||||
|
||||
if (result == UserResult.Yes)
|
||||
@@ -2364,8 +2366,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
StatusBarProgressStatusText =
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.StatusBarXCIFileTrimming,
|
||||
Path.GetFileName(filename));
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.StatusBar_TrimmingXCILabel,
|
||||
Path.GetFileNameWithoutExtension(filename));
|
||||
StatusBarProgressStatusVisible = true;
|
||||
StatusBarProgressMaximum = 1;
|
||||
StatusBarProgressValue = 0;
|
||||
|
||||
@@ -16,7 +16,7 @@ using static Ryujinx.Common.Utilities.XCIFileTrimmer;
|
||||
|
||||
namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
public class XciTrimmerViewModel : BaseModel
|
||||
public class XCITrimmerViewModel : BaseModel
|
||||
{
|
||||
private const long BytesPerMb = 1024 * 1024;
|
||||
|
||||
@@ -29,11 +29,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
public enum SortField
|
||||
{
|
||||
Name,
|
||||
Saved
|
||||
Savings,
|
||||
Status
|
||||
}
|
||||
|
||||
private const string _FileExtXCI = "XCI";
|
||||
|
||||
private const string _fileExtXCI = "XCI";
|
||||
private readonly Ryujinx.Common.Logging.XCIFileTrimmerLog _logger;
|
||||
private ApplicationLibrary ApplicationLibrary => _mainWindowViewModel.ApplicationLibrary;
|
||||
private Optional<XCITrimmerFileModel> _processingApplication = null;
|
||||
@@ -45,8 +45,11 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private string _search;
|
||||
private ProcessingMode _processingMode;
|
||||
private SortField _sortField = SortField.Name;
|
||||
private int _processingCurrent;
|
||||
private int _processingTotal;
|
||||
|
||||
|
||||
public XciTrimmerViewModel(MainWindowViewModel mainWindowViewModel)
|
||||
public XCITrimmerViewModel(MainWindowViewModel mainWindowViewModel)
|
||||
{
|
||||
_logger = new XCITrimmerLog.TrimmerWindow(this);
|
||||
_mainWindowViewModel = mainWindowViewModel;
|
||||
@@ -56,7 +59,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private void LoadXCIApplications()
|
||||
{
|
||||
IEnumerable<ApplicationData> apps = ApplicationLibrary.Applications.Items
|
||||
.Where(app => app.FileExtension == _FileExtXCI);
|
||||
.Where(app => app.FileExtension == _fileExtXCI);
|
||||
|
||||
foreach (ApplicationData xciApp in apps)
|
||||
AddOrUpdateXCITrimmerFile(CreateXCITrimmerFile(xciApp.Path));
|
||||
@@ -64,11 +67,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
ApplicationsChanged();
|
||||
}
|
||||
|
||||
private XCITrimmerFileModel CreateXCITrimmerFile(
|
||||
string path,
|
||||
OperationOutcome operationOutcome = OperationOutcome.Undetermined)
|
||||
private XCITrimmerFileModel CreateXCITrimmerFile(string path, OperationOutcome operationOutcome = OperationOutcome.Undetermined)
|
||||
{
|
||||
ApplicationData xciApp = ApplicationLibrary.Applications.Items.First(app => app.FileExtension == _FileExtXCI && app.Path == path);
|
||||
ApplicationData xciApp = ApplicationLibrary.Applications.Items.First(app => app.FileExtension == _fileExtXCI && app.Path == path);
|
||||
return XCITrimmerFileModel.FromApplicationData(xciApp, _logger) with { ProcessingOutcome = operationOutcome };
|
||||
}
|
||||
|
||||
@@ -90,11 +91,15 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
SortAndFilter();
|
||||
}
|
||||
|
||||
public bool AnySelected =>
|
||||
_selectedXCIFiles.Count > 0;
|
||||
|
||||
private void SortingChanged()
|
||||
{
|
||||
OnPropertiesChanged(
|
||||
nameof(IsSortedByName),
|
||||
nameof(IsSortedBySaved),
|
||||
nameof(IsSortedBySavings),
|
||||
nameof(IsSortedByStatus),
|
||||
nameof(SortingAscending),
|
||||
nameof(SortingField),
|
||||
nameof(SortingFieldName));
|
||||
@@ -114,6 +119,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
nameof(Status),
|
||||
nameof(PotentialSavings),
|
||||
nameof(ActualSavings),
|
||||
nameof(SavingsDifference),
|
||||
nameof(CanTrim),
|
||||
nameof(CanUntrim));
|
||||
|
||||
@@ -123,16 +129,30 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
private void SelectionChanged(bool displayedChanged = true)
|
||||
{
|
||||
OnPropertiesChanged(
|
||||
nameof(Status),
|
||||
nameof(CanTrim),
|
||||
nameof(CanUntrim),
|
||||
nameof(SelectedXCIFiles));
|
||||
OnPropertyChanged(nameof(Status));
|
||||
OnPropertyChanged(nameof(CanTrim));
|
||||
OnPropertyChanged(nameof(CanUntrim));
|
||||
OnPropertyChanged(nameof(SelectedXCIFiles));
|
||||
OnPropertyChanged(nameof(AnySelected));
|
||||
OnPropertyChanged(nameof(SelectToggleText));
|
||||
|
||||
if (displayedChanged)
|
||||
OnPropertyChanged(nameof(SelectedDisplayedXCIFiles));
|
||||
}
|
||||
|
||||
public void ToggleSelect()
|
||||
{
|
||||
if (AnySelected)
|
||||
DeselectAll();
|
||||
else
|
||||
SelectAll();
|
||||
}
|
||||
|
||||
public string SelectToggleText =>
|
||||
AnySelected
|
||||
? LocaleManager.Instance[LocaleKeys.XCITrimmer_ClearSelectionButton]
|
||||
: LocaleManager.Instance[LocaleKeys.XCITrimmer_SelectAllButton];
|
||||
|
||||
private void ProcessingChanged()
|
||||
{
|
||||
OnPropertiesChanged(
|
||||
@@ -167,6 +187,14 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
(processingMode == ProcessingMode.Trimming && xci.Trimmable)
|
||||
)).ToList();
|
||||
|
||||
_processingTotal = toProcess.Count;
|
||||
_processingCurrent = 0;
|
||||
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
OnPropertyChanged(nameof(Status));
|
||||
});
|
||||
|
||||
List<XCITrimmerFileModel> viewsSaved = DisplayedXCIFiles.ToList();
|
||||
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
@@ -219,6 +247,12 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
ProcessingApplication = null;
|
||||
});
|
||||
}
|
||||
_processingCurrent++;
|
||||
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
OnPropertyChanged(nameof(Status));
|
||||
});
|
||||
}
|
||||
}
|
||||
finally
|
||||
@@ -226,9 +260,20 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
_displayedXCIFiles.AddOrReplaceMatching(_allXCIFiles, viewsSaved);
|
||||
_selectedXCIFiles.AddOrReplaceMatching(_allXCIFiles, toProcess);
|
||||
|
||||
Processing = false;
|
||||
ApplicationsChanged();
|
||||
|
||||
_selectedXCIFiles.Clear();
|
||||
|
||||
foreach (var processed in toProcess)
|
||||
{
|
||||
var updated = _allXCIFiles.FirstOrDefault(x => x.Path == processed.Path);
|
||||
if (updated != null)
|
||||
_selectedXCIFiles.Add(updated);
|
||||
}
|
||||
|
||||
SelectionChanged();
|
||||
});
|
||||
}
|
||||
})
|
||||
@@ -254,9 +299,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
private class CompareXCITrimmerFiles : IComparer<XCITrimmerFileModel>
|
||||
{
|
||||
private readonly XciTrimmerViewModel _viewModel;
|
||||
private readonly XCITrimmerViewModel _viewModel;
|
||||
|
||||
public CompareXCITrimmerFiles(XciTrimmerViewModel ViewModel)
|
||||
public CompareXCITrimmerFiles(XCITrimmerViewModel ViewModel)
|
||||
{
|
||||
_viewModel = ViewModel;
|
||||
}
|
||||
@@ -270,9 +315,13 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
case SortField.Name:
|
||||
result = x.Name.CompareTo(y.Name);
|
||||
break;
|
||||
case SortField.Saved:
|
||||
case SortField.Savings:
|
||||
result = x.PotentialSavingsB.CompareTo(y.PotentialSavingsB);
|
||||
break;
|
||||
case SortField.Status:
|
||||
|
||||
result = x.CurrentSavingsB.CompareTo(y.CurrentSavingsB);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!_viewModel.SortingAscending)
|
||||
@@ -312,15 +361,16 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public void SelectDisplayed()
|
||||
public void SelectAll()
|
||||
{
|
||||
SelectedXCIFiles.Clear();
|
||||
SelectedXCIFiles.AddRange(DisplayedXCIFiles);
|
||||
SelectionChanged();
|
||||
}
|
||||
|
||||
public void DeselectDisplayed()
|
||||
public void DeselectAll()
|
||||
{
|
||||
SelectedXCIFiles.RemoveMany(DisplayedXCIFiles);
|
||||
SelectedXCIFiles.Clear();
|
||||
SelectionChanged();
|
||||
}
|
||||
|
||||
@@ -426,16 +476,23 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
return _processingMode switch
|
||||
{
|
||||
ProcessingMode.Trimming => string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmerTitleStatusTrimming], DisplayedXCIFiles.Count),
|
||||
ProcessingMode.Untrimming => string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmerTitleStatusUntrimming], DisplayedXCIFiles.Count),
|
||||
ProcessingMode.Trimming => string.Format(
|
||||
LocaleManager.Instance[LocaleKeys.XCITrimmer_StatusTrimmingLabel],
|
||||
_processingCurrent,
|
||||
_processingTotal),
|
||||
|
||||
ProcessingMode.Untrimming => string.Format(
|
||||
LocaleManager.Instance[LocaleKeys.XCITrimmer_StatusUntrimmingLabel],
|
||||
_processingCurrent,
|
||||
_processingTotal),
|
||||
_ => string.Empty
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.IsNullOrEmpty(Search) ?
|
||||
string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmerTitleStatusCount], SelectedXCIFiles.Count, AllXCIFiles.Count) :
|
||||
string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmerTitleStatusCountWithFilter], SelectedXCIFiles.Count, AllXCIFiles.Count, DisplayedXCIFiles.Count);
|
||||
string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmer_StatusCountLabel], SelectedXCIFiles.Count, AllXCIFiles.Count) :
|
||||
string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmer_StatusCountWithFilterLabel], SelectedXCIFiles.Count, AllXCIFiles.Count, DisplayedXCIFiles.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -466,8 +523,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
return SortingField switch
|
||||
{
|
||||
SortField.Name => LocaleManager.Instance[LocaleKeys.XCITrimmerSortName],
|
||||
SortField.Saved => LocaleManager.Instance[LocaleKeys.XCITrimmerSortSaved],
|
||||
SortField.Name => LocaleManager.Instance[LocaleKeys.Common_Sort_NameLabel],
|
||||
SortField.Savings => LocaleManager.Instance[LocaleKeys.Common_Sort_SavingsLabel],
|
||||
SortField.Status => LocaleManager.Instance[LocaleKeys.Common_Sort_TrimStatusLabel],
|
||||
_ => string.Empty,
|
||||
};
|
||||
}
|
||||
@@ -488,11 +546,13 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
get => _sortField == SortField.Name;
|
||||
}
|
||||
|
||||
public bool IsSortedBySaved
|
||||
public bool IsSortedBySavings
|
||||
{
|
||||
get => _sortField == SortField.Saved;
|
||||
get => _sortField == SortField.Savings;
|
||||
}
|
||||
|
||||
public bool IsSortedByStatus => _sortField == SortField.Status;
|
||||
|
||||
public AvaloniaList<XCITrimmerFileModel> SelectedXCIFiles
|
||||
{
|
||||
get => _selectedXCIFiles;
|
||||
@@ -517,7 +577,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmerSavingsMb], AllXCIFiles.Sum(xci => xci.PotentialSavingsB / BytesPerMb));
|
||||
return string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmer_MBLabel], AllXCIFiles.Sum(xci => xci.PotentialSavingsB / BytesPerMb));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,7 +585,19 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmerSavingsMb], AllXCIFiles.Sum(xci => xci.CurrentSavingsB / BytesPerMb));
|
||||
return string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmer_MBLabel], AllXCIFiles.Sum(xci => xci.CurrentSavingsB / BytesPerMb));
|
||||
}
|
||||
}
|
||||
|
||||
public string SavingsDifference
|
||||
{
|
||||
get
|
||||
{
|
||||
long potentialSavings = AllXCIFiles.Sum(xci => xci.PotentialSavingsB);
|
||||
long actualSavings = AllXCIFiles.Sum(xci => xci.CurrentSavingsB);
|
||||
long differenceMb = (potentialSavings - actualSavings) / BytesPerMb;
|
||||
|
||||
return string.Format(LocaleManager.Instance[LocaleKeys.XCITrimmer_MBLabel], differenceMb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
MinHeight="29"
|
||||
MaxHeight="29"
|
||||
HorizontalAlignment="Stretch"
|
||||
Watermark="{ext:Locale Search}"
|
||||
Watermark="{ext:Locale Common_Search_SearchWatermark}"
|
||||
Text="{Binding Search}" />
|
||||
</Grid>
|
||||
</Panel>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
MinHeight="27"
|
||||
MaxHeight="27"
|
||||
HorizontalAlignment="Stretch"
|
||||
Watermark="{ext:Locale Search}"
|
||||
Watermark="{ext:Locale Common_Search_SearchWatermark}"
|
||||
Text="{Binding Search}" />
|
||||
</Grid>
|
||||
</Panel>
|
||||
|
||||
185
src/Ryujinx/UI/Views/Dialog/XCITrimmerView.axaml
Normal file
185
src/Ryujinx/UI/Views/Dialog/XCITrimmerView.axaml
Normal file
@@ -0,0 +1,185 @@
|
||||
<UserControl
|
||||
x:Class="Ryujinx.Ava.UI.Views.Dialog.XCITrimmerView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||
xmlns:models="clr-namespace:Ryujinx.Ava.Common.Models"
|
||||
Width="700"
|
||||
Height="600"
|
||||
x:DataType="viewModels:XCITrimmerViewModel"
|
||||
Focusable="True"
|
||||
mc:Ignorable="d">
|
||||
<Grid Margin="25,10,25,0" RowDefinitions="Auto,Auto,*,Auto,Auto">
|
||||
<Panel Margin="0,0,0,10" Grid.Row="0">
|
||||
<TextBlock Text="{Binding Status}" />
|
||||
</Panel>
|
||||
<Grid Margin="0,0,0,10" Grid.Row="1" IsVisible="{Binding !Processing}" ColumnDefinitions="Auto,*">
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
|
||||
<Button Margin="0,0,10,0" MinWidth="90" Click="ToggleSelect">
|
||||
<TextBlock Text="{Binding SelectToggleText}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
|
||||
<DropDownButton Width="170" HorizontalAlignment="Right" VerticalAlignment="Center" Content="{Binding SortingFieldName}">
|
||||
<DropDownButton.Flyout>
|
||||
<Flyout Placement="Bottom">
|
||||
<StackPanel Margin="0" HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||
<StackPanel>
|
||||
<RadioButton Checked="Sort_Checked" Content="{ext:Locale Common_Sort_NameLabel}" GroupName="Sort" IsChecked="{Binding IsSortedByName, Mode=OneTime}" Tag="Name" />
|
||||
<RadioButton Checked="Sort_Checked" Content="{ext:Locale Common_Sort_SavingsLabel}" GroupName="Sort" IsChecked="{Binding IsSortedBySavings, Mode=OneTime}" Tag="Savings" />
|
||||
<RadioButton Checked="Sort_Checked" Content="{ext:Locale Common_Sort_TrimStatusLabel}" GroupName="Sort" IsChecked="{Binding IsSortedByStatus, Mode=OneTime}" Tag="Status" />
|
||||
</StackPanel>
|
||||
<Border Width="60" Height="2" Margin="5" HorizontalAlignment="Stretch" BorderBrush="White" BorderThickness="0,1,0,0">
|
||||
<Separator Height="0" HorizontalAlignment="Stretch" />
|
||||
</Border>
|
||||
<RadioButton Checked="Order_Checked" Content="{ext:Locale Common_Sort_OrderAscending}" GroupName="Order" IsChecked="{Binding SortingAscending, Mode=OneTime}" Tag="Ascending" />
|
||||
<RadioButton Checked="Order_Checked" Content="{ext:Locale Common_Sort_OrderDescending}" GroupName="Order" IsChecked="{Binding !SortingAscending, Mode=OneTime}" Tag="Descending" />
|
||||
</StackPanel>
|
||||
</Flyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
<TextBox
|
||||
Width="200"
|
||||
MaxWidth="200"
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Watermark="{ext:Locale Common_Search_SearchWatermark}"
|
||||
Text="{Binding Search}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Margin="0,0,0,20"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5"
|
||||
Padding="2.5">
|
||||
<ListBox
|
||||
AutoScrollToSelectedItem="{Binding Processing}"
|
||||
SelectedItem="{Binding NullableProcessingApplication}"
|
||||
SelectionMode="Multiple, Toggle"
|
||||
Background="Transparent"
|
||||
SelectionChanged="OnSelectionChanged"
|
||||
SelectedItems="{Binding SelectedDisplayedXCIFiles, Mode=OneWay}"
|
||||
ItemsSource="{Binding DisplayedXCIFiles}"
|
||||
IsEnabled="{Binding !Processing}">
|
||||
<ListBox.Styles>
|
||||
<Style Selector="ListBoxItem">
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
</ListBox.Styles>
|
||||
<ListBox.DataTemplates>
|
||||
<DataTemplate DataType="models:XCITrimmerFileModel">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<ui:SymbolIcon
|
||||
Grid.Column="0"
|
||||
Margin="10,0,20,0"
|
||||
Width="15"
|
||||
Height="15"
|
||||
FontSize="15"
|
||||
FlowDirection="LeftToRight"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Symbol="{Binding Converter={x:Static helpers:XCITrimmerFileStatusConverter.Instance}}">
|
||||
<ToolTip.Tip>
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Text="{Binding StatusText}" />
|
||||
<TextBlock
|
||||
MaxLines="5"
|
||||
MaxWidth="200"
|
||||
TextWrapping="Wrap"
|
||||
IsVisible="{Binding HasStatusDetail}"
|
||||
Text="{Binding ., Converter={x:Static helpers:XCITrimmerFileStatusDetailConverter.Instance}}" />
|
||||
</StackPanel>
|
||||
</ToolTip.Tip>
|
||||
</ui:SymbolIcon>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="0,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
MaxLines="2"
|
||||
TextWrapping="Wrap"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Text="{Binding Name}" />
|
||||
<Grid
|
||||
Grid.Column="2"
|
||||
MinWidth="120"
|
||||
ColumnDefinitions="*">
|
||||
<ProgressBar
|
||||
Height="10"
|
||||
Margin="10,0,10,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
CornerRadius="5"
|
||||
IsVisible="{Binding $parent[UserControl].DataContext.Processing}"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Value="{Binding PercentageProgress}" />
|
||||
<TextBlock
|
||||
Margin="10,0,10,0"
|
||||
FlowDirection="LeftToRight"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
MaxLines="1"
|
||||
IsVisible="{Binding !$parent[UserControl].DataContext.Processing}"
|
||||
Text="{Binding ., Converter={x:Static helpers:XCITrimmerFileSpaceSavingsConverter.Instance}}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.DataTemplates>
|
||||
</ListBox>
|
||||
</Border>
|
||||
<StackPanel Grid.Row="3" Margin="0,0,0,20" Spacing="5" FlowDirection="LeftToRight" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
|
||||
<TextBlock Classes="h1" HorizontalAlignment="Center" VerticalAlignment="Center" MaxLines="1" Text="{ext:Locale XCITrimmer_SavedLabel}" />
|
||||
<TextBlock Classes="h1" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Regular" MaxLines="1" Text="{Binding ActualSavings}" />
|
||||
<TextBlock Classes="h1" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Regular" MaxLines="1" Text="•" />
|
||||
<TextBlock Classes="h1" HorizontalAlignment="Center" VerticalAlignment="Center" MaxLines="1" Text="{ext:Locale XCITrimmer_RemainingLabel}" />
|
||||
<TextBlock Classes="h1" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Regular" MaxLines="1" Text="{Binding SavingsDifference}" />
|
||||
</StackPanel>
|
||||
<Panel Grid.Row="4" Margin="0,10,0,0" HorizontalAlignment="Stretch">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal" Spacing="10" HorizontalAlignment="Left">
|
||||
<Button Name="TrimButton" MinWidth="90" Click="Trim" IsEnabled="{Binding CanTrim}">
|
||||
<TextBlock Text="{ext:Locale XCITrimmer_TrimButton}" />
|
||||
</Button>
|
||||
<Button Name="UntrimButton" MinWidth="90" Click="Untrim" IsEnabled="{Binding CanUntrim}">
|
||||
<TextBlock Text="{ext:Locale XCITrimmer_UntrimButton}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="10" HorizontalAlignment="Right">
|
||||
<Button Name="CancellingButton" MinWidth="90" Click="Cancel" IsEnabled="False">
|
||||
<Button.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<Binding Path="Processing" />
|
||||
<Binding Path="Cancel" />
|
||||
</MultiBinding>
|
||||
</Button.IsVisible>
|
||||
<TextBlock Text="{ext:Locale InputDialogCancelling}" />
|
||||
</Button>
|
||||
<Button Name="CancelButton" MinWidth="90" Click="Cancel">
|
||||
<Button.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<Binding Path="Processing" />
|
||||
<Binding Path="!Cancel" />
|
||||
</MultiBinding>
|
||||
</Button.IsVisible>
|
||||
<TextBlock Text="{ext:Locale InputDialogCancel}" />
|
||||
</Button>
|
||||
<Button Name="CloseButton" MinWidth="90" Click="Close" IsVisible="{Binding !Processing}">
|
||||
<TextBlock Text="{ext:Locale SettingsButtonClose}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Panel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -11,13 +11,19 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.UI.Views.Dialog
|
||||
{
|
||||
public partial class XciTrimmerView : RyujinxControl<XciTrimmerViewModel>
|
||||
public partial class XCITrimmerView : RyujinxControl<XCITrimmerViewModel>
|
||||
{
|
||||
public XciTrimmerView()
|
||||
public XCITrimmerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ToggleSelect(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is XCITrimmerViewModel vm)
|
||||
vm.ToggleSelect();
|
||||
}
|
||||
|
||||
public static async Task Show()
|
||||
{
|
||||
ContentDialog contentDialog = new()
|
||||
@@ -25,11 +31,11 @@ namespace Ryujinx.Ava.UI.Views.Dialog
|
||||
PrimaryButtonText = string.Empty,
|
||||
SecondaryButtonText = string.Empty,
|
||||
CloseButtonText = string.Empty,
|
||||
Content = new XciTrimmerView
|
||||
Content = new XCITrimmerView
|
||||
{
|
||||
ViewModel = new XciTrimmerViewModel(RyujinxApp.MainWindow.ViewModel)
|
||||
ViewModel = new XCITrimmerViewModel(RyujinxApp.MainWindow.ViewModel)
|
||||
},
|
||||
Title = LocaleManager.Instance[LocaleKeys.XCITrimmerWindowTitle]
|
||||
Title = LocaleManager.Instance[LocaleKeys.MenuBar_Actions_XCITrimmerButton]
|
||||
};
|
||||
|
||||
Style bottomBorder = new(x => x.OfType<Grid>().Name("DialogSpace").Child().OfType<Border>());
|
||||
@@ -63,7 +69,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
|
||||
public void Sort_Checked(object sender, RoutedEventArgs args)
|
||||
{
|
||||
if (sender is RadioButton { Tag: string sortField })
|
||||
ViewModel.SortingField = Enum.Parse<XciTrimmerViewModel.SortField>(sortField);
|
||||
ViewModel.SortingField = Enum.Parse<XCITrimmerViewModel.SortField>(sortField);
|
||||
}
|
||||
|
||||
public void Order_Checked(object sender, RoutedEventArgs args)
|
||||
@@ -1,311 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="Ryujinx.Ava.UI.Views.Dialog.XciTrimmerView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||
xmlns:models="clr-namespace:Ryujinx.Ava.Common.Models"
|
||||
Width="700"
|
||||
Height="600"
|
||||
x:DataType="viewModels:XciTrimmerViewModel"
|
||||
Focusable="True"
|
||||
mc:Ignorable="d">
|
||||
<Grid Margin="20 0 20 0" RowDefinitions="Auto,Auto,*,Auto,Auto">
|
||||
<Panel
|
||||
Margin="10 10 10 10"
|
||||
Grid.Row="0">
|
||||
<TextBlock Text="{Binding Status}" />
|
||||
</Panel>
|
||||
<Panel
|
||||
Margin="0 0 10 10"
|
||||
IsVisible="{Binding !Processing}"
|
||||
Grid.Row="1">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Orientation="Horizontal">
|
||||
<DropDownButton
|
||||
Width="150"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Content="{Binding SortingFieldName}">
|
||||
<DropDownButton.Flyout>
|
||||
<Flyout Placement="Bottom">
|
||||
<StackPanel
|
||||
Margin="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Orientation="Vertical">
|
||||
<StackPanel>
|
||||
<RadioButton
|
||||
Checked="Sort_Checked"
|
||||
Content="{ext:Locale XCITrimmerSortName}"
|
||||
GroupName="Sort"
|
||||
IsChecked="{Binding IsSortedByName, Mode=OneTime}"
|
||||
Tag="Name" />
|
||||
<RadioButton
|
||||
Checked="Sort_Checked"
|
||||
Content="{ext:Locale XCITrimmerSortSaved}"
|
||||
GroupName="Sort"
|
||||
IsChecked="{Binding IsSortedBySaved, Mode=OneTime}"
|
||||
Tag="Saved" />
|
||||
</StackPanel>
|
||||
<Border
|
||||
Width="60"
|
||||
Height="2"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
BorderBrush="White"
|
||||
BorderThickness="0,1,0,0">
|
||||
<Separator Height="0" HorizontalAlignment="Stretch" />
|
||||
</Border>
|
||||
<RadioButton
|
||||
Checked="Order_Checked"
|
||||
Content="{ext:Locale OrderAscending}"
|
||||
GroupName="Order"
|
||||
IsChecked="{Binding SortingAscending, Mode=OneTime}"
|
||||
Tag="Ascending" />
|
||||
<RadioButton
|
||||
Checked="Order_Checked"
|
||||
Content="{ext:Locale OrderDescending}"
|
||||
GroupName="Order"
|
||||
IsChecked="{Binding !SortingAscending, Mode=OneTime}"
|
||||
Tag="Descending" />
|
||||
</StackPanel>
|
||||
</Flyout>
|
||||
</DropDownButton.Flyout>
|
||||
</DropDownButton>
|
||||
</StackPanel>
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
MinHeight="29"
|
||||
MaxHeight="29"
|
||||
Margin="5 0 5 0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Watermark="{ext:Locale Search}"
|
||||
Text="{Binding Search}" />
|
||||
<StackPanel
|
||||
Grid.Column="2"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Name="SelectDisplayedButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding SelectDisplayed}">
|
||||
<TextBlock Text="{ext:Locale XCITrimmerSelectDisplayed}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="DeselectDisplayedButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Command="{Binding DeselectDisplayed}">
|
||||
<TextBlock Text="{ext:Locale XCITrimmerDeselectDisplayed}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Panel>
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Margin="0 0 0 10"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5"
|
||||
Padding="2.5">
|
||||
<ListBox
|
||||
AutoScrollToSelectedItem="{Binding Processing}"
|
||||
SelectedItem="{Binding NullableProcessingApplication}"
|
||||
SelectionMode="Multiple, Toggle"
|
||||
Background="Transparent"
|
||||
SelectionChanged="OnSelectionChanged"
|
||||
SelectedItems="{Binding SelectedDisplayedXCIFiles, Mode=OneWay}"
|
||||
ItemsSource="{Binding DisplayedXCIFiles}"
|
||||
IsEnabled="{Binding !Processing}">
|
||||
<ListBox.DataTemplates>
|
||||
<DataTemplate
|
||||
DataType="models:XCITrimmerFileModel">
|
||||
<Panel Margin="10">
|
||||
<Grid ColumnDefinitions="65*,35*">
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Margin="10 0 10 0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
MaxLines="2"
|
||||
TextWrapping="Wrap"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
Text="{Binding Name}">
|
||||
</TextBlock>
|
||||
<Grid Grid.Column="1" ColumnDefinitions="45*,55*">
|
||||
<ProgressBar
|
||||
Height="10"
|
||||
Margin="10 0 10 0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
CornerRadius="5"
|
||||
IsVisible="{Binding $parent[UserControl].((viewModels:XciTrimmerViewModel)DataContext).Processing}"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Value="{Binding PercentageProgress}" />
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Margin="10 0 10 0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
MaxLines="1"
|
||||
Text="{Binding ., Converter={x:Static helpers:XCITrimmerFileStatusConverter.Instance}}">
|
||||
<ToolTip.Tip>
|
||||
<StackPanel
|
||||
IsVisible="{Binding IsFailed}">
|
||||
<TextBlock
|
||||
Classes="h1"
|
||||
Text="{ext:Locale XCITrimmerTitleStatusFailed}" />
|
||||
<TextBlock
|
||||
Text="{Binding ., Converter={x:Static helpers:XCITrimmerFileStatusDetailConverter.Instance}}"
|
||||
MaxLines="5"
|
||||
MaxWidth="200"
|
||||
MaxHeight="100"
|
||||
TextTrimming="None"
|
||||
TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</ToolTip.Tip>
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="10 0 10 0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
MaxLines="1"
|
||||
Text="{Binding ., Converter={x:Static helpers:XCITrimmerFileSpaceSavingsConverter.Instance}}">>
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Panel>
|
||||
</DataTemplate>
|
||||
</ListBox.DataTemplates>
|
||||
<ListBox.Styles>
|
||||
<Style Selector="ListBoxItem">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
</ListBox.Styles>
|
||||
</ListBox>
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Row="3"
|
||||
Margin="0 0 0 10"
|
||||
HorizontalAlignment="Stretch"
|
||||
BorderBrush="{DynamicResource AppListHoverBackgroundColor}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5"
|
||||
Padding="2.5">
|
||||
<Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto,Auto">
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Classes="h1"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
MaxLines="1"
|
||||
Text="{ext:Locale XCITrimmerPotentialSavings}" />
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Classes="h1"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
MaxLines="1"
|
||||
Text="{ext:Locale XCITrimmerActualSavings}" />
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
MaxLines="1"
|
||||
Text="{Binding PotentialSavings}" />
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
MaxLines="1"
|
||||
Text="{Binding ActualSavings}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<Panel
|
||||
Grid.Row="4"
|
||||
HorizontalAlignment="Stretch">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="10"
|
||||
HorizontalAlignment="Left">
|
||||
<Button
|
||||
Name="TrimButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Click="Trim"
|
||||
IsEnabled="{Binding CanTrim}">
|
||||
<TextBlock Text="{ext:Locale XCITrimmerTrim}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="UntrimButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Click="Untrim"
|
||||
IsEnabled="{Binding CanUntrim}">
|
||||
<TextBlock Text="{ext:Locale XCITrimmerUntrim}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Orientation="Horizontal"
|
||||
Spacing="10"
|
||||
HorizontalAlignment="Right">
|
||||
<Button
|
||||
Name="CancellingButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Click="Cancel"
|
||||
IsEnabled="False">
|
||||
<Button.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<Binding Path="Processing" />
|
||||
<Binding Path="Cancel" />
|
||||
</MultiBinding>
|
||||
</Button.IsVisible>
|
||||
<TextBlock Text="{ext:Locale InputDialogCancelling}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="CancelButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Click="Cancel">
|
||||
<Button.IsVisible>
|
||||
<MultiBinding Converter="{x:Static BoolConverters.And}">
|
||||
<Binding Path="Processing" />
|
||||
<Binding Path="!Cancel" />
|
||||
</MultiBinding>
|
||||
</Button.IsVisible>
|
||||
<TextBlock Text="{ext:Locale InputDialogCancel}" />
|
||||
</Button>
|
||||
<Button
|
||||
Name="CloseButton"
|
||||
MinWidth="90"
|
||||
Margin="5"
|
||||
Click="Close"
|
||||
IsVisible="{Binding !Processing}">
|
||||
<TextBlock Text="{ext:Locale InputDialogClose}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Panel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -163,7 +163,7 @@
|
||||
IsEnabled="{Binding HasSkylander}" />
|
||||
<MenuItem
|
||||
Command="{Binding SimulateWakeUpMessage}"
|
||||
Header="{ext:Locale MenuBarOptionsSimulateWakeUpMessage}"
|
||||
Header="{ext:Locale MenuBar_Actions_SimulateWakeUpMessageButton}"
|
||||
Icon="{ext:Icon fa-solid fa-sun}"
|
||||
InputGesture="Ctrl + M" />
|
||||
<Separator />
|
||||
@@ -216,7 +216,7 @@
|
||||
<MenuItem Header="{ext:Locale MenuBar_Actions_ToolsLabel}" Icon="{ext:Icon fa-solid fa-toolbox}">
|
||||
<MenuItem
|
||||
Name="MiiAppletMenuItem" Header="{ext:Locale MenuBar_Actions_MiiEditorButton}" Icon="{ext:Icon fa-solid fa-face-grin-wide}" />
|
||||
<MenuItem Name="XciTrimmerMenuItem" Header="{ext:Locale MenuBar_Actions_XCITrimmerButton}" Icon="{ext:Icon fa-solid fa-scissors}" />
|
||||
<MenuItem Name="XCITrimmerMenuItem" Header="{ext:Locale MenuBar_Actions_XCITrimmerButton}" Icon="{ext:Icon fa-solid fa-scissors}" />
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
<MenuItem VerticalAlignment="Center" Header="{ext:Locale MenuBarView}">
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||
ResumeEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.Resume());
|
||||
StopEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.ShowExitPrompt().OrCompleted());
|
||||
RestartEmulationMenuItem.Command = Commands.Create(() => ViewModel.RestartEmulation());
|
||||
XciTrimmerMenuItem.Command = Commands.Create(XciTrimmerView.Show);
|
||||
XCITrimmerMenuItem.Command = Commands.Create(XCITrimmerView.Show);
|
||||
AboutWindowMenuItem.Command = Commands.Create(AboutView.Show);
|
||||
CompatibilityListMenuItem.Command = Commands.Create(() => CompatibilityListWindow.Show());
|
||||
LdnGameListMenuItem.Command = Commands.Create(() => LdnGamesListWindow.Show());
|
||||
|
||||
@@ -50,33 +50,37 @@
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding EnableNonGameRunningControls}"
|
||||
Text="{ext:Locale StatusBarGamesLoaded}" />
|
||||
<TextBlock
|
||||
Name="StatusBarProgressStatus"
|
||||
Grid.Column="2"
|
||||
MinWidth="200"
|
||||
Margin="10,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding StatusBarProgressStatusVisible}"
|
||||
Text="{Binding StatusBarProgressStatusText}" />
|
||||
<ProgressBar
|
||||
Name="LoadProgressBar"
|
||||
Grid.Column="3"
|
||||
MinWidth="200"
|
||||
Height="6"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0, 0, 5, 0"
|
||||
Foreground="{DynamicResource SystemAccentColorLight2}"
|
||||
IsVisible="{Binding StatusBarVisible}"
|
||||
Maximum="{Binding StatusBarProgressMaximum}"
|
||||
Value="{Binding StatusBarProgressValue}" />
|
||||
<controls:MiniVerticalSeparator Grid.Column="4" IsVisible="{Binding ShowTotalTimePlayed}" />
|
||||
<controls:MiniVerticalSeparator Grid.Column="2" IsVisible="{Binding ShowTotalTimePlayed}" />
|
||||
<TextBlock
|
||||
Grid.Column="5"
|
||||
Grid.Column="3"
|
||||
Margin="5,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding ShowTotalTimePlayed}"
|
||||
Text="{ext:Locale GameListLabelTotalTimePlayed}">
|
||||
</TextBlock>
|
||||
<controls:MiniVerticalSeparator Grid.Column="4" IsVisible="{Binding StatusBarVisible}" />
|
||||
<controls:MiniVerticalSeparator Grid.Column="4" IsVisible="{Binding StatusBarProgressStatusVisible}" />
|
||||
<TextBlock
|
||||
Name="StatusBarProgressStatus"
|
||||
Grid.Column="5"
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="{Binding StatusBarProgressStatusVisible}"
|
||||
Text="{Binding StatusBarProgressStatusText}"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
TextWrapping="NoWrap"
|
||||
MaxWidth="1000" />
|
||||
<ProgressBar
|
||||
Name="LoadProgressBar"
|
||||
Grid.Column="6"
|
||||
MinWidth="100"
|
||||
Height="6"
|
||||
VerticalAlignment="Center"
|
||||
Margin="5,0,5,0"
|
||||
Foreground="{DynamicResource SystemAccentColorLight2}"
|
||||
IsVisible="{Binding StatusBarVisible}"
|
||||
Maximum="{Binding StatusBarProgressMaximum}"
|
||||
Value="{Binding StatusBarProgressValue}" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
@@ -329,7 +333,7 @@
|
||||
Margin="5, 0, 0, 0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Text="{ext:Locale StatusBar_FirmwareVersion}" />
|
||||
Text="{ext:Locale StatusBar_FirmwareVersionLabel}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
Tag="Favorite" />
|
||||
<RadioButton
|
||||
Checked="Sort_Checked"
|
||||
Content="{ext:Locale GameListHeaderApplication}"
|
||||
Content="{ext:Locale Common_Sort_NameLabel}"
|
||||
GroupName="Sort"
|
||||
IsChecked="{Binding IsSortedByTitle, Mode=OneTime}"
|
||||
Tag="Title" />
|
||||
@@ -153,13 +153,13 @@
|
||||
</Border>
|
||||
<RadioButton
|
||||
Checked="Order_Checked"
|
||||
Content="{ext:Locale OrderAscending}"
|
||||
Content="{ext:Locale Common_Sort_OrderAscending}"
|
||||
GroupName="Order"
|
||||
IsChecked="{Binding IsAscending, Mode=OneTime}"
|
||||
Tag="Ascending" />
|
||||
<RadioButton
|
||||
Checked="Order_Checked"
|
||||
Content="{ext:Locale OrderDescending}"
|
||||
Content="{ext:Locale Common_Sort_OrderDescending}"
|
||||
GroupName="Order"
|
||||
IsChecked="{Binding !IsAscending, Mode=OneTime}"
|
||||
Tag="Descending" />
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
HorizontalContentAlignment="Left"
|
||||
MinWidth="100">
|
||||
<ComboBoxItem
|
||||
Content="{ext:Locale Name}" />
|
||||
Content="{ext:Locale Common_Sort_NameLabel}" />
|
||||
<ComboBoxItem
|
||||
Content="{ext:Locale Size}" />
|
||||
<ComboBox.Styles>
|
||||
@@ -46,9 +46,9 @@
|
||||
HorizontalContentAlignment="Left"
|
||||
MinWidth="150">
|
||||
<ComboBoxItem
|
||||
Content="{ext:Locale OrderAscending}" />
|
||||
Content="{ext:Locale Common_Sort_OrderAscending}" />
|
||||
<ComboBoxItem
|
||||
Content="{ext:Locale OrderDescending}" />
|
||||
Content="{ext:Locale Common_Sort_OrderDescending}" />
|
||||
<ComboBox.Styles>
|
||||
<Style Selector="ContentControl#ContentPresenter">
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
@@ -60,7 +60,7 @@
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="10,0, 0, 0" ColumnDefinitions="Auto,*">
|
||||
<TextBlock Text="{ext:Locale Search}" VerticalAlignment="Center" />
|
||||
<TextBlock Text="{ext:Locale Common_Search_SearchWatermark}" VerticalAlignment="Center" />
|
||||
<TextBox
|
||||
Margin="10,0,0,0"
|
||||
Grid.Column="1"
|
||||
|
||||
Reference in New Issue
Block a user