mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-05 16:51:12 -07:00
Add printer cards
CURA-9278
This commit is contained in:
parent
d3ee9c4c24
commit
7f98ef70f0
4 changed files with 168 additions and 16 deletions
134
resources/qml/PrinterSelector/PrintSelectorCard.qml
Normal file
134
resources/qml/PrinterSelector/PrintSelectorCard.qml
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.9
|
||||
import QtQuick.Layouts 2.10
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Rectangle {
|
||||
property alias name: printerTitle.text
|
||||
property var extruders
|
||||
|
||||
width: parent.width
|
||||
height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").height
|
||||
|
||||
color: UM.Theme.getColor("background_1")
|
||||
border.color: UM.Theme.getColor("border_main")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
|
||||
RowLayout
|
||||
{
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Cura.IconWithText
|
||||
{
|
||||
id: printerTitle
|
||||
|
||||
Layout.preferredWidth: parent.width / 3
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Layout.fillHeight: false
|
||||
|
||||
source: UM.Theme.getIcon("Printer")
|
||||
spacing: UM.Theme.getSize("thin_margin").width
|
||||
iconSize: UM.Theme.getSize("medium_button_icon").width
|
||||
font: UM.Theme.getFont("medium_bold")
|
||||
}
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
id: extruderInformation
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: parent.width / 2
|
||||
Layout.alignment: Qt.AlignTop
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Repeater
|
||||
{
|
||||
model: extruders
|
||||
|
||||
Item
|
||||
{
|
||||
height: childrenRect.height
|
||||
|
||||
Cura.ExtruderIcon
|
||||
{
|
||||
id: extruderIcon
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
materialColor: modelData.materials.length == 1 ? modelData.materials[0].color : "white"
|
||||
iconSize: UM.Theme.getSize("medium_button_icon").width
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: extruderCore
|
||||
anchors.verticalCenter: extruderIcon.verticalCenter
|
||||
anchors.left: extruderIcon.right
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
text: modelData.core
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: singleMaterialText
|
||||
anchors.left: extruderCore.right
|
||||
anchors.verticalCenter: extruderCore.verticalCenter
|
||||
text: modelData.materials.length == 1 ? modelDatamaterials[0].name : "test"
|
||||
visible: modelData.materials.length == 1
|
||||
}
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
id: multiMaterialText
|
||||
anchors.top: extruderCore.bottom
|
||||
anchors.left: extruderCore.left
|
||||
anchors.topMargin: UM.Theme.getSize("narrow_margin").height
|
||||
Repeater
|
||||
{
|
||||
model: modelData.materials
|
||||
visible: modelData.materials.length > 1
|
||||
UM.Label
|
||||
{
|
||||
text: modelData.name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: PrintButton
|
||||
|
||||
implicitWidth: UM.Theme.getSize("medium_button").width
|
||||
implicitHeight: implicitWidth
|
||||
Layout.alignment: Qt.AlignTop
|
||||
padding: 0
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("border_accent_1")
|
||||
color: control.hovered ? UM.Theme.getColor("toolbar_button_hover"): UM.Theme.getColor("background_1")
|
||||
}
|
||||
|
||||
contentItem: Item
|
||||
{
|
||||
UM.ColorImage
|
||||
{
|
||||
anchors.centerIn: parent
|
||||
source: UM.Theme.getIcon("Printer")
|
||||
color: UM.Theme.getColor("border_accent_1")
|
||||
width: UM.Theme.getSize("small_button_icon").width
|
||||
height: width
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue