diff options
| author | Ac_K <Acoustik666@gmail.com> | 2023-05-04 16:41:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-04 14:41:06 +0000 |
| commit | 3b8ac1641a8a40849915396813e26384b5894911 (patch) | |
| tree | 5355d6601917146809323990a1a0de8f3a7e893b /src/Ryujinx.Ava/UI/Controls/GameGridView.axaml | |
| parent | 42507323535443ad79be071367f3d4815afca688 (diff) | |
UI: Move ApplicationContextMenu in a separated class (#4755)
* UI: Move ApplicationContextMenu in a separated class
This PR remove duplicated code related to the context menu on the Application list/grid by create a control for the menu which include related handler.
I've renamed "GameList/GameGrid" by "Application" for consistencies. And I've removed all uneeded field from the project file too.
While I cleaned up things, I've found an issue about purging Ptc/Shader cache, both methods list files even if the user say "No", shader cache is purged even if the user say "No". It's fixed.
* Adresses feedbacks
Diffstat (limited to 'src/Ryujinx.Ava/UI/Controls/GameGridView.axaml')
| -rw-r--r-- | src/Ryujinx.Ava/UI/Controls/GameGridView.axaml | 177 |
1 files changed, 0 insertions, 177 deletions
diff --git a/src/Ryujinx.Ava/UI/Controls/GameGridView.axaml b/src/Ryujinx.Ava/UI/Controls/GameGridView.axaml deleted file mode 100644 index 32cabfaa..00000000 --- a/src/Ryujinx.Ava/UI/Controls/GameGridView.axaml +++ /dev/null @@ -1,177 +0,0 @@ -<UserControl - x:Class="Ryujinx.Ava.UI.Controls.GameGridView" - xmlns="https://github.com/avaloniaui" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:flex="clr-namespace:Avalonia.Flexbox;assembly=Avalonia.Flexbox" - xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" - xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers" - d:DesignHeight="450" - d:DesignWidth="800" - mc:Ignorable="d" - Focusable="True"> - <UserControl.Resources> - <helpers:BitmapArrayValueConverter x:Key="ByteImage" /> - <MenuFlyout x:Key="GameContextMenu"> - <MenuItem - Command="{Binding ToggleFavorite}" - Header="{locale:Locale GameListContextMenuToggleFavorite}" - ToolTip.Tip="{locale:Locale GameListContextMenuToggleFavoriteToolTip}" /> - <Separator /> - <MenuItem - Command="{Binding OpenUserSaveDirectory}" - IsEnabled="{Binding EnabledUserSaveDirectory}" - Header="{locale:Locale GameListContextMenuOpenUserSaveDirectory}" - ToolTip.Tip="{locale:Locale GameListContextMenuOpenUserSaveDirectoryToolTip}" /> - <MenuItem - Command="{Binding OpenDeviceSaveDirectory}" - IsEnabled="{Binding EnabledDeviceSaveDirectory}" - Header="{locale:Locale GameListContextMenuOpenDeviceSaveDirectory}" - ToolTip.Tip="{locale:Locale GameListContextMenuOpenDeviceSaveDirectoryToolTip}" /> - <MenuItem - Command="{Binding OpenBcatSaveDirectory}" - IsEnabled="{Binding EnabledBcatSaveDirectory}" - Header="{locale:Locale GameListContextMenuOpenBcatSaveDirectory}" - ToolTip.Tip="{locale:Locale GameListContextMenuOpenBcatSaveDirectoryToolTip}" /> - <Separator /> - <MenuItem - Command="{Binding OpenTitleUpdateManager}" - Header="{locale:Locale GameListContextMenuManageTitleUpdates}" - ToolTip.Tip="{locale:Locale GameListContextMenuManageTitleUpdatesToolTip}" /> - <MenuItem - Command="{Binding OpenDownloadableContentManager}" - Header="{locale:Locale GameListContextMenuManageDlc}" - ToolTip.Tip="{locale:Locale GameListContextMenuManageDlcToolTip}" /> - <MenuItem - Command="{Binding OpenCheatManager}" - Header="{locale:Locale GameListContextMenuManageCheat}" - ToolTip.Tip="{locale:Locale GameListContextMenuManageCheatToolTip}" /> - <MenuItem - Command="{Binding OpenModsDirectory}" - Header="{locale:Locale GameListContextMenuOpenModsDirectory}" - ToolTip.Tip="{locale:Locale GameListContextMenuOpenModsDirectoryToolTip}" /> - <MenuItem - Command="{Binding OpenSdModsDirectory}" - Header="{locale:Locale GameListContextMenuOpenSdModsDirectory}" - ToolTip.Tip="{locale:Locale GameListContextMenuOpenSdModsDirectoryToolTip}" /> - <Separator /> - <MenuItem Header="{locale:Locale GameListContextMenuCacheManagement}"> - <MenuItem - Command="{Binding PurgePtcCache}" - Header="{locale:Locale GameListContextMenuCacheManagementPurgePptc}" - ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementPurgePptcToolTip}" /> - <MenuItem - Command="{Binding PurgeShaderCache}" - Header="{locale:Locale GameListContextMenuCacheManagementPurgeShaderCache}" - ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementPurgeShaderCacheToolTip}" /> - <MenuItem - Command="{Binding OpenPtcDirectory}" - Header="{locale:Locale GameListContextMenuCacheManagementOpenPptcDirectory}" - ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementOpenPptcDirectoryToolTip}" /> - <MenuItem - Command="{Binding OpenShaderCacheDirectory}" - Header="{locale:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectory}" - ToolTip.Tip="{locale:Locale GameListContextMenuCacheManagementOpenShaderCacheDirectoryToolTip}" /> - </MenuItem> - <MenuItem Header="{locale:Locale GameListContextMenuExtractData}"> - <MenuItem - Command="{Binding ExtractExeFs}" - Header="{locale:Locale GameListContextMenuExtractDataExeFS}" - ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataExeFSToolTip}" /> - <MenuItem - Command="{Binding ExtractRomFs}" - Header="{locale:Locale GameListContextMenuExtractDataRomFS}" - ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataRomFSToolTip}" /> - <MenuItem - Command="{Binding ExtractLogo}" - Header="{locale:Locale GameListContextMenuExtractDataLogo}" - ToolTip.Tip="{locale:Locale GameListContextMenuExtractDataLogoToolTip}" /> - </MenuItem> - </MenuFlyout> - </UserControl.Resources> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - <ListBox - Grid.Row="0" - Padding="8" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - ContextFlyout="{StaticResource GameContextMenu}" - DoubleTapped="GameList_DoubleTapped" - Items="{Binding AppsObservableList}" - SelectionChanged="GameList_SelectionChanged"> - <ListBox.ItemsPanel> - <ItemsPanelTemplate> - <flex:FlexPanel - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - AlignContent="FlexStart" - JustifyContent="Center" /> - </ItemsPanelTemplate> - </ListBox.ItemsPanel> - <ListBox.Styles> - <Style Selector="ListBoxItem"> - <Setter Property="Margin" Value="5" /> - <Setter Property="CornerRadius" Value="4" /> - </Style> - <Style Selector="ListBoxItem:selected /template/ Border#SelectionIndicator"> - <Setter Property="MinHeight" Value="{Binding $parent[UserControl].DataContext.GridItemSelectorSize}" /> - </Style> - </ListBox.Styles> - <ListBox.ItemTemplate> - <DataTemplate> - <Grid> - <Border - Margin="10" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - Classes.huge="{Binding $parent[UserControl].DataContext.IsGridHuge}" - Classes.large="{Binding $parent[UserControl].DataContext.IsGridLarge}" - Classes.normal="{Binding $parent[UserControl].DataContext.IsGridMedium}" - Classes.small="{Binding $parent[UserControl].DataContext.IsGridSmall}" - ClipToBounds="True" - CornerRadius="4"> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - <Image - Grid.Row="0" - HorizontalAlignment="Stretch" - VerticalAlignment="Top" - Source="{Binding Icon, Converter={StaticResource ByteImage}}" /> - <Panel - Grid.Row="1" - Height="50" - Margin="0 10 0 0" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - IsVisible="{Binding $parent[UserControl].DataContext.ShowNames}"> - <TextBlock - HorizontalAlignment="Stretch" - VerticalAlignment="Center" - Text="{Binding TitleName}" - TextAlignment="Center" - TextWrapping="Wrap" /> - </Panel> - </Grid> - </Border> - <ui:SymbolIcon - Margin="5,5,0,0" - HorizontalAlignment="Left" - VerticalAlignment="Top" - FontSize="16" - Foreground="{DynamicResource SystemAccentColor}" - IsVisible="{Binding Favorite}" - Symbol="StarFilled" /> - </Grid> - </DataTemplate> - </ListBox.ItemTemplate> - </ListBox> - </Grid> -</UserControl>
\ No newline at end of file |
