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

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

import QtQuick 2.10
import QtQuick.Controls 2.3

import UM 1.3 as UM
import Cura 1.1 as Cura


//
// This component contains the content for the "What's new in Ultimaker Cura" page of the welcome on-boarding process.
//
Item
{
    UM.I18nCatalog { id: catalog; name: "cura" }

    property var machineActionsModel: CuraApplication.getFirstStartMachineActionsModel()

    Component.onCompleted:
    {
        // Reset the action to start from the beginning when it is shown.
        machineActionsModel.reset()
    }

    // Go to the next page when all machine actions have been finished
    Connections
    {
        target: machineActionsModel
        function onAllFinished()
        {
            if (visible)
            {
                base.showNextPage()
            }
        }
    }

    Label
    {
        id: titleLabel
        anchors.top: parent.top
        anchors.horizontalCenter: parent.horizontalCenter
        horizontalAlignment: Text.AlignHCenter
        text: machineActionsModel.currentItem.title == undefined ? "" : machineActionsModel.currentItem.title
        color: UM.Theme.getColor("primary_button")
        font: UM.Theme.getFont("huge")
        renderType: Text.NativeRendering
    }

    Item
    {
        anchors
        {
            top: titleLabel.bottom
            topMargin: UM.Theme.getSize("default_margin").height
            bottom: nextButton.top
            bottomMargin: UM.Theme.getSize("default_margin").height
            left: parent.left
            right: parent.right
        }

        data: machineActionsModel.currentItem.content == undefined ? emptyItem : machineActionsModel.currentItem.content
    }

    // An empty item in case there's no currentItem.content to show
    Item
    {
        id: emptyItem
    }

    Cura.PrimaryButton
    {
        id: nextButton
        anchors.right: parent.right
        anchors.bottom: parent.bottom
        text: catalog.i18nc("@button", "Next")
        onClicked: machineActionsModel.goToNextAction()
    }
}