Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fixed issue with selecting multiple items in column layout #12515

Merged
merged 5 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/Files.App/Views/LayoutModes/ColumnViewBase.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,13 @@ protected override void FileList_SelectionChanged(object sender, SelectionChange
var presenter = openedFolderPresenter.FindDescendant<Grid>()!;
presenter!.Background = this.Resources["ListViewItemBackgroundSelected"] as SolidColorBrush;
}

if (SelectedItems?.Count > 1 || SelectedItem?.PrimaryItemAttribute is StorageItemTypes.File)
{
var currentBladeIndex = (ParentShellPageInstance is ColumnShellPage associatedColumnShellPage) ? associatedColumnShellPage.ColumnParams.Column : 0;
this.FindAscendant<ColumnViewBrowser>()?.DismissOtherBlades(currentBladeIndex);
ClearOpenedFolderSelectionIndicator();
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
}
}

private void FileList_RightTapped(object sender, RightTappedRoutedEventArgs e)
Expand All @@ -237,7 +244,12 @@ private void HandleRightClick(object sender, RightTappedRoutedEventArgs e)

private void FileList_PreviewKeyUp(object sender, KeyRoutedEventArgs e)
{
if (IsRenamingItem || !(e.Key is VirtualKey.Up or VirtualKey.Down or VirtualKey.Right))
if
(
IsRenamingItem ||
!(e.Key is VirtualKey.Up or VirtualKey.Down or VirtualKey.Right) ||
SelectedItems?.Count > 1
)
return;

// Open selected directory
Expand All @@ -247,7 +259,12 @@ private void FileList_PreviewKeyUp(object sender, KeyRoutedEventArgs e)

protected override async void FileList_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
{
if (ParentShellPageInstance is null || IsRenamingItem)
if
(
ParentShellPageInstance is null ||
IsRenamingItem ||
SelectedItems?.Count > 1
)
return;

var ctrlPressed = InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Control).HasFlag(CoreVirtualKeyStates.Down);
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Views/LayoutModes/ColumnViewBrowser.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private void DismissOtherBlades(BladeItem blade)
DismissOtherBlades(ColumnHost.ActiveBlades.IndexOf(blade));
}

private void DismissOtherBlades(int index)
public void DismissOtherBlades(int index)
{
if (index >= 0)
{
Expand Down