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 Style 1.0
import "../tray" import "../tray"
Item { ActivityList {
id: root id: root
property string localPath: "" property alias localPath: activityListModel.localPath
property var accountState: ({}) property alias accountState: activityListModel.accountState
property int horizontalPadding: 0
property int iconSize: 32
property alias model: activityModel
FileActivityListModel { isFileActivityList: true
id: activityModel model: FileActivityListModel {
localPath: root.localPath id: activityListModel
accountState: root.accountState
}
ActivityList {
anchors.fill: parent
anchors.leftMargin: root.horizontalPadding
anchors.rightMargin: root.horizontalPadding
iconSize: root.iconSize
isFileActivityList: true
model: root.model
} }
} }

View file

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

View file

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