~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-private-shapes

« back to all changes in this revision

Viewing changes to tests/resources/ubuntushape/FrameTest.qml

  • Committer: Loïc Molinari
  • Date: 2016-01-12 22:10:21 UTC
  • Revision ID: loic.molinari@canonical.com-20160112221021-yjj2hej5347pheyd
Renamed StrokeRectangle to Frame.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    focus: true
26
26
 
27
27
    property string textOverlayString:
28
 
        "weight   (w/W): " + stroke.weight.toFixed(1) + "\n" +
29
 
        "radius   (r/R): " + stroke.radius.toFixed(1) + "\n" +
30
 
        "color      (c): " + stroke.color + "\n" +
31
 
        "opacity  (o/O): " + stroke.opacity.toFixed(2) + "\n"
 
28
        "weight   (w/W): " + frame.weight.toFixed(1) + "\n" +
 
29
        "radius   (r/R): " + frame.radius.toFixed(1) + "\n" +
 
30
        "color      (c): " + frame.color + "\n" +
 
31
        "opacity  (o/O): " + frame.opacity.toFixed(2) + "\n"
32
32
 
33
33
    Item {
34
34
        id: scene
35
35
        anchors.fill: parent
36
36
 
37
 
        StrokeShape {
38
 
            id: stroke
 
37
        Frame {
 
38
            id: frame
39
39
            anchors.fill: parent
40
40
            anchors.margins: 100.0
41
41
            color: "blue"
59
59
    Keys.onPressed: {
60
60
        var shift = event.modifiers & Qt.ShiftModifier;
61
61
        if (event.key == Qt.Key_W) {
62
 
            stroke.weight = stroke.weight + (shift ? 1.0 : -1.0);
 
62
            frame.weight = frame.weight + (shift ? 1.0 : -1.0);
63
63
        } else if (event.key == Qt.Key_R) {
64
 
            stroke.radius = stroke.radius + (shift ? 1.0 : -1.0);
 
64
            frame.radius = frame.radius + (shift ? 1.0 : -1.0);
65
65
        } else if (event.key == Qt.Key_C) {
66
 
            stroke.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1.0);
 
66
            frame.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1.0);
67
67
        } else if (event.key == Qt.Key_O) {
68
 
            stroke.opacity = stroke.opacity + (shift ? 0.02 : -0.02);
 
68
            frame.opacity = frame.opacity + (shift ? 0.02 : -0.02);
69
69
        }
70
70
    }
71
71
}