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

PackageDetails.qml « qml « resources « Marketplace « plugins - github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 218669d81e32b1e9d068009d9766db56a549e4ba (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.3

import Cura 1.0 as Cura
import UM 1.5 as UM

Item
{
    id: detailPage
    property var packageData: packages.selectedPackage
    property string title: catalog.i18nc("@header", "Package details")

    RowLayout
    {
        id: header
        anchors
        {
            top: parent.top
            topMargin: UM.Theme.getSize("default_margin").height
            left: parent.left
            leftMargin: UM.Theme.getSize("default_margin").width
            right: parent.right
            rightMargin: anchors.leftMargin
        }

        spacing: UM.Theme.getSize("default_margin").width

        Cura.SecondaryButton
        {
            Layout.alignment: Qt.AlignmentFlag.AlignVCenter
            Layout.preferredHeight: UM.Theme.getSize("action_button").height
            Layout.preferredWidth: height

            onClicked: contextStack.pop() //Remove this page, returning to the main package list or whichever thing is beneath it.

            tooltip: catalog.i18nc("@button:tooltip", "Back")
            toolTipContentAlignment: UM.Enums.ContentAlignment.AlignRight
            leftPadding: UM.Theme.getSize("narrow_margin").width
            rightPadding: leftPadding
            iconSource: UM.Theme.getIcon("ArrowLeft")
            iconSize: height - leftPadding * 2
        }

        Label
        {
            Layout.alignment: Qt.AlignmentFlag.AlignVCenter
            Layout.fillWidth: true

            text: detailPage.title
            font: UM.Theme.getFont("large")
            color: UM.Theme.getColor("text")
        }
    }

    Rectangle
    {
        anchors
        {
            top: header.bottom
            topMargin: UM.Theme.getSize("default_margin").height
            left: parent.left
            right: parent.right
            bottom: parent.bottom
        }
        color: UM.Theme.getColor("detail_background")

        ScrollView
        {
            anchors.fill: parent

            clip: true //Need to clip, not for the bottom (which is off the window) but for the top (which would overlap the header).
            ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
            contentHeight: packagePage.height + UM.Theme.getSize("default_margin").height * 2

            PackagePage
            {
                id: packagePage
                anchors
                {
                    left: parent.left
                    leftMargin: UM.Theme.getSize("default_margin").width
                    right: parent.right
                    rightMargin: anchors.leftMargin
                    top: parent.top
                    topMargin: UM.Theme.getSize("default_margin").height
                }

                packageData: detailPage.packageData
            }
        }
    }
}