From 4753766b4f4238d8f0105f7cba0a5049254b1742 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Sun, 21 Sep 2025 20:19:50 -0400 Subject: [PATCH] Clock / DateTimeTokens: better look and alignment --- Widgets/NDateTimeTokens.qml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Widgets/NDateTimeTokens.qml b/Widgets/NDateTimeTokens.qml index 9336362f..b4897390 100644 --- a/Widgets/NDateTimeTokens.qml +++ b/Widgets/NDateTimeTokens.qml @@ -5,7 +5,7 @@ import qs.Commons Rectangle { id: root - color: Color.mSurfaceVariant + color: Color.mSurface border.color: Color.mOutline border.width: Math.max(1, Style.borderS * scaling) radius: Style.radiusM * scaling @@ -26,6 +26,8 @@ Rectangle { Layout.fillWidth: true Layout.fillHeight: true clip: true + horizontalPolicy: ScrollBar.AlwaysOff + verticalPolicy: ScrollBar.AsNeeded ListView { id: tokensList @@ -239,12 +241,13 @@ Rectangle { delegate: Rectangle { id: tokenDelegate width: tokensList.width - height: 32 * scaling + height: layout.implicitHeight + Style.marginS * scaling + radius: Style.radiusS * scaling color: { if (tokenMouseArea.containsMouse) { return Qt.alpha(Color.mPrimary, 0.1) } - return index % 2 === 0 ? Color.mSurface : Color.mSurfaceVariant + return index % 2 === 0 ? Color.mSurfaceVariant : Qt.alpha(Color.mSurfaceVariant, 0.6) } // Mouse area for the entire delegate @@ -281,12 +284,14 @@ Rectangle { } RowLayout { + id: layout anchors.fill: parent - anchors.margins: Style.marginS * scaling + anchors.margins: Style.marginXS * scaling spacing: Style.marginM * scaling // Category badge Rectangle { + Layout.alignment: Qt.AlignVCenter width: 70 * scaling height: 22 * scaling color: getCategoryColor(model.category)[0] @@ -310,6 +315,7 @@ Rectangle { // Token - Made more prominent and clickable Rectangle { id: tokenButton + Layout.alignment: Qt.AlignVCenter // Added this line width: 100 * scaling height: 22 * scaling color: tokenMouseArea.containsMouse ? Color.mPrimary : Color.mOnSurface @@ -339,6 +345,7 @@ Rectangle { // Description NText { Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter // Added this line text: model.description color: tokenMouseArea.containsMouse ? Color.mOnSurface : Color.mOnSurfaceVariant font.pointSize: Style.fontSizeS * scaling @@ -353,6 +360,7 @@ Rectangle { // Live example Rectangle { + Layout.alignment: Qt.AlignVCenter // Added this line width: 90 * scaling height: 22 * scaling color: tokenMouseArea.containsMouse ? Color.mPrimary : Color.mOnSurfaceVariant