Transformation.qml 3.77 KB
Newer Older
1
import Qt 4.7
2 3 4 5
import Bauhaus 1.0

GroupBox {
    finished: finishedNotify;
6
    caption: qsTr("Transformation")
7 8 9
    maximumHeight: 200;
    id: transformation;

10
    layout: VerticalLayout {
11 12 13 14
        QWidget {
            layout: HorizontalLayout {

                Label {
15
                    text: qsTr("Origin")
16
                }
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
                OriginWidget {
                    id: originWidget
                    
                    contextMenuPolicy: "Qt::ActionsContextMenu"
                    origin: backendValues.transformOrigin.value
                    onOriginChanged: {
                        backendValues.transformOrigin.value = origin;
                    }
                    marked: backendValues.transformOrigin.isInSubState
                    
                    ExtendedFunctionButton {
                        backendValue: backendValues.transformOrigin
                        y: 2
                        x: 56
                        visible: originWidget.enabled
                    }
                    
                    actions:  [
35
                        QAction { text: qsTr("Top left"); onTriggered: originWidget.origin = "TopLeft"; },
36
                        QAction { text: qsTr("Top"); onTriggered: originWidget.origin = "Top"; },
37
                        QAction { text: qsTr("Top right"); onTriggered: originWidget.origin = "TopRight"; },
38 39 40
                        QAction { text: qsTr("Left"); onTriggered: originWidget.origin = "Left"; },
                        QAction {text: qsTr("Center"); onTriggered: originWidget.origin = "Center"; },
                        QAction { text: qsTr("Right"); onTriggered: originWidget.origin = "Right"; },
41
                        QAction { text: qsTr("Bottom left"); onTriggered: originWidget.origin = "BottomLeft"; },
42
                        QAction { text: qsTr("Bottom"); onTriggered: originWidget.origin = "Bottom"; },
43
                        QAction { text: qsTr("Bottom right"); onTriggered: originWidget.origin = "BottomRight"; }
44
                    ]
45 46 47 48 49 50 51
                }
            }
        }
        QWidget {
            layout: HorizontalLayout {

                Label {
52
                    text: qsTr("Scale")
53 54 55 56 57 58 59
                }

                DoubleSpinBox {
                    text: ""
                    id: scaleSpinBox;

                    backendValue: backendValues.scale;
60
                    property variant backendValueValue: backendValues.scale.value;
61 62 63 64
                    minimumWidth: 60;
                    minimum: 0.01
                    maximum: 10
                    singleStep: 0.1
65
                    baseStateFlag: isBaseState;                    
66 67 68 69
                }
                SliderWidget {
                    id: scaleSlider;
                    backendValue: backendValues.scale;
70
                    property variant pureValue: backendValues.scale.value;
71
                    onPureValueChanged: {
72
                        if (value != pureValue * 10)
73
                            value = pureValue * 10;
74
                    }
75
                    minimum: 1;
76
                    maximum: 10;
77 78
                    singleStep: 1;
                    onValueChanged: {
79
                        if ((value > 0) && (value < 11))
80
                            backendValues.scale.value = value / 10;
81 82 83 84 85 86
                    }
                }
            }
        }
        IntEditor {
            backendValue: backendValues.rotation
87
            caption: qsTr("Rotation")
88 89
            baseStateFlag: isBaseState;
            step: 10;
90
            minimumValue: -360;
91 92 93 94
            maximumValue: 360;
        }

        IntEditor {
95
            backendValue: backendValues.z
96 97 98 99 100 101 102 103
            caption: "z"
            baseStateFlag: isBaseState;
            step: 1;
            minimumValue: -100;
            maximumValue: 100;
        }
    }
}