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

More work on Shelf #16728

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Formatting
  • Loading branch information
d2dyno1 committed Feb 15, 2025
commit 6875bdb6957217207bc4e50561429198d06fdd27
22 changes: 11 additions & 11 deletions src/Files.App/UserControls/Pane/ShelfPane.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@ private async void Shelf_Drop(object sender, DragEventArgs e)
}
}

private void ListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
{
var apidl = SafetyExtensions.IgnoreExceptions(() => e.Items
.Cast<ShelfItem>()
.Select(x => new ShellItem(x.Inner.Id).PIDL)
.ToArray());
private void ListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
{
var apidl = SafetyExtensions.IgnoreExceptions(() => e.Items
.Cast<ShelfItem>()
.Select(x => new ShellItem(x.Inner.Id).PIDL)
.ToArray());

if (apidl is null)
return;
if (apidl is null)
return;

if (!Shell32.SHGetDesktopFolder(out var pDesktop).Succeeded)
if (!Shell32.SHGetDesktopFolder(out var pDesktop).Succeeded)
return;

if (!Shell32.SHGetIDListFromObject(pDesktop, out var pDesktopPidl).Succeeded)
if (!Shell32.SHGetIDListFromObject(pDesktop, out var pDesktopPidl).Succeeded)
return;

e.Data.Properties["Files_ActionBinder"] = "Files_ShelfBinder";
e.Data.Properties["Files_ActionBinder"] = "Files_ShelfBinder";
if (!Shell32.SHCreateDataObject(pDesktopPidl, apidl, null, out var ppDataObject).Succeeded)
return;

Expand Down
8 changes: 4 additions & 4 deletions src/Files.App/ViewModels/Layouts/BaseLayoutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public async Task DragOverAsync(DragEventArgs e)
{
// As long as one file doesn't already belong to this folder
if (_associatedInstance.InstanceViewModel.IsPageTypeSearchResults || draggedItems.Any() &&
draggedItems.AreItemsAlreadyInFolder(_associatedInstance.ShellViewModel.WorkingDirectory))
draggedItems.AreItemsAlreadyInFolder(_associatedInstance.ShellViewModel.WorkingDirectory))
{
e.AcceptedOperation = DataPackageOperation.None;
}
Expand Down Expand Up @@ -157,9 +157,9 @@ public async Task DragOverAsync(DragEventArgs e)
e.AcceptedOperation = DataPackageOperation.Move | DataPackageOperation.Copy;
}
else if (draggedItems.Any(x =>
x.Item is ZipStorageFile ||
x.Item is ZipStorageFolder) ||
ZipStorageFolder.IsZipPath(pwd))
x.Item is ZipStorageFile ||
x.Item is ZipStorageFolder) ||
ZipStorageFolder.IsZipPath(pwd))
{
e.DragUIOverride.Caption = string.Format("CopyToFolderCaptionText".GetLocalizedResource(), folderName);
e.AcceptedOperation = DataPackageOperation.Copy;
Expand Down
Loading