~maliit-team/maliit-plugin-jp/trunk

« back to all changes in this revision

Viewing changes to skeleton/mallit/qml/CandKey.qml

  • Committer: liang
  • Date: 2011-07-20 17:19:53 UTC
  • Revision ID: git-v1:c3d107a6b280a8d2c071bb1df794c7b0a4d4c703
package done

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import QtQuick 1.1
2
 
import com.meego 1.0
3
 
 
4
 
Item {
5
 
    id : key
6
 
    width : 160
7
 
    height : 80
8
 
    /*color : "#00000000"*/
9
 
    property alias keycode_l : key_l.keycode
10
 
    property alias keycode_r : key_r.keycode
11
 
    property alias candString : candButton.text
12
 
    property bool isActive : false
13
 
 
14
 
    Key {
15
 
        id : key_l
16
 
        x : 0
17
 
        y : 0
18
 
        width : key.width / 2
19
 
        height : key.height
20
 
    }
21
 
    Key {
22
 
        id : key_r
23
 
        x : key.width / 2
24
 
        y : 0
25
 
        width : key.width / 2
26
 
        height : key.height
27
 
        keepDown : key.isActive && key_l.down
28
 
    }
29
 
 
30
 
    Button {
31
 
        id : candButton
32
 
        x : 2
33
 
        y : 2
34
 
        width : parent.width - 4
35
 
        height : parent.height - 4
36
 
        /*anchors.fill :parent*/
37
 
        checked : key_l.checked || key_r.checked
38
 
        visible : false
39
 
    }
40
 
 
41
 
    Row {
42
 
        ProxyMouseArea {
43
 
            target : key_l
44
 
            width : key.width / 2
45
 
            height : key.height
46
 
        }
47
 
        ProxyMouseArea {
48
 
            target : key_r
49
 
            width : key.width / 2
50
 
            height : key.height
51
 
        }
52
 
    }
53
 
 
54
 
    states {
55
 
        State {
56
 
            name : "CAND" ; when : candString != ""
57
 
            PropertyChanges { target : key ; isActive : true }
58
 
            PropertyChanges { target : key_l ; text : candString }
59
 
            PropertyChanges { target : key_r ; text : candString }
60
 
            PropertyChanges { target : key_l ; x : key.width / 4 }
61
 
            PropertyChanges { target : key_r ; x : key.width / 4 }
62
 
            PropertyChanges { target : key_l ; visible : false }
63
 
            PropertyChanges { target : key_r ; visible : false }
64
 
            PropertyChanges { target : candButton ; visible : true }
65
 
        } 
66
 
    }
67
 
}