mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 17:57:55 -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,52 +139,47 @@ Item
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
Column
|
ScrollBar.vertical: UM.ScrollBar {}
|
||||||
|
clip : true
|
||||||
|
visible: discoveredCloudPrintersModel.count > 0
|
||||||
|
spacing: UM.Theme.getSize("wide_margin").height
|
||||||
|
|
||||||
|
model: discoveredCloudPrintersModel
|
||||||
|
delegate: Item
|
||||||
{
|
{
|
||||||
id: discoveredPrintersColumn
|
width: discoveredCloudPrintersList.width
|
||||||
spacing: 2 * UM.Theme.getSize("default_margin").height
|
height: contentColumn.height
|
||||||
|
|
||||||
Repeater
|
Column
|
||||||
{
|
{
|
||||||
id: discoveredCloudPrintersRepeater
|
id: contentColumn
|
||||||
model: discoveredCloudPrintersModel
|
Label
|
||||||
delegate: Item
|
|
||||||
{
|
{
|
||||||
width: discoveredCloudPrintersScrollView.width
|
id: cloudPrinterNameLabel
|
||||||
height: contentColumn.height
|
leftPadding: UM.Theme.getSize("default_margin").width
|
||||||
|
text: model.name
|
||||||
Column
|
font: UM.Theme.getFont("large_bold")
|
||||||
{
|
color: UM.Theme.getColor("text")
|
||||||
id: contentColumn
|
elide: Text.ElideRight
|
||||||
Label
|
}
|
||||||
{
|
Label
|
||||||
id: cloudPrinterNameLabel
|
{
|
||||||
leftPadding: UM.Theme.getSize("default_margin").width
|
id: cloudPrinterTypeLabel
|
||||||
text: model.name
|
leftPadding: 2 * UM.Theme.getSize("default_margin").width
|
||||||
font: UM.Theme.getFont("large_bold")
|
topPadding: UM.Theme.getSize("thin_margin").height
|
||||||
color: UM.Theme.getColor("text")
|
text: {"Type: " + model.machine_type}
|
||||||
elide: Text.ElideRight
|
font: UM.Theme.getFont("medium")
|
||||||
}
|
color: UM.Theme.getColor("text")
|
||||||
Label
|
elide: Text.ElideRight
|
||||||
{
|
}
|
||||||
id: cloudPrinterTypeLabel
|
Label
|
||||||
leftPadding: 2 * UM.Theme.getSize("default_margin").width
|
{
|
||||||
topPadding: UM.Theme.getSize("thin_margin").height
|
id: cloudPrinterFirmwareVersionLabel
|
||||||
text: {"Type: " + model.machine_type}
|
leftPadding: 2 * UM.Theme.getSize("default_margin").width
|
||||||
font: UM.Theme.getFont("medium")
|
text: {"Firmware version: " + model.firmware_version}
|
||||||
color: UM.Theme.getColor("text")
|
font: UM.Theme.getFont("medium")
|
||||||
elide: Text.ElideRight
|
color: UM.Theme.getColor("text")
|
||||||
}
|
elide: Text.ElideRight
|
||||||
Label
|
|
||||||
{
|
|
||||||
id: cloudPrinterFirmwareVersionLabel
|
|
||||||
leftPadding: 2 * UM.Theme.getSize("default_margin").width
|
|
||||||
text: {"Firmware version: " + model.firmware_version}
|
|
||||||
font: UM.Theme.getFont("medium")
|
|
||||||
color: UM.Theme.getColor("text")
|
|
||||||
elide: Text.ElideRight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue