Skip to content

Commit 53d4adc

Browse files
authored
Merge branch 'files-community:main' into builtin-converters
2 parents 64f6fd8 + 7a562b8 commit 53d4adc

File tree

8 files changed

+41
-8
lines changed

8 files changed

+41
-8
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Files Community
3+
Copyright (c) 2018 - present Files Community
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/Files.App.SaveDialog/Files.App.SaveDialog.Win32.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
23
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
34
<ItemGroup Label="ProjectConfigurations">
45
<ProjectConfiguration Include="Debug|arm64">
@@ -472,4 +473,4 @@
472473

473474
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
474475

475-
</Project>
476+
</Project>

src/Files.App.Server/Files.App.Server.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
2+
<Project Sdk="Microsoft.NET.Sdk">
23

34
<PropertyGroup>
45
<OutputType>WinExe</OutputType>

src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
x:Name="RecentFilesListView"
3838
HorizontalAlignment="Stretch"
3939
VerticalAlignment="Stretch"
40+
CanDragItems="True"
41+
DragItemsStarting="RecentFilesListView_DragItemsStarting"
4042
IsItemClickEnabled="True"
4143
IsRightTapEnabled="True"
4244
ItemClick="RecentFilesListView_ItemClick"

src/Files.App/UserControls/Widgets/RecentFilesWidget.xaml.cs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
using Microsoft.UI.Xaml.Controls;
55
using Microsoft.UI.Xaml.Input;
6+
using Windows.ApplicationModel.DataTransfer;
7+
using Windows.Storage;
68

79
namespace Files.App.UserControls.Widgets
810
{
911
/// <summary>
10-
/// Represents group of control displays a list of recent folders with <see cref="WidgetFolderCardItem"/>.
12+
/// Represents a control that displays a list of recent files with <see cref="WidgetFolderCardItem"/>.
1113
/// </summary>
1214
public sealed partial class RecentFilesWidget : UserControl
1315
{
@@ -30,5 +32,32 @@ private void RecentFilesListView_RightTapped(object sender, RightTappedRoutedEve
3032
{
3133
ViewModel.BuildItemContextMenu(e.OriginalSource, e);
3234
}
35+
36+
private async void RecentFilesListView_DragItemsStarting(object sender, DragItemsStartingEventArgs e)
37+
{
38+
var item = e.Items.OfType<RecentItem>().First();
39+
var storageItems = new List<IStorageItem>();
40+
41+
try
42+
{
43+
var file = await StorageFile.GetFileFromPathAsync(item.Path);
44+
if (file != null)
45+
storageItems.Add(file);
46+
}
47+
catch
48+
{
49+
e.Cancel = true;
50+
}
51+
52+
if (storageItems.Count > 0)
53+
{
54+
// Create a new data package and set the storage items
55+
DataPackage dataPackage = new DataPackage();
56+
dataPackage.SetStorageItems(storageItems);
57+
e.Data.SetDataProvider(StandardDataFormats.StorageItems, request => request.SetData(storageItems));
58+
59+
e.Data.RequestedOperation = DataPackageOperation.Move | DataPackageOperation.Copy | DataPackageOperation.Link;
60+
}
61+
}
3362
}
3463
}

src/Files.App/ViewModels/UserControls/Previews/ImagePreviewViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public ImagePreviewViewModel(ListedItem item)
2626

2727
// TODO: Use existing helper mothods
2828
public static bool ContainsExtension(string extension)
29-
=> extension is ".png" or ".jpg" or ".jpeg" or ".bmp" or ".gif" or ".tiff" or ".ico" or ".webp";
29+
=> extension is ".png" or ".jpg" or ".jpeg" or ".bmp" or ".gif" or ".tiff" or ".ico" or ".webp" or ".jxr";
3030

3131
public override async Task<List<FileProperty>> LoadPreviewAndDetailsAsync()
3232
{

src/Files.Core.SourceGenerator/Extensions/StringBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal static StringBuilder AppendAutoGeneratedHeader(this StringBuilder sb, s
3030
/// <returns>The <see cref="StringBuilder"/> instance with the appended license header.</returns>
3131
internal static StringBuilder AppendLicenceHeader(this StringBuilder sb)
3232
{
33-
return sb.AppendLine($"// Copyright (c) {DateTime.Now.Year} Files Community")
33+
return sb.AppendLine($"// Copyright (c) Files Community")
3434
.AppendLine("// Licensed under the MIT License.");
3535
}
3636

src/Files.Shared/Helpers/FileExtensionHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static bool HasExtension(string? filePathToCheck, params string[] extensi
3232
/// <returns><c>true</c> if the fileExtensionToCheck is an image; otherwise, <c>false</c>.</returns>
3333
public static bool IsImageFile(string? fileExtensionToCheck)
3434
{
35-
return HasExtension(fileExtensionToCheck, ".png", ".bmp", ".jpg", ".jpeg", ".jfif", ".gif", ".tiff", ".tif", ".webp");
35+
return HasExtension(fileExtensionToCheck, ".png", ".bmp", ".jpg", ".jpeg", ".jfif", ".gif", ".tiff", ".tif", ".webp", ".jxr");
3636
}
3737

3838
/// <summary>
@@ -42,7 +42,7 @@ public static bool IsImageFile(string? fileExtensionToCheck)
4242
/// <returns><c>true</c> if the fileExtensionToCheck is an image; otherwise, <c>false</c>.</returns>
4343
public static bool IsCompatibleToSetAsWindowsWallpaper(string? fileExtensionToCheck)
4444
{
45-
return HasExtension(fileExtensionToCheck, ".png", ".bmp", ".jpg", ".jpeg", ".jfif", ".gif", ".tiff", ".tif");
45+
return HasExtension(fileExtensionToCheck, ".png", ".bmp", ".jpg", ".jpeg", ".jfif", ".gif", ".tiff", ".tif", ".jxr");
4646
}
4747

4848
/// <summary>

0 commit comments

Comments
 (0)