mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-19 04:37:51 -06:00
CURA-4870 Frontend formatting to show the configurations
This commit is contained in:
parent
b8ad0959a7
commit
871f0a130e
4 changed files with 101 additions and 28 deletions
|
@ -16,48 +16,77 @@ Rectangle
|
||||||
|
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: "black"
|
border.color: UM.Theme.getColor("sidebar_lining_thin")
|
||||||
|
|
||||||
Column
|
Column
|
||||||
{
|
{
|
||||||
id: contentColumn
|
id: contentColumn
|
||||||
|
width: parent.width
|
||||||
padding: UM.Theme.getSize("default_margin").width
|
padding: UM.Theme.getSize("default_margin").width
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: Math.round(UM.Theme.getSize("default_margin").height / 2)
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: configuration.printerType
|
|
||||||
}
|
|
||||||
|
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
id: extruderRow
|
id: extruderRow
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width - 2 * parent.padding
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
spacing: UM.Theme.getSize("default_margin").width
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
Repeater
|
Repeater
|
||||||
{
|
{
|
||||||
|
id: repeater
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
model: configuration.extruderConfigurations
|
model: configuration.extruderConfigurations
|
||||||
delegate: PrintCoreConfiguration
|
delegate: PrintCoreConfiguration
|
||||||
{
|
{
|
||||||
|
width: Math.round(parent.width / 2)
|
||||||
printCoreConfiguration: modelData
|
printCoreConfiguration: modelData
|
||||||
}
|
}
|
||||||
|
Component.onCompleted: {print("ELEMENTOS:", repeater.model.count)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rectangle
|
//Buildplate row separator
|
||||||
// {
|
Rectangle {
|
||||||
// id: buildplateInformation
|
id: separator
|
||||||
//
|
|
||||||
// Label
|
visible: buildplateInformation.visible
|
||||||
// {
|
width: parent.width - 2 * parent.padding
|
||||||
// text: configuration.buildplateConfiguration
|
height: visible ? Math.round(UM.Theme.getSize("sidebar_lining_thin").height / 2) : 0
|
||||||
// }
|
color: UM.Theme.getColor("sidebar_lining_thin")
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
id: buildplateInformation
|
||||||
|
width: parent.width - 2 * parent.padding
|
||||||
|
height: childrenRect.height
|
||||||
|
visible: configuration.buildplateConfiguration != ""
|
||||||
|
|
||||||
|
UM.RecolorImage {
|
||||||
|
id: buildplateIcon
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: UM.Theme.getSize("standard_arrow").width
|
||||||
|
height: UM.Theme.getSize("standard_arrow").height
|
||||||
|
sourceSize.width: width
|
||||||
|
sourceSize.height: height
|
||||||
|
source: UM.Theme.getIcon("extruder_button")
|
||||||
|
|
||||||
|
color: "black"
|
||||||
|
}
|
||||||
|
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
id: buildplateLabel
|
||||||
|
anchors.left: buildplateIcon.right
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").height / 2)
|
||||||
|
text: configuration.buildplateConfiguration
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea
|
MouseArea
|
||||||
|
|
|
@ -14,7 +14,7 @@ Column
|
||||||
property var outputDevice: Cura.MachineManager.printerOutputDevices[0]
|
property var outputDevice: Cura.MachineManager.printerOutputDevices[0]
|
||||||
height: childrenRect.height + 2 * padding
|
height: childrenRect.height + 2 * padding
|
||||||
padding: UM.Theme.getSize("default_margin").width
|
padding: UM.Theme.getSize("default_margin").width
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: Math.round(UM.Theme.getSize("default_margin").height / 2)
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: catalog.i18nc("@label:header configurations", "Available configurations")
|
text: catalog.i18nc("@label:header configurations", "Available configurations")
|
||||||
|
@ -25,7 +25,7 @@ Column
|
||||||
ScrollView {
|
ScrollView {
|
||||||
id: container
|
id: container
|
||||||
width: parent.width - 2 * parent.padding
|
width: parent.width - 2 * parent.padding
|
||||||
height: childrenRect.height
|
height: 500 //childrenRect.height
|
||||||
|
|
||||||
style: UM.Theme.styles.scrollview
|
style: UM.Theme.styles.scrollview
|
||||||
|
|
||||||
|
@ -52,16 +52,13 @@ Column
|
||||||
model: outputDevice.uniqueConfigurations
|
model: outputDevice.uniqueConfigurations
|
||||||
delegate: ConfigurationItem
|
delegate: ConfigurationItem
|
||||||
{
|
{
|
||||||
height: parent.height
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
configuration: modelData
|
configuration: modelData
|
||||||
onConfigurationSelected:
|
onConfigurationSelected:
|
||||||
{
|
{
|
||||||
print("SELECCIONANDO CONFIGURACION", JSON.stringify(configuration))
|
print("SELECCIONANDO CONFIGURACION", JSON.stringify(configuration))
|
||||||
}
|
}
|
||||||
Component.onCompleted: {print("$$$$$$$$$$$$$$$$$$ Configuracion", JSON.stringify(configuration))}
|
|
||||||
}
|
}
|
||||||
Component.onCompleted: {print("$$$$$$$$$$$$$$$$$$ Elementos del modelo", JSON.stringify(outputDevice.uniqueConfigurations))}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,29 +7,76 @@ import QtQuick.Controls 2.0
|
||||||
import UM 1.2 as UM
|
import UM 1.2 as UM
|
||||||
|
|
||||||
|
|
||||||
Item
|
Column
|
||||||
{
|
{
|
||||||
id: extruderInfo
|
id: extruderInfo
|
||||||
property var printCoreConfiguration
|
property var printCoreConfiguration
|
||||||
|
spacing: Math.round(UM.Theme.getSize("default_margin").height / 2)
|
||||||
|
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
id: extruder
|
||||||
|
width: parent.width
|
||||||
|
height: childrenRect.height
|
||||||
|
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
id: extruderLabel
|
||||||
|
text: catalog.i18nc("@label:extruder label", "Extruder")
|
||||||
|
elide: Text.ElideRight
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.left: parent.left
|
||||||
|
font: UM.Theme.getFont("small")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rounded item to show the extruder number
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
id: extruderIconItem
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.left: extruderLabel.right
|
||||||
|
anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2)
|
||||||
|
|
||||||
|
width: UM.Theme.getSize("section_icon").width
|
||||||
|
height: UM.Theme.getSize("section_icon").height
|
||||||
|
|
||||||
|
UM.RecolorImage {
|
||||||
|
id: mainCircle
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
sourceSize.width: parent.width
|
||||||
|
sourceSize.height: parent.height
|
||||||
|
source: UM.Theme.getIcon("extruder_button")
|
||||||
|
|
||||||
|
color: extruderNumberText.color
|
||||||
|
}
|
||||||
|
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
id: extruderNumberText
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: printCoreConfiguration.position + 1
|
||||||
|
font: UM.Theme.getFont("small")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: materialLabel
|
id: materialLabel
|
||||||
text: printCoreConfiguration.material
|
text: printCoreConfiguration.material
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
width: parent.width
|
width: parent.width
|
||||||
font: UM.Theme.getFont("very_small")
|
font: UM.Theme.getFont("small")
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: printCoreLabel
|
id: printCoreTypeLabel
|
||||||
text: printCoreConfiguration.hotendID
|
text: printCoreConfiguration.hotendID
|
||||||
anchors.top: materialLabel.bottom
|
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
width: parent.width
|
width: parent.width
|
||||||
font: UM.Theme.getFont("very_small")
|
font: UM.Theme.getFont("very_small")
|
||||||
opacity: 0.5
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ Button
|
||||||
width: UM.Theme.getSize("standard_arrow").width
|
width: UM.Theme.getSize("standard_arrow").width
|
||||||
height: UM.Theme.getSize("standard_arrow").height
|
height: UM.Theme.getSize("standard_arrow").height
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: width
|
sourceSize.height: height
|
||||||
color: UM.Theme.getColor("text_emphasis")
|
color: UM.Theme.getColor("text_emphasis")
|
||||||
source: UM.Theme.getIcon("arrow_bottom")
|
source: UM.Theme.getIcon("arrow_bottom")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue