feat(launcher): UI improvements for clipboard preview window

This commit is contained in:
loner
2025-11-19 07:06:00 +08:00
parent ed373df99d
commit 87f62b288b
2 changed files with 11 additions and 15 deletions

View File

@@ -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

View File

@@ -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