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 {
|
MouseArea {
|
||||||
id: control
|
id: control
|
||||||
property bool isSelect: false
|
property bool isSelect: false
|
||||||
|
property bool isRecentInstalled: false
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
states: State {
|
states: State {
|
||||||
when: control.activeFocus
|
when: control.activeFocus
|
||||||
|
@ -51,17 +52,30 @@ MouseArea {
|
||||||
spacing: 12
|
spacing: 12
|
||||||
}
|
}
|
||||||
|
|
||||||
Extension.EditModeFlag {
|
Item {
|
||||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.maximumWidth: visible ? 28 : 0
|
Layout.maximumWidth: tagLabel.visible ? 28 : isRecentInstalled ? 8 : 0
|
||||||
Layout.maximumHeight: width
|
Layout.maximumHeight: width
|
||||||
Layout.rightMargin: visible ? 4 : 0
|
Layout.rightMargin: tagLabel.visible ? 4 : 0
|
||||||
|
|
||||||
isFavorited: favorite
|
Extension.EditModeFlag {
|
||||||
onClicked: {
|
id: tagLabel
|
||||||
appManager.changeFavoriteState(id, !isFavorited);
|
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
|
height: appListView.itemHeight
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
isRecentInstalled: model.recentInstall
|
||||||
|
|
||||||
Drag.hotSpot.x: 48 / 2
|
Drag.hotSpot.x: 48 / 2
|
||||||
Drag.hotSpot.y: 48 / 2
|
Drag.hotSpot.y: 48 / 2
|
||||||
|
|
|
@ -97,6 +97,10 @@ QVariant RecentlyInstalledModel::data(const QModelIndex &index, int role) const
|
||||||
return tr("Recently Installed");
|
return tr("Recently Installed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (role == DataEntity::RecentInstall) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return QSortFilterProxyModel::data(index, role);
|
return QSortFilterProxyModel::data(index, role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue