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

RecommendedQualityProfileSelector.qml « Recommended « PrintSetupSelector « qml « resources - github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bc5826fe7cf8f9450d4b0ae6c0e3bb73698a0654 (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
// Copyright (c) 2022 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 2.10

import UM 1.5 as UM
import Cura 1.7 as Cura
import ".."

Item
{
    id: qualityRow

    property bool hasQualityOptions: true

    height: childrenRect.height
    visible: intentSelectionRepeater.count > 1 && hasQualityOptions //Only show selector if there's more options than just "default".

    RowLayout
    {
        id: intentRow
        width: parent.width

        Repeater
        {
            id: intentSelectionRepeater
            model: Cura.IntentSelectionModel {}

            RecommendedQualityProfileSelectorButton
            {
                profileName: model.name
                icon: model.icon


                selected: Cura.MachineManager.activeIntentCategory == model.intent_category

                onClicked: {
                    var qualityType
                    if (Cura.MachineManager.intentCategoryHasQuality(model.intent_category, Cura.MachineManager.activeQualityType))
                    {
                        qualityType = Cura.MachineManager.activeQualityType
                    } else {
                        qualityType = Cura.MachineManager.getDefaultQualityTypeForIntent(model.intent_category)
                    }
                    Cura.IntentManager.selectIntent(model.intent_category, qualityType)
                }
            }
        }
    }
}