mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Organize material preferences
Contributes to CURA-5378
This commit is contained in:
parent
272e892179
commit
00eb8e6788
7 changed files with 656 additions and 356 deletions
103
resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml
Normal file
103
resources/qml/Preferences/Materials/MaterialsDetailsPanel.qml
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Dialogs 1.2
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item
|
||||
{
|
||||
id: detailsPanel
|
||||
|
||||
function updateMaterialPropertiesObject( currentItem )
|
||||
{
|
||||
// var currentItem = materialsModel.getItem(materialListView.currentIndex);
|
||||
|
||||
materialProperties.name = currentItem.name ? currentItem.name : "Unknown";
|
||||
materialProperties.guid = currentItem.guid;
|
||||
materialProperties.container_id = currentItem.container_id;
|
||||
|
||||
materialProperties.brand = currentItem.brand ? currentItem.brand : "Unknown";
|
||||
materialProperties.material = currentItem.material ? currentItem.material : "Unknown";
|
||||
materialProperties.color_name = currentItem.color_name ? currentItem.color_name : "Yellow";
|
||||
materialProperties.color_code = currentItem.color_code ? currentItem.color_code : "yellow";
|
||||
|
||||
materialProperties.description = currentItem.description ? currentItem.description : "";
|
||||
materialProperties.adhesion_info = currentItem.adhesion_info ? currentItem.adhesion_info : "";
|
||||
|
||||
materialProperties.density = currentItem.density ? currentItem.density : 0.0;
|
||||
materialProperties.diameter = currentItem.diameter ? currentItem.diameter : 0.0;
|
||||
materialProperties.approximate_diameter = currentItem.approximate_diameter ? currentItem.approximate_diameter : "0";
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
anchors.fill: parent
|
||||
|
||||
Item // Material title Label
|
||||
{
|
||||
id: profileName
|
||||
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
Label {
|
||||
text: materialProperties.name
|
||||
font: UM.Theme.getFont("large")
|
||||
}
|
||||
}
|
||||
|
||||
MaterialView // Material detailed information view below the title Label
|
||||
{
|
||||
id: materialDetailsView
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: profileName.bottom
|
||||
topMargin: UM.Theme.getSize("default_margin").height
|
||||
bottom: parent.bottom
|
||||
}
|
||||
|
||||
editingEnabled: base.currentItem != null && !base.currentItem.is_read_only
|
||||
|
||||
properties: materialProperties
|
||||
containerId: base.currentItem != null ? base.currentItem.container_id : ""
|
||||
currentMaterialNode: base.currentItem.container_node
|
||||
|
||||
|
||||
}
|
||||
|
||||
QtObject
|
||||
{
|
||||
id: materialProperties
|
||||
|
||||
property string guid: "00000000-0000-0000-0000-000000000000"
|
||||
property string container_id: "Unknown";
|
||||
property string name: "Unknown";
|
||||
property string profile_type: "Unknown";
|
||||
property string brand: "Unknown";
|
||||
property string material: "Unknown"; // This needs to be named as "material" to be consistent with
|
||||
// the material container's metadata entry
|
||||
|
||||
property string color_name: "Yellow";
|
||||
property color color_code: "yellow";
|
||||
|
||||
property real density: 0.0;
|
||||
property real diameter: 0.0;
|
||||
property string approximate_diameter: "0";
|
||||
|
||||
property real spool_cost: 0.0;
|
||||
property real spool_weight: 0.0;
|
||||
property real spool_length: 0.0;
|
||||
property real cost_per_meter: 0.0;
|
||||
|
||||
property string description: "";
|
||||
property string adhesion_info: "";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue