on xenial help sign in
break the possible endless loop \o/
c5e65a0Lukáš Tinkl
qml/Components/KeymapSwitcher.qml+8−8
@@ -48,6 +48,9 @@ QtObject {
48 nextIndex = currentKeymapIndex + 1;
48 nextIndex = currentKeymapIndex + 1;
49 }
49 }
50 currentKeymapIndex = nextIndex;
50 currentKeymapIndex = nextIndex;
51+ if (actionGroup.currentAction.valid) {
52+ actionGroup.currentAction.updateState(currentKeymapIndex);
53+ }
51 }
54 }
52
55
53 function previousKeymap() {
56 function previousKeymap() {
@@ -57,6 +60,9 @@ QtObject {
57 prevIndex = currentKeymapIndex - 1;
60 prevIndex = currentKeymapIndex - 1;
58 }
61 }
59 currentKeymapIndex = prevIndex;
62 currentKeymapIndex = prevIndex;
63+ if (actionGroup.currentAction.valid) {
64+ actionGroup.currentAction.updateState(currentKeymapIndex);
65+ }
60 }
66 }
61
67
62 property Binding surfaceKeymapBinding: Binding { // NB: needed mainly for xmir & libertine apps
68 property Binding surfaceKeymapBinding: Binding { // NB: needed mainly for xmir & libertine apps
@@ -77,18 +83,12 @@ QtObject {
77 busName: "com.canonical.indicator.keyboard"
83 busName: "com.canonical.indicator.keyboard"
78 objectPath: "/com/canonical/indicator/keyboard"
84 objectPath: "/com/canonical/indicator/keyboard"
79
85
80− property variant currentAction: action("current")
86+ property variant currentAction: action("current") // the one that's checked by the indicator
81− property variant activeAction: action("active")
87+ property variant activeAction: action("active") // the one that we clicked
82
88
83 Component.onCompleted: actionGroup.start();
89 Component.onCompleted: actionGroup.start();
84 }
90 }
85
91
86− onCurrentKeymapIndexChanged: {
87− if (actionGroup.currentAction.valid) {
88− actionGroup.currentAction.updateState(currentKeymapIndex);
89− }
90− }
91−
92 readonly property int activeActionState: actionGroup.activeAction.valid ? actionGroup.activeAction.state : -1
92 readonly property int activeActionState: actionGroup.activeAction.valid ? actionGroup.activeAction.state : -1
93
93
94 onActiveActionStateChanged: {
94 onActiveActionStateChanged: {