Modifiers.qml 4.53 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
                    backendValue: backendValues.opacity === undefined ? null : backendValues.opacity
46
					property var backendValueValue: backendValues.opacity.value;
47 48 49 50 51
                    minimumWidth: 60;
                    minimum: 0;
                    maximum: 1;
                    singleStep: 0.1
                    baseStateFlag: isBaseState;
52 53 54
					onBackendValueValueChanged: {
                        opacitySlider.value = backendValue.value * 100;
                    }
55 56
                }
                SliderWidget {
57
					id: opacitySlider
58 59 60
                    minimum: 0
                    maximum: 100
                    singleStep: 5;
61
					backendValue: backendValues.opacity === undefined ? null : backendValues.opacity
62 63 64 65 66 67 68 69 70
                    onValueChanged: {
                        if (backendValues.opacity !== undefined)
                            backendValues.opacity.value = value / 100;
                    }
                }
            }
        }
        QWidget {
            layout: HorizontalLayout {
71

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

                    currentText: backendValues.transformOrigin.value;
                    onItemsChanged: {
                        currentText =  backendValues.transformOrigin.value;
                    }
                    onCurrentTextChanged: {
                        backendValues.transformOrigin.value = currentText;
90 91
                    }
                }
92 93 94 95
            }
        }
        QWidget {
            layout: HorizontalLayout {
96

97
                Label {
98 99
                    text: "Scale"
                }
100

101 102
                DoubleSpinBox {
                    text: ""
103
                    id: scaleSpinBox;
104

105
                    backendValue: backendValues.scale;
106
					property var backendValueValue: backendValues.scale.value;
107 108 109 110 111
                    minimumWidth: 60;
                    minimum: 0.01
                    maximum: 10
                    singleStep: 0.1
                    baseStateFlag: isBaseState;
112
                    onBackendValueValueChanged: {
113
                        scaleSlider.value = backendValue.value * 10;
114 115 116
                    }
                }
                SliderWidget {
117
                    id: scaleSlider;
118
					backendValue: backendValues.scale;
119 120 121
                    minimum: 1;
                    maximum: 100;
                    singleStep: 1;
122
                    onValueChanged: {						
123
                        backendValues.scale.value = value / 10;
124 125 126 127
                    }
                }
            }
        }
128 129 130 131 132 133 134 135 136 137 138 139 140 141
        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;
142
            minimumValue: -100;
143 144
            maximumValue: 100;
        }
145 146
    }
}