From 87f62b288b6f440062381b67e839902aae207419 Mon Sep 17 00:00:00 2001 From: loner <2788892716@qq.com> Date: Wed, 19 Nov 2025 07:06:00 +0800 Subject: [PATCH] feat(launcher): UI improvements for clipboard preview window --- Modules/Panels/Launcher/ClipboardPreview.qml | 14 ++------------ Modules/Panels/Launcher/Launcher.qml | 12 +++++++++--- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Modules/Panels/Launcher/ClipboardPreview.qml b/Modules/Panels/Launcher/ClipboardPreview.qml index 12254afa..3c8e188a 100644 --- a/Modules/Panels/Launcher/ClipboardPreview.qml +++ b/Modules/Panels/Launcher/ClipboardPreview.qml @@ -74,20 +74,10 @@ Item { ColumnLayout { id: contentColumn anchors.fill: parent - anchors.margins: Style.marginM - spacing: Style.marginM + anchors.margins: Style.marginS + spacing: Style.marginS - NText { - text: currentItem ? (currentItem.name || "Preview") : "Preview" - font.weight: Style.fontWeightBold - Layout.fillWidth: true - pointSize: Style.fontSizeM - color: Color.mOnSurface - } - NDivider { - Layout.fillWidth: true - } Rectangle { Layout.fillWidth: true diff --git a/Modules/Panels/Launcher/Launcher.qml b/Modules/Panels/Launcher/Launcher.qml index cf6f08b9..b51f256f 100644 --- a/Modules/Panels/Launcher/Launcher.qml +++ b/Modules/Panels/Launcher/Launcher.qml @@ -17,7 +17,7 @@ SmartPanel { // Panel configuration readonly property int listPanelWidth: Math.round(600 * Style.uiScaleRatio) - readonly property int previewPanelWidth: Math.round(300 * Style.uiScaleRatio) + readonly property int previewPanelWidth: Math.round(400 * Style.uiScaleRatio) readonly property int totalBaseWidth: listPanelWidth + (Style.marginL * 2) preferredWidth: totalBaseWidth @@ -278,9 +278,15 @@ SmartPanel { id: previewBox visible: root.previewActive width: root.previewPanelWidth - height: ui.height + height: Math.round(400 * Style.uiScaleRatio) x: ui.width + Style.marginM - y: 0 + y: Math.max( + Style.marginL, // Minimum y is the top margin of the content area + Math.min( + resultsList.mapToItem(ui, 0, (root.selectedIndex * (root.entryHeight + resultsList.spacing)) - resultsList.contentY).y, + ui.height - previewBox.height - Style.marginL // Maximum y, considering bottom margin + ) + ) z: -1 // Draw behind main panel content if it ever overlaps opacity: visible ? 1.0 : 0.0