fix(AppUi): 给全屏开始菜单最近安装应用添加标记

This commit is contained in:
youdiansaodongxi 2024-05-24 16:43:51 +08:00 committed by He Sir
parent 62f2e6faae
commit 5670dcb391
2 changed files with 28 additions and 7 deletions

View File

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

View File

@ -90,6 +90,7 @@ ListView {
text.text: model.name
icon.source: model.icon
isRecentInstalled: model.recentInstall
onClicked: (event) => {
if (event.button === Qt.LeftButton) {