mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Rework printer cards (cont)
Contributes to CL-1051
This commit is contained in:
parent
b5c893c08e
commit
7c01e632df
7 changed files with 641 additions and 624 deletions
|
|
@ -0,0 +1,83 @@
|
|||
import QtQuick 2.3
|
||||
import QtQuick.Dialogs 1.1
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Controls.Styles 1.3
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick.Controls 1.4 as LegacyControls
|
||||
import UM 1.3 as UM
|
||||
|
||||
// Includes printer type pill and extuder configurations
|
||||
|
||||
Item {
|
||||
id: root;
|
||||
|
||||
property var printer: null;
|
||||
property var printJob: null;
|
||||
|
||||
width: parent.width;
|
||||
height: childrenRect.height;
|
||||
|
||||
// Printer family pills
|
||||
Row {
|
||||
id: printerFamilyPills;
|
||||
|
||||
anchors {
|
||||
left: parent.left;
|
||||
right: parent.right;
|
||||
bottom: extrudersInfo.top;
|
||||
bottomMargin: UM.Theme.getSize("default_margin").height;
|
||||
}
|
||||
height: childrenRect.height;
|
||||
spacing: Math.round(0.5 * UM.Theme.getSize("default_margin").width);
|
||||
width: parent.width;
|
||||
|
||||
Repeater {
|
||||
id: compatiblePills;
|
||||
visible: printJob;
|
||||
model: printJob ? printJob.compatibleMachineFamilies : [];
|
||||
delegate: PrinterFamilyPill { text: modelData; }
|
||||
}
|
||||
|
||||
PrinterFamilyPill {
|
||||
visible: !compatiblePills.visible && printer;
|
||||
text: printer.type;
|
||||
}
|
||||
}
|
||||
|
||||
// Extruder info
|
||||
Row {
|
||||
id: extrudersInfo;
|
||||
|
||||
anchors {
|
||||
left: parent.left;
|
||||
right: parent.right;
|
||||
rightMargin: UM.Theme.getSize("default_margin").width;
|
||||
}
|
||||
height: childrenRect.height;
|
||||
spacing: UM.Theme.getSize("default_margin").width;
|
||||
width: parent.width;
|
||||
|
||||
PrintCoreConfiguration {
|
||||
width: Math.round(parent.width / 2) * screenScaleFactor;
|
||||
printCoreConfiguration: getExtruderConfig(0);
|
||||
}
|
||||
|
||||
PrintCoreConfiguration {
|
||||
width: Math.round(parent.width / 2) * screenScaleFactor;
|
||||
printCoreConfiguration: getExtruderConfig(1);
|
||||
}
|
||||
}
|
||||
|
||||
function getExtruderConfig( i ) {
|
||||
if (root.printJob) {
|
||||
// Use more-specific print job if possible
|
||||
return root.printJob.configuration.extruderConfigurations[i];
|
||||
} else {
|
||||
if (root.printer) {
|
||||
return root.printer.printerConfiguration.extruderConfigurations[i];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue