File: PrintSetupSelectorHeader.qml

package info (click to toggle)
cura 5.0.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 122,920 kB
  • sloc: python: 44,572; sh: 81; xml: 32; makefile: 16
file content (99 lines) | stat: -rw-r--r-- 3,144 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.

import QtQuick 2.10
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3

import UM 1.3 as UM
import Cura 1.0 as Cura

RowLayout
{
    property string enabledText: catalog.i18nc("@label:Should be short", "On")
    property string disabledText: catalog.i18nc("@label:Should be short", "Off")

    Cura.IconWithText
    {
        source: UM.Theme.getIcon("Sliders", "medium")
        iconSize: UM.Theme.getSize("button_icon").width
        text:
        {
            if (Cura.MachineManager.activeStack)
            {
                var resultMap = Cura.MachineManager.activeQualityDisplayNameMap
                var text = resultMap["main"]
                if (resultMap["suffix"])
                {
                    text += " - " + resultMap["suffix"]
                }

                if (!Cura.MachineManager.hasNotSupportedQuality)
                {
                    text += " - " + layerHeight.properties.value + "mm"
                    text += Cura.MachineManager.isActiveQualityExperimental ? " - " + catalog.i18nc("@label", "Experimental") : ""
                }
                return text
            }
            return ""
        }
        font: UM.Theme.getFont("medium")
        elide: Text.ElideMiddle
        wrapMode: Text.NoWrap
        UM.SettingPropertyProvider
        {
            id: layerHeight
            containerStack: Cura.MachineManager.activeStack
            key: "layer_height"
            watchedProperties: ["value"]
        }
    }

    Cura.IconWithText
    {
        source: UM.Theme.getIcon("Infill1")
        text: Cura.MachineManager.activeStack ? parseInt(infillDensity.properties.value) + "%" : "0%"
        font: UM.Theme.getFont("medium")
        iconSize: UM.Theme.getSize("medium_button_icon").width

        UM.SettingPropertyProvider
        {
            id: infillDensity
            containerStack: Cura.MachineManager.activeStack
            key: "infill_sparse_density"
            watchedProperties: ["value"]
        }
    }

    Cura.IconWithText
    {
        source: UM.Theme.getIcon("Support")
        text: supportEnabled.properties.value == "True" ? enabledText : disabledText
        font: UM.Theme.getFont("medium")
        iconSize: UM.Theme.getSize("medium_button_icon").width

        UM.SettingPropertyProvider
        {
            id: supportEnabled
            containerStack: Cura.MachineManager.activeMachine
            key: "support_enable"
            watchedProperties: ["value"]
        }
    }

    Cura.IconWithText
    {
        source: UM.Theme.getIcon("Adhesion")
        text: platformAdhesionType.properties.value != "skirt" && platformAdhesionType.properties.value != "none" ? enabledText : disabledText
        font: UM.Theme.getFont("medium")
        iconSize: UM.Theme.getSize("medium_button_icon").width

        UM.SettingPropertyProvider
        {
            id: platformAdhesionType
            containerStack: Cura.MachineManager.activeMachine
            key: "adhesion_type"
            watchedProperties: [ "value"]
        }
    }
}