From e69bbf8b19e6bc17d390db6e111c79be4ec10fd8 Mon Sep 17 00:00:00 2001 From: lincube Date: Wed, 8 Apr 2026 02:09:17 +0800 Subject: [PATCH] =?UTF-8?q?feat.=E5=8A=A0=E5=85=A5=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 +- .../ComponentSystem/BuiltInComponentIds.cs | 1 + .../ComponentSystem/ComponentRegistry.cs | 10 + .../Models/ComponentSettingsSnapshot.cs | 19 + .../DesktopComponentEditorRegistryFactory.cs | 7 +- .../ShortcutComponentEditor.axaml | 86 ++++ .../ShortcutComponentEditor.axaml.cs | 149 +++++++ .../DesktopComponentRuntimeRegistry.cs | 6 +- .../Views/Components/ShortcutWidget.axaml | 38 ++ .../Views/Components/ShortcutWidget.axaml.cs | 369 ++++++++++++++++++ 10 files changed, 688 insertions(+), 3 deletions(-) create mode 100644 LanMountainDesktop/Views/ComponentEditors/ShortcutComponentEditor.axaml create mode 100644 LanMountainDesktop/Views/ComponentEditors/ShortcutComponentEditor.axaml.cs create mode 100644 LanMountainDesktop/Views/Components/ShortcutWidget.axaml create mode 100644 LanMountainDesktop/Views/Components/ShortcutWidget.axaml.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 285bcd9..531cc75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,11 @@ ## [0.8.3.1] - 2026-04-08 ### 新增 (Added) -- 初始化更新日志文档,为后续版本发布建立基础 +- ✨ **快捷方式组件**: 新增快捷方式组件,可在阑山桌面内便捷打开系统应用与文件 + - 支持创建快捷方式,统一管理应用和文件 + - 提供单击打开和双击打开两种交互模式 + - 支持配置是否显示背景 +- 📝 初始化更新日志文档,为后续版本发布建立基础 ### 变更 (Changed) - 无 diff --git a/LanMountainDesktop/ComponentSystem/BuiltInComponentIds.cs b/LanMountainDesktop/ComponentSystem/BuiltInComponentIds.cs index 022b5a6..6050563 100644 --- a/LanMountainDesktop/ComponentSystem/BuiltInComponentIds.cs +++ b/LanMountainDesktop/ComponentSystem/BuiltInComponentIds.cs @@ -46,4 +46,5 @@ public static class BuiltInComponentIds public const string DesktopZhiJiaoHub = "DesktopZhiJiaoHub"; public const string DesktopFileManager = "DesktopFileManager"; public const string DesktopNotificationBox = "DesktopNotificationBox"; + public const string DesktopShortcut = "DesktopShortcut"; } diff --git a/LanMountainDesktop/ComponentSystem/ComponentRegistry.cs b/LanMountainDesktop/ComponentSystem/ComponentRegistry.cs index 7a784b4..a62fa87 100644 --- a/LanMountainDesktop/ComponentSystem/ComponentRegistry.cs +++ b/LanMountainDesktop/ComponentSystem/ComponentRegistry.cs @@ -420,6 +420,16 @@ public sealed class ComponentRegistry MinHeightCells: 2, AllowStatusBarPlacement: false, AllowDesktopPlacement: true, + ResizeMode: DesktopComponentResizeMode.Free), + new DesktopComponentDefinition( + BuiltInComponentIds.DesktopShortcut, + "快捷方式", + "App", + "Launcher", + MinWidthCells: 1, + MinHeightCells: 1, + AllowStatusBarPlacement: false, + AllowDesktopPlacement: true, ResizeMode: DesktopComponentResizeMode.Free) }; diff --git a/LanMountainDesktop/Models/ComponentSettingsSnapshot.cs b/LanMountainDesktop/Models/ComponentSettingsSnapshot.cs index 0a2fd97..efb1d5b 100644 --- a/LanMountainDesktop/Models/ComponentSettingsSnapshot.cs +++ b/LanMountainDesktop/Models/ComponentSettingsSnapshot.cs @@ -123,6 +123,25 @@ public sealed class ComponentSettingsSnapshot #endregion + #region Shortcut Component Settings (快捷方式组件设置) + + /// + /// 快捷方式目标路径 + /// + public string? ShortcutTargetPath { get; set; } + + /// + /// 点击模式:Single(单击打开) 或 Double(双击打开) + /// + public string ShortcutClickMode { get; set; } = "Double"; + + /// + /// 是否透明背景 + /// + public bool ShortcutTransparentBackground { get; set; } = false; + + #endregion + public ComponentSettingsSnapshot Clone() { var clone = (ComponentSettingsSnapshot)MemberwiseClone(); diff --git a/LanMountainDesktop/Services/DesktopComponentEditorRegistryFactory.cs b/LanMountainDesktop/Services/DesktopComponentEditorRegistryFactory.cs index 6bd01be..f2fd5b6 100644 --- a/LanMountainDesktop/Services/DesktopComponentEditorRegistryFactory.cs +++ b/LanMountainDesktop/Services/DesktopComponentEditorRegistryFactory.cs @@ -272,7 +272,12 @@ public static class DesktopComponentEditorRegistryFactory BuiltInComponentIds.DesktopNotificationBox, context => new NotificationBoxComponentEditor(context), preferredWidth: 480d, - preferredHeight: 520d) + preferredHeight: 520d), + [BuiltInComponentIds.DesktopShortcut] = new( + BuiltInComponentIds.DesktopShortcut, + context => new ShortcutComponentEditor(context), + preferredWidth: 420d, + preferredHeight: 400d) }; foreach (var componentId in GetBuiltInDesktopComponentIds(componentRegistry)) diff --git a/LanMountainDesktop/Views/ComponentEditors/ShortcutComponentEditor.axaml b/LanMountainDesktop/Views/ComponentEditors/ShortcutComponentEditor.axaml new file mode 100644 index 0000000..d448e99 --- /dev/null +++ b/LanMountainDesktop/Views/ComponentEditors/ShortcutComponentEditor.axaml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + +