fix(libappdata): 添加最近安装蓝点
This commit is contained in:
parent
ee7fc97053
commit
b639b318ce
|
@ -9,6 +9,7 @@ import org.ukui.quick.items 1.0 as UkuiItems
|
|||
MouseArea {
|
||||
id: control
|
||||
property bool isSelect: false
|
||||
property bool isRecentInstalled: false
|
||||
hoverEnabled: true
|
||||
states: State {
|
||||
when: control.activeFocus
|
||||
|
@ -51,19 +52,32 @@ MouseArea {
|
|||
spacing: 12
|
||||
}
|
||||
|
||||
Extension.EditModeFlag {
|
||||
Item {
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.maximumWidth: visible ? 28 : 0
|
||||
Layout.maximumWidth: tagLabel.visible ? 28 : isRecentInstalled ? 8 : 0
|
||||
Layout.maximumHeight: width
|
||||
Layout.rightMargin: visible ? 4 : 0
|
||||
Layout.rightMargin: tagLabel.visible ? 4 : 0
|
||||
|
||||
Extension.EditModeFlag {
|
||||
id: tagLabel
|
||||
anchors.fill: parent
|
||||
isFavorited: favorite
|
||||
onClicked: {
|
||||
appManager.changeFavoriteState(id, !isFavorited);
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: tagPoint
|
||||
visible: tagLabel.sourceComponent != null ? false : isRecentInstalled
|
||||
anchors.centerIn: parent
|
||||
width: 8; height: width
|
||||
radius: width / 2
|
||||
color: Platform.Theme.highlight()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ AppListView {
|
|||
height: appListView.itemHeight
|
||||
anchors.centerIn: parent
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
isRecentInstalled: model.recentInstall
|
||||
|
||||
Drag.hotSpot.x: 48 / 2
|
||||
Drag.hotSpot.y: 48 / 2
|
||||
|
|
|
@ -97,6 +97,10 @@ QVariant RecentlyInstalledModel::data(const QModelIndex &index, int role) const
|
|||
return tr("Recently Installed");
|
||||
}
|
||||
|
||||
if (role == DataEntity::RecentInstall) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return QSortFilterProxyModel::data(index, role);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue