Welcome to mirror list, hosted at ThFree Co, Russian Federation.

MonitorIconExtruder.qml « qml « resources « UM3NetworkPrinting « plugins - github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 876215d65df95100fda7a6238496cf7d10e1f9d5 (plain)
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
// Copyright (c) 2019 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.

import QtQuick 2.2
import QtQuick.Controls 2.0
import UM 1.3 as UM

/**
 * This component is a sort of "super icon" which includes a colored SVG image
 * as well as the extruder position number. It is used in the the
 * MonitorExtruderConfiguration component.
 */
Item
{
    // The material color
    property alias color: icon.color

    // The extruder position; NOTE: Decent human beings count from 0
    property int position: 0

    // The extruder icon size; NOTE: This shouldn't need to be changed
    property int size: 32 * screenScaleFactor // TODO: Theme!

    // THe extruder icon source; NOTE: This shouldn't need to be changed
    property string iconSource: "../svg/icons/extruder.svg"

    height: size
    width: size

    UM.RecolorImage
    {
        id: icon
        anchors.fill: parent
        source: iconSource
        width: size
    }

    Label
    {
        id: positionLabel
        font: UM.Theme.getFont("small")
        color: UM.Theme.getColor("monitor_text_primary")
        height: Math.round(size / 2)
        horizontalAlignment: Text.AlignHCenter
        text: position + 1
        verticalAlignment: Text.AlignVCenter
        width: Math.round(size / 2)
        x: Math.round(size * 0.25)
        y: Math.round(size * 0.15625)
        visible: position >= 0
        renderType: Text.NativeRendering
    }
}