Skip to content

armgit / Filee

Public Imported from GitHub
0

Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.

feat(home): add double-click file selector on drop zone alongside drag-and-drop

gtxPrime3aba4e1301a9
diff --git a/src/Filee.App/Assets/i18n/ar.json b/src/Filee.App/Assets/i18n/ar.json
index 7ee866f4..01a98f0b 100644
--- a/src/Filee.App/Assets/i18n/ar.json
+++ b/src/Filee.App/Assets/i18n/ar.json
@@ -23,6 +23,7 @@
"close.dont_ask": "عدم السؤال مجددًا",
"home.title": "الرئيسية",
"home.drop_title": "أفلت الملفات هنا",
+ "home.drop_select": "انقر نقرًا مزدوجًا لتحديد الملفات",
"home.drop_hint": "أو اضغط باستمرار على {0} أثناء سحب الملفات في مستكشف الملفات. يفتح شريط الأدوات الدائري عند المؤشر.",
"home.drop_hint_macos": "أو اضغط باستمرار على {0} أثناء سحب الملفات في Finder. يفتح شريط الأدوات الدائري عند المؤشر.",
"home.drop_hint_linux": "أو اضغط باستمرار على {0} أثناء سحب الملفات في مدير الملفات. يفتح شريط الأدوات الدائري عند المؤشر.",
diff --git a/src/Filee.App/Assets/i18n/en.json b/src/Filee.App/Assets/i18n/en.json
index d6024c30..66326b74 100644
--- a/src/Filee.App/Assets/i18n/en.json
+++ b/src/Filee.App/Assets/i18n/en.json
@@ -26,6 +26,7 @@
"home.title": "Home",
"home.drop_title": "Drop files here",
+ "home.drop_select": "Double-click to select files",
"home.drop_hint": "Or hold {0} while dragging files in Explorer. The donut toolbar opens at your cursor.",
"home.drop_hint_macos": "Or hold {0} while dragging files in Finder. The donut toolbar opens at your cursor.",
"home.drop_hint_linux": "Or hold {0} while dragging files in your file manager. The donut toolbar opens at your cursor.",
diff --git a/src/Filee.App/Assets/i18n/es.json b/src/Filee.App/Assets/i18n/es.json
index 89007a3e..0d4d97ab 100644
--- a/src/Filee.App/Assets/i18n/es.json
+++ b/src/Filee.App/Assets/i18n/es.json
@@ -23,6 +23,7 @@
"close.dont_ask": "No volver a preguntar",
"home.title": "Inicio",
"home.drop_title": "Suelta archivos aquí",
+ "home.drop_select": "Doble clic para seleccionar archivos",
"home.drop_hint": "O mantén {0} mientras arrastras archivos en el Explorador. El menú circular se abre donde esté el cursor.",
"home.drop_hint_macos": "O mantén {0} mientras arrastras archivos en Finder. El menú circular se abre donde esté el cursor.",
"home.drop_hint_linux": "O mantén {0} mientras arrastras archivos en tu gestor de archivos. El menú circular se abre donde esté el cursor.",
diff --git a/src/Filee.App/Assets/i18n/fr.json b/src/Filee.App/Assets/i18n/fr.json
index 32197851..97079521 100644
--- a/src/Filee.App/Assets/i18n/fr.json
+++ b/src/Filee.App/Assets/i18n/fr.json
@@ -26,6 +26,7 @@
"home.title": "Accueil",
"home.drop_title": "Déposez des fichiers ici",
+ "home.drop_select": "Double-cliquez pour sélectionner des fichiers",
"home.drop_hint": "Ou maintenez {0} en glissant des fichiers dans l'Explorateur. Le menu circulaire s'ouvre sous le curseur.",
"home.drop_hint_macos": "Ou maintenez {0} en glissant des fichiers dans le Finder. Le menu circulaire s'ouvre sous le curseur.",
"home.drop_hint_linux": "Ou maintenez {0} en glissant des fichiers dans votre gestionnaire de fichiers. Le menu circulaire s'ouvre sous le curseur.",
diff --git a/src/Filee.App/Assets/i18n/hi.json b/src/Filee.App/Assets/i18n/hi.json
index dde78607..e43d78fa 100644
--- a/src/Filee.App/Assets/i18n/hi.json
+++ b/src/Filee.App/Assets/i18n/hi.json
@@ -23,6 +23,7 @@
"close.dont_ask": "दोबारा न पूछें",
"home.title": "होम",
"home.drop_title": "फ़ाइलें यहाँ छोड़ें",
+ "home.drop_select": "फ़ाइलें चुनने के लिए डबल-क्लिक करें",
"home.drop_hint": "या Explorer में फ़ाइलें खींचते समय {0} दबाए रखें। डोनट टूलबार आपके कर्सर पर खुलेगा।",
"home.drop_hint_macos": "या Finder में फ़ाइलें खींचते समय {0} दबाए रखें। डोनट टूलबार आपके कर्सर पर खुलेगा।",
"home.drop_hint_linux": "या अपने फ़ाइल मैनेजर में फ़ाइलें खींचते समय {0} दबाए रखें। डोनट टूलबार आपके कर्सर पर खुलेगा।",
diff --git a/src/Filee.App/Assets/i18n/ja.json b/src/Filee.App/Assets/i18n/ja.json
index afc5f5d3..88a48eb3 100644
--- a/src/Filee.App/Assets/i18n/ja.json
+++ b/src/Filee.App/Assets/i18n/ja.json
@@ -23,6 +23,7 @@
"close.dont_ask": "次回から確認しない",
"home.title": "ホーム",
"home.drop_title": "ここにファイルをドロップ",
+ "home.drop_select": "ダブルクリックしてファイルを選択",
"home.drop_hint": "または、{0}を押しながら\nエクスプローラーでファイルをドラッグしてください。\nカーソル位置にドーナツメニューが開きます。",
"home.drop_hint_macos": "または、{0}を押しながら\nFinderでファイルをドラッグしてください。\nカーソル位置にドーナツメニューが開きます。",
"home.drop_hint_linux": "または、{0}を押しながら\nファイルマネージャーでファイルをドラッグしてください。\nカーソル位置にドーナツメニューが開きます。",
diff --git a/src/Filee.App/Assets/i18n/ko.json b/src/Filee.App/Assets/i18n/ko.json
index 115bfc7e..9eba8a04 100644
--- a/src/Filee.App/Assets/i18n/ko.json
+++ b/src/Filee.App/Assets/i18n/ko.json
@@ -26,6 +26,7 @@
"home.title": "홈",
"home.drop_title": "여기에 파일을 놓으세요",
+ "home.drop_select": "더블클릭하여 파일 선택",
"home.drop_hint": "또는 탐색기에서 {0} 키를 누른 채 파일을 드래그하면 커서 위치에 원형 툴바가 열려요.",
"home.drop_hint_macos": "또는 Finder에서 {0} 키를 누른 채 파일을 드래그하면 커서 위치에 원형 툴바가 열려요.",
"home.drop_hint_linux": "또는 파일 관리자에서 {0} 키를 누른 채 파일을 드래그하면 커서 위치에 원형 툴바가 열려요.",
diff --git a/src/Filee.App/Assets/i18n/pl.json b/src/Filee.App/Assets/i18n/pl.json
index 2e2da36b..b22ed2e6 100644
--- a/src/Filee.App/Assets/i18n/pl.json
+++ b/src/Filee.App/Assets/i18n/pl.json
@@ -26,6 +26,7 @@
"home.title": "Start",
"home.drop_title": "Upuść pliki tutaj",
+ "home.drop_select": "Kliknij dwukrotnie, aby wybrać pliki",
"home.drop_hint": "Albo przytrzymaj {0}, przeciągając pliki w Eksploratorze. Pasek-pierścień otworzy się przy kursorze.",
"home.drop_hint_macos": "Albo przytrzymaj {0}, przeciągając pliki w Finderze. Pasek-pierścień otworzy się przy kursorze.",
"home.drop_hint_linux": "Albo przytrzymaj {0}, przeciągając pliki w menedżerze plików. Pasek-pierścień otworzy się przy kursorze.",
diff --git a/src/Filee.App/Assets/i18n/pt-BR.json b/src/Filee.App/Assets/i18n/pt-BR.json
index 0b7cd7cd..93b31174 100644
--- a/src/Filee.App/Assets/i18n/pt-BR.json
+++ b/src/Filee.App/Assets/i18n/pt-BR.json
@@ -26,6 +26,7 @@
"home.title": "Início",
"home.drop_title": "Solte os arquivos aqui",
+ "home.drop_select": "Clique duas vezes para selecionar arquivos",
"home.drop_hint": "Ou segure {0} ao arrastar arquivos no Explorador. O menu circular abre no cursor.",
"home.drop_hint_macos": "Ou segure {0} ao arrastar arquivos no Finder. O menu circular abre no cursor.",
"home.drop_hint_linux": "Ou segure {0} ao arrastar arquivos no gerenciador de arquivos. O menu circular abre no cursor.",
diff --git a/src/Filee.App/Assets/i18n/ru.json b/src/Filee.App/Assets/i18n/ru.json
index 3eb526c7..083cf0fe 100644
--- a/src/Filee.App/Assets/i18n/ru.json
+++ b/src/Filee.App/Assets/i18n/ru.json
@@ -26,6 +26,7 @@
"home.title": "Главная",
"home.drop_title": "Перетащите файлы сюда",
+ "home.drop_select": "Дважды щелкните, чтобы выбрать файлы",
"home.drop_hint": "Или зажмите {0}, перетаскивая файлы в Проводнике. Круговое меню откроется у курсора.",
"home.drop_hint_macos": "Или зажмите {0}, перетаскивая файлы в Finder. Круговое меню откроется у курсора.",
"home.drop_hint_linux": "Или зажмите {0}, перетаскивая файлы в файловом менеджере. Круговое меню откроется у курсора.",
diff --git a/src/Filee.App/Assets/i18n/zh-CN.json b/src/Filee.App/Assets/i18n/zh-CN.json
index 6247a2b0..77cae095 100644
--- a/src/Filee.App/Assets/i18n/zh-CN.json
+++ b/src/Filee.App/Assets/i18n/zh-CN.json
@@ -26,6 +26,7 @@
"home.title": "首页",
"home.drop_title": "将文件拖放到这里",
+ "home.drop_select": "双击选择文件",
"home.drop_hint": "或在资源管理器中按住 {0} 拖动文件,环形工具栏会在光标处打开。",
"home.drop_hint_macos": "或在访达中按住 {0} 拖动文件,环形工具栏会在光标处打开。",
"home.drop_hint_linux": "或在文件管理器中按住 {0} 拖动文件,环形工具栏会在光标处打开。",
diff --git a/src/Filee.App/Assets/i18n/zh-TW.json b/src/Filee.App/Assets/i18n/zh-TW.json
index d1a197a1..bd24176a 100644
--- a/src/Filee.App/Assets/i18n/zh-TW.json
+++ b/src/Filee.App/Assets/i18n/zh-TW.json
@@ -26,6 +26,7 @@
"home.title": "首頁",
"home.drop_title": "將檔案拖放到這裡",
+ "home.drop_select": "按兩下選取檔案",
"home.drop_hint": "或在檔案總管中按住 {0} 拖曳檔案,環形工具列會在游標處開啟。",
"home.drop_hint_macos": "或在 Finder 中按住 {0} 拖曳檔案,環形工具列會在游標處開啟。",
"home.drop_hint_linux": "或在檔案管理員中按住 {0} 拖曳檔案,環形工具列會在游標處開啟。",
diff --git a/src/Filee.App/Views/Pages/HomePage.axaml b/src/Filee.App/Views/Pages/HomePage.axaml
index e1eb35d9..359336e8 100644
--- a/src/Filee.App/Views/Pages/HomePage.axaml
+++ b/src/Filee.App/Views/Pages/HomePage.axaml
@@ -54,8 +54,9 @@
</DockPanel>
</Border>
- <!-- Drop zone: files dropped here open the donut toolbar at the cursor. -->
+ <!-- Drop zone: files dropped here open the donut toolbar at the cursor. Double-click opens file selector. -->
<Border x:Name="DropZone" DragDrop.AllowDrop="True" MinHeight="220"
+ Cursor="Hand" ToolTip.Tip="{DynamicResource home.drop_select}"
Background="{DynamicResource AccentFaintBrush}" BorderBrush="{DynamicResource AccentSoftBrush}"
BorderThickness="2" CornerRadius="{DynamicResource SoftRadiusLarge}" Padding="24">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="10">
diff --git a/src/Filee.App/Views/Pages/HomePage.axaml.cs b/src/Filee.App/Views/Pages/HomePage.axaml.cs
index 8980e269..cf401371 100644
--- a/src/Filee.App/Views/Pages/HomePage.axaml.cs
+++ b/src/Filee.App/Views/Pages/HomePage.axaml.cs
@@ -4,7 +4,10 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
+using Avalonia.Interactivity;
+using Avalonia.Platform.Storage;
using Filee.App.Services;
+using Filee.Core.Localization;
using Microsoft.Extensions.Logging;
namespace Filee.App.Views.Pages;
@@ -20,6 +23,7 @@ public partial class HomePage : UserControl
public HomePage()
{
InitializeComponent();
+ DropZone.DoubleTapped += OnDropZoneDoubleTapped;
DragDrop.AddDragEnterHandler(DropZone, (_, e) =>
{
DropZone.Classes.Add("over");
@@ -34,6 +38,36 @@ public partial class HomePage : UserControl
DragDrop.AddDropHandler(DropZone, OnDrop);
}
+ private async void OnDropZoneDoubleTapped(object? sender, TappedEventArgs e)
+ {
+ e.Handled = true;
+ if (TopLevel.GetTopLevel(this) is not { } top)
+ return;
+
+ var loc = AppHost.Get<ILocalizer>();
+ var files = await top.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
+ {
+ AllowMultiple = true,
+ Title = loc["home.drop_title"],
+ });
+
+ var paths = files
+ .Select(f => f.TryGetLocalPath())
+ .Where(p => !string.IsNullOrEmpty(p))
+ .Select(p => p!)
+ .ToList();
+
+ if (paths.Count == 0)
+ return;
+
+ var dropZonePos = e.GetPosition(DropZone);
+ var targetPos = new Rect(0, 0, DropZone.Bounds.Width, DropZone.Bounds.Height).Contains(dropZonePos)
+ ? dropZonePos
+ : new Point(DropZone.Bounds.Width / 2, DropZone.Bounds.Height / 2);
+ var screenPoint = DropZone.PointToScreen(targetPos);
+ AppHost.Get<RadialController>().ShowForFiles(screenPoint.X, screenPoint.Y, paths);
+ }
+
private void OnDrop(object? sender, DragEventArgs e)
{
DropZone.Classes.Remove("over");