~lukas-kde/unity8/dashboard

« back to all changes in this revision

Viewing changes to qml/Components/KeymapSwitcher.qml

  • Committer: Lukáš Tinkl
  • Date: 2017-01-26 12:13:17 UTC
  • mfrom: (2749.1.49 unity8)
  • Revision ID: lukas.tinkl@canonical.com-20170126121317-qms39s9pikclidbe
merge trunk, fix conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
            nextIndex = currentKeymapIndex + 1;
52
52
        }
53
53
        currentKeymapIndex = nextIndex;
 
54
        if (actionGroup.currentAction.valid) {
 
55
            actionGroup.currentAction.updateState(currentKeymapIndex);
 
56
        }
54
57
    }
55
58
 
56
59
    function previousKeymap() {
60
63
            prevIndex = currentKeymapIndex - 1;
61
64
        }
62
65
        currentKeymapIndex = prevIndex;
 
66
        if (actionGroup.currentAction.valid) {
 
67
            actionGroup.currentAction.updateState(currentKeymapIndex);
 
68
        }
63
69
    }
64
70
 
65
 
    property Binding surfaceKeymapBinding: Binding {
 
71
    property Binding surfaceKeymapBinding: Binding { // NB: needed mainly for xmir & libertine apps
66
72
        target: root.focusedSurface
67
73
        property: "keymap"
68
74
        value: root.currentKeymap
69
75
    }
70
76
 
 
77
    property Binding unityKeymapBinding: Binding {
 
78
        target: Mir
 
79
        property: "currentKeymap"
 
80
        value: root.currentKeymap
 
81
    }
 
82
 
71
83
    // indicator
72
84
    property QDBusActionGroup actionGroup: QDBusActionGroup {
73
85
        busType: DBus.SessionBus
74
86
        busName: "com.canonical.indicator.keyboard"
75
87
        objectPath: "/com/canonical/indicator/keyboard"
76
88
 
77
 
        property variant currentAction: action("current")
78
 
        property variant activeAction: action("active")
 
89
        property variant currentAction: action("current") // the one that's checked by the indicator
 
90
        property variant activeAction: action("active")   // the one that we clicked
79
91
 
80
92
        Component.onCompleted: actionGroup.start();
81
93
    }
82
94
 
83
 
    onCurrentKeymapIndexChanged: {
84
 
        actionGroup.currentAction.updateState(currentKeymapIndex);
85
 
    }
86
 
 
87
95
    readonly property int activeActionState: actionGroup.activeAction.valid ? actionGroup.activeAction.state : -1
88
96
 
89
97
    onActiveActionStateChanged: {