mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-07 05:16:26 +02:00
UI: Only allow right click to create a context menu if a game is selected.
This commit is contained in:
parent
bd29f658b1
commit
4135d74e4d
5 changed files with 65 additions and 24 deletions
|
@ -15,7 +15,6 @@
|
|||
x:DataType="viewModels:MainWindowViewModel">
|
||||
<UserControl.Resources>
|
||||
<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
|
||||
<controls:ApplicationContextMenu x:Key="ApplicationContextMenu" />
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
|
@ -26,10 +25,10 @@
|
|||
Padding="8"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
ContextFlyout="{StaticResource ApplicationContextMenu}"
|
||||
SelectedItem="{Binding GridSelectedApplication}"
|
||||
ContextFlyout="{Binding GridAppContextMenu}"
|
||||
DoubleTapped="GameList_DoubleTapped"
|
||||
ItemsSource="{Binding AppsObservableList}"
|
||||
SelectionChanged="GameList_SelectionChanged">
|
||||
ItemsSource="{Binding AppsObservableList}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel
|
||||
|
|
|
@ -26,11 +26,5 @@ namespace Ryujinx.Ava.UI.Controls
|
|||
if (sender is ListBox { SelectedItem: ApplicationData selected })
|
||||
RaiseEvent(new ApplicationOpenedEventArgs(selected, ApplicationOpenedEvent));
|
||||
}
|
||||
|
||||
public void GameList_SelectionChanged(object sender, SelectionChangedEventArgs args)
|
||||
{
|
||||
if (DataContext is MainWindowViewModel viewModel && sender is ListBox { SelectedItem: ApplicationData selected })
|
||||
viewModel.GridSelectedApplication = selected;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:converters="clr-namespace:Avalonia.Data.Converters;assembly=Avalonia.Base"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Focusable="True"
|
||||
|
@ -16,7 +15,6 @@
|
|||
x:DataType="viewModels:MainWindowViewModel">
|
||||
<UserControl.Resources>
|
||||
<helpers:BitmapArrayValueConverter x:Key="ByteImage" />
|
||||
<controls:ApplicationContextMenu x:Key="ApplicationContextMenu" />
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
|
@ -28,10 +26,10 @@
|
|||
Padding="8"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
ContextFlyout="{StaticResource ApplicationContextMenu}"
|
||||
SelectedItem="{Binding ListSelectedApplication}"
|
||||
ContextFlyout="{Binding ListAppContextMenu}"
|
||||
DoubleTapped="GameList_DoubleTapped"
|
||||
ItemsSource="{Binding AppsObservableList}"
|
||||
SelectionChanged="GameList_SelectionChanged">
|
||||
ItemsSource="{Binding AppsObservableList}">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel
|
||||
|
|
|
@ -30,12 +30,6 @@ namespace Ryujinx.Ava.UI.Controls
|
|||
RaiseEvent(new ApplicationOpenedEventArgs(selected, ApplicationOpenedEvent));
|
||||
}
|
||||
|
||||
public void GameList_SelectionChanged(object sender, SelectionChangedEventArgs args)
|
||||
{
|
||||
if (DataContext is MainWindowViewModel viewModel && sender is ListBox { SelectedItem: ApplicationData selected })
|
||||
viewModel.ListSelectedApplication = selected;
|
||||
}
|
||||
|
||||
private async void IdString_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is not MainWindowViewModel mwvm)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue