Eliminate unneeded parent Item in FileActivityView

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2022-10-01 10:50:14 +02:00
parent 0ca927843f
commit 31afb02c84
No known key found for this signature in database
GPG key ID: C839200C384636B0
3 changed files with 17 additions and 24 deletions

View file

@ -20,28 +20,14 @@ import com.nextcloud.desktopclient 1.0
import Style 1.0
import "../tray"
Item {
ActivityList {
id: root
property string localPath: ""
property var accountState: ({})
property int horizontalPadding: 0
property int iconSize: 32
property alias model: activityModel
property alias localPath: activityListModel.localPath
property alias accountState: activityListModel.accountState
FileActivityListModel {
id: activityModel
localPath: root.localPath
accountState: root.accountState
}
ActivityList {
anchors.fill: parent
anchors.leftMargin: root.horizontalPadding
anchors.rightMargin: root.horizontalPadding
iconSize: root.iconSize
isFileActivityList: true
model: root.model
isFileActivityList: true
model: FileActivityListModel {
id: activityListModel
}
}

View file

@ -168,9 +168,10 @@ Page {
property int swipeIndex: SwipeView.index
delegateHorizontalPadding: root.intendedPadding
accountState: root.accountState
localPath: root.localPath
horizontalPadding: root.intendedPadding
iconSize: root.iconSize
}

View file

@ -11,6 +11,7 @@ ScrollView {
property bool isFileActivityList: false
property int iconSize: Style.trayListItemIconSize
property int delegateHorizontalPadding: 0
signal openFile(string filePath)
signal activityItemClicked(int index)
@ -38,8 +39,9 @@ ScrollView {
highlight: Rectangle {
id: activityHover
width: activityList.currentItem.width
height: activityList.currentItem.height
anchors.fill: activityList.currentItem
color: Style.lightHover
visible: activityList.activeFocus
}
@ -56,9 +58,13 @@ ScrollView {
}
delegate: ActivityItem {
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: controlRoot.delegateHorizontalPadding
anchors.rightMargin: controlRoot.delegateHorizontalPadding
isFileActivityList: controlRoot.isFileActivityList
iconSize: controlRoot.iconSize
width: activityList.contentWidth
flickable: activityList
onHoveredChanged: if (hovered) {
// When we set the currentIndex the list view will scroll...