From 5670dcb39178988782938e4d1e543bd9c1b3319e Mon Sep 17 00:00:00 2001 From: youdiansaodongxi Date: Fri, 24 May 2024 16:43:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(AppUi):=20=E7=BB=99=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95=E6=9C=80=E8=BF=91=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=BA=94=E7=94=A8=E6=B7=BB=E5=8A=A0=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/AppUI/FullScreenAppItem.qml | 34 ++++++++++++++++++++++++++------- qml/AppUI/FullScreenAppList.qml | 1 + 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/qml/AppUI/FullScreenAppItem.qml b/qml/AppUI/FullScreenAppItem.qml index 92403be..4aa1b71 100644 --- a/qml/AppUI/FullScreenAppItem.qml +++ b/qml/AppUI/FullScreenAppItem.qml @@ -29,6 +29,7 @@ MouseArea { property alias icon: appIcon property alias text: appName property alias background: styleBackground + property bool isRecentInstalled: false hoverEnabled: true @@ -53,15 +54,34 @@ MouseArea { Layout.alignment: Qt.AlignHCenter } - UkuiItems.StyleText { - id: appName + RowLayout { Layout.fillWidth: true - Layout.preferredHeight: contentHeight - Layout.maximumHeight: contentHeight + Layout.preferredHeight: appName.contentHeight + Layout.maximumHeight: appName.contentHeight + Layout.alignment: Qt.AlignHCenter - elide: Text.ElideRight - paletteRole: Platform.Theme.Text - horizontalAlignment: Text.AlignHCenter + UkuiItems.StyleBackground { + id: tagPoint + property int tagSize: isRecentInstalled ? 8 : 0 + Layout.alignment: Qt.AlignVCenter + visible: isRecentInstalled + Layout.preferredHeight: tagSize + Layout.preferredWidth: tagSize + radius: width / 2 + useStyleTransparency: false + paletteRole: Platform.Theme.Highlight + } + + UkuiItems.StyleText { + id: appName + Layout.maximumWidth: styleBackground.width - tagPoint.width + Layout.preferredHeight: contentHeight + Layout.maximumHeight: contentHeight + + elide: Text.ElideRight + paletteRole: Platform.Theme.Text + horizontalAlignment: Text.AlignHCenter + } } } } diff --git a/qml/AppUI/FullScreenAppList.qml b/qml/AppUI/FullScreenAppList.qml index 144763e..266f43f 100644 --- a/qml/AppUI/FullScreenAppList.qml +++ b/qml/AppUI/FullScreenAppList.qml @@ -90,6 +90,7 @@ ListView { text.text: model.name icon.source: model.icon + isRecentInstalled: model.recentInstall onClicked: (event) => { if (event.button === Qt.LeftButton) {