Use new ScrollBar with controls 2

Contributes to issue CURA-8686.
This commit is contained in:
Ghostkeeper 2022-01-17 17:15:23 +01:00
parent 70a79c9b5c
commit 10303c10f9
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -1,39 +1,34 @@
// Copyright (c) 2018 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.1 as UM import UM 1.5 as UM
ScrollView ListView
{ {
property alias model: backupList.model
width: parent.width
clip: true clip: true
ListView ScrollBar.vertical: UM.ScrollBar {}
delegate: Item
{ {
id: backupList // Add a margin, otherwise the scrollbar is on top of the right most component
width: parent.width width: parent.width - UM.Theme.getSize("scrollbar").width
delegate: Item height: childrenRect.height
BackupListItem
{ {
// Add a margin, otherwise the scrollbar is on top of the right most component id: backupListItem
width: parent.width - UM.Theme.getSize("default_margin").width width: parent.width
height: childrenRect.height }
BackupListItem Rectangle
{ {
id: backupListItem id: divider
width: parent.width color: UM.Theme.getColor("lining")
} height: UM.Theme.getSize("default_lining").height
Rectangle
{
id: divider
color: UM.Theme.getColor("lining")
height: UM.Theme.getSize("default_lining").height
}
} }
} }
} }