mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 02:07:51 -06:00
Replace ScrollView+Column+Repeater by ListView with correct scrollbar
Much simpler. And looks more consistent too. Contributes to issue CURA-8686.
This commit is contained in:
parent
5041162a99
commit
f94b7ce753
1 changed files with 42 additions and 52 deletions
|
@ -1,11 +1,11 @@
|
||||||
// Copyright (c) 2019 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.10
|
import QtQuick 2.10
|
||||||
import QtQuick.Controls 2.3
|
import QtQuick.Controls 2.3
|
||||||
import QtQuick.Layouts 1.3
|
import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
import UM 1.3 as UM
|
import UM 1.5 as UM
|
||||||
import Cura 1.7 as Cura
|
import Cura 1.7 as Cura
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ Item
|
||||||
property bool searchingForCloudPrinters: true
|
property bool searchingForCloudPrinters: true
|
||||||
property var discoveredCloudPrintersModel: CuraApplication.getDiscoveredCloudPrintersModel()
|
property var discoveredCloudPrintersModel: CuraApplication.getDiscoveredCloudPrintersModel()
|
||||||
|
|
||||||
// The area where either the discoveredCloudPrintersScrollView or the busyIndicator will be displayed
|
// The area where either the discoveredCloudPrintersList or the busyIndicator will be displayed
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
id: cloudPrintersContent
|
id: cloudPrintersContent
|
||||||
|
@ -126,14 +126,9 @@ Item
|
||||||
|
|
||||||
// The scrollView that contains the list of newly discovered Ultimaker Cloud printers. Visible only when
|
// The scrollView that contains the list of newly discovered Ultimaker Cloud printers. Visible only when
|
||||||
// there is at least a new cloud printer.
|
// there is at least a new cloud printer.
|
||||||
ScrollView
|
ListView
|
||||||
{
|
{
|
||||||
id: discoveredCloudPrintersScrollView
|
id: discoveredCloudPrintersList
|
||||||
width: parent.width
|
|
||||||
clip : true
|
|
||||||
ScrollBar.horizontal.policy: ScrollBar.AsNeeded
|
|
||||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
|
||||||
visible: discoveredCloudPrintersModel.count > 0
|
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
top: cloudPrintersAddedTitle.bottom
|
top: cloudPrintersAddedTitle.bottom
|
||||||
|
@ -144,18 +139,15 @@ Item
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
Column
|
ScrollBar.vertical: UM.ScrollBar {}
|
||||||
{
|
clip : true
|
||||||
id: discoveredPrintersColumn
|
visible: discoveredCloudPrintersModel.count > 0
|
||||||
spacing: 2 * UM.Theme.getSize("default_margin").height
|
spacing: UM.Theme.getSize("wide_margin").height
|
||||||
|
|
||||||
Repeater
|
|
||||||
{
|
|
||||||
id: discoveredCloudPrintersRepeater
|
|
||||||
model: discoveredCloudPrintersModel
|
model: discoveredCloudPrintersModel
|
||||||
delegate: Item
|
delegate: Item
|
||||||
{
|
{
|
||||||
width: discoveredCloudPrintersScrollView.width
|
width: discoveredCloudPrintersList.width
|
||||||
height: contentColumn.height
|
height: contentColumn.height
|
||||||
|
|
||||||
Column
|
Column
|
||||||
|
@ -193,8 +185,6 @@ Item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Cura.SecondaryButton
|
Cura.SecondaryButton
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue