~schwann/ubuntu-keyboard/keyboard-delete-words

« back to all changes in this revision

Viewing changes to qml/keys/ActionKey.qml

new action key icons.

Approved by Günter Schwann, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import QtQuick 2.0
18
18
 
 
19
import Ubuntu.Components 0.1
 
20
 
19
21
import "key_constants.js" as UI
20
22
 
21
23
CharKey {
34
36
    imgNormal: UI.imageActionKey
35
37
    imgPressed: UI.imageActionKeyPressed
36
38
 
37
 
    Image {
 
39
    property string __icon: iconNormal
 
40
 
 
41
    // can be overwritten by keys
 
42
    property color colorNormal: "transparent"
 
43
    property color colorShifted: "transparent"
 
44
    property color colorCapsLock: "transparent"
 
45
 
 
46
    Icon {
38
47
        id: iconImage
39
 
        source: iconNormal
 
48
        name: __icon
40
49
        anchors.centerIn: parent
41
50
        visible: (label == "")
 
51
        width: units.gu(2.5)
 
52
        height: units.gu(2.5)
42
53
    }
43
54
 
44
55
    onOskStateChanged: {
45
 
        if (panel.activeKeypadState == "NORMAL")
46
 
            iconImage.source = iconNormal;
47
 
        if (panel.activeKeypadState == "SHIFTED")
48
 
            iconImage.source = iconShifted;
49
 
        if (panel.activeKeypadState == "CAPSLOCK")
50
 
            iconImage.source = iconCapsLock
 
56
        if (panel.activeKeypadState == "NORMAL") {
 
57
            __icon = iconNormal;
 
58
            iconImage.color = colorNormal;
 
59
        } else if (panel.activeKeypadState == "SHIFTED") {
 
60
            __icon = iconShifted;
 
61
            iconImage.color = colorShifted;
 
62
            console.log(colorShifted)
 
63
        } else if (panel.activeKeypadState == "CAPSLOCK") {
 
64
            __icon = iconCapsLock;
 
65
            iconImage.color = colorCapsLock;
 
66
        }
51
67
    }
52
68
}