Modifiers.qml 4.29 KB
Newer Older
1
import Qt 4.6
2
import Bauhaus 1.0
3 4 5

GroupBox {
    finished: finishedNotify;
6 7
    caption: "Manipulation"
    maximumHeight: 200;
8
    minimumHeight: 180;
9
    id: mofifiers;
10

11
    layout: VerticalLayout {        
12 13

        QWidget {
14
            layout: HorizontalLayout {
15
                Label {
16 17
                    text: "Visibility"
                }
18

19
                CheckBox {
20
                    id: visibleCheckBox;
21 22 23 24 25 26
                    text: "Is visible";
                    backendValue: backendValues.visible === undefined ? false : backendValues.visible;
                    baseStateFlag: isBaseState;
                    checkable: true;
                }
                CheckBox {
27
                    id: clipCheckBox;
28
                    text: "Clip Content";
29 30 31 32 33 34 35 36
                    backendValue: backendValues.clip === undefined ? false : backendValues.clip;
                    baseStateFlag: isBaseState;
                    checkable: true;
                }
            }
        }
        QWidget {
            layout: HorizontalLayout {
37

38
                Label {
39 40
                    text: "Opacity"
                }
41

42 43
                DoubleSpinBox {
                    text: ""
44
                    id: opacitySpinBox;
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
                    backendValue: backendValues.opacity === undefined ? null : backendValues.opacity
                    minimumWidth: 60;
                    minimum: 0;
                    maximum: 1;
                    singleStep: 0.1
                    baseStateFlag: isBaseState;
                }
                SliderWidget {
                    minimum: 0
                    maximum: 100
                    singleStep: 5;
                    value: backendValues.opacity === undefined ? 0 : (backendValues.opacity.value * 100)
                    onValueChanged: {
                        if (backendValues.opacity !== undefined)
                            backendValues.opacity.value = value / 100;
                    }
                }
            }
        }
        QWidget {
            layout: HorizontalLayout {
66

67
                Label {
68 69
                    text: "Origin";
                }
70
                ComboBox {
71
                    minimumWidth: 20
72 73
					
					backendValue: backendValues.transformOrigin
74 75 76 77 78 79 80 81 82 83 84
                    items : { [
                        "TopLeft", "Top", "TopRight", "Left", "Center", "Right", "BottomLeft", "Bottom",
                        "BottomRight"
                        ] }

                    currentText: backendValues.transformOrigin.value;
                    onItemsChanged: {
                        currentText =  backendValues.transformOrigin.value;
                    }
                    onCurrentTextChanged: {
                        backendValues.transformOrigin.value = currentText;
85 86
                    }
                }
87 88 89 90
            }
        }
        QWidget {
            layout: HorizontalLayout {
91

92
                Label {
93 94
                    text: "Scale"
                }
95

96 97
                DoubleSpinBox {
                    text: ""
98
                    id: scaleSpinBox;
99

100
                    backendValue: backendValues.scale;
101
					property var backendValueValue: backendValues.scale.value;
102 103 104 105 106
                    minimumWidth: 60;
                    minimum: 0.01
                    maximum: 10
                    singleStep: 0.1
                    baseStateFlag: isBaseState;
107
                    onBackendValueValueChanged: {
108
                        scaleSlider.value = backendValue.value * 10;
109 110 111
                    }
                }
                SliderWidget {
112
                    id: scaleSlider;
113 114 115
                    minimum: 1;
                    maximum: 100;
                    singleStep: 1;
116
                    onValueChanged: {						
117
                        backendValues.scale.value = value / 10;
118 119 120 121
                    }
                }
            }
        }
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
        IntEditor {
            backendValue: backendValues.rotation
            caption: "Rotation"
            baseStateFlag: isBaseState;
            step: 10;
            minimumValue: 0;
            maximumValue: 360;
        }

        IntEditor {
            backendValue: backendValues.z == undefined ? 0 : backendValues.z
            caption: "z"
            baseStateFlag: isBaseState;
            step: 1;
            minimumValue: 0;
            maximumValue: 100;
        }
139 140
    }
}