Skip to content

Commit 3e02fc6

Browse files
committed
Action cleanups
1 parent b6aa992 commit 3e02fc6

4 files changed

Lines changed: 19 additions & 10 deletions

File tree

action_plugins/map_to_logical_device/MapToLogicalDeviceAction.qml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ Item {
5252

5353
// UI for a physical axis behaving as an axis
5454
Loader {
55-
active: _root.action.logicalInputType == "axis"
55+
active: _root.action.logicalInputType === "axis"
5656
Layout.fillWidth: true
5757

5858
sourceComponent: Row {
5959
RadioButton {
6060
text: "Absolute"
61-
checked: _root.action.axisMode == "absolute"
61+
checked: _root.action.axisMode === "absolute"
6262

6363
onCheckedChanged: {
6464
_root.action.axisMode = "absolute"
@@ -67,7 +67,7 @@ Item {
6767
RadioButton {
6868
id: _relativeMode
6969
text: "Relative"
70-
checked: _root.action.axisMode == "relative"
70+
checked: _root.action.axisMode === "relative"
7171

7272
onCheckedChanged: {
7373
_root.action.axisMode = "relative"
@@ -84,7 +84,7 @@ Item {
8484
visible: _relativeMode.checked
8585
minValue: 0
8686
maxValue: 100
87-
value: 1.0
87+
value: _root.action.axisScaling
8888
stepSize: 0.05
8989

9090
onValueModified: (newValue) => {
@@ -95,7 +95,7 @@ Item {
9595
}
9696
// UI for a button input
9797
Loader {
98-
active: _root.action.logicalInputType == "button"
98+
active: _root.action.logicalInputType === "button"
9999
Layout.fillWidth: true
100100

101101
sourceComponent: Row {

action_plugins/map_to_logical_device/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ def _set_logical_input_identifier(self, identifier: InputIdentifier) -> None:
142142
self._data.logical_input_type = identifier.input_type
143143
self.logicalInputIdentifierChanged.emit()
144144

145+
def _get_logical_input_type(self) -> str:
146+
return InputType.to_string(self._data.logical_input_type)
147+
145148
def _get_axis_mode(self) -> str:
146149
return AxisMode.to_string(self._data.axis_mode)
147150

@@ -176,6 +179,11 @@ def _set_button_inverted(self, button_inverted: bool) -> None:
176179
fset=_set_logical_input_identifier,
177180
notify=logicalInputIdentifierChanged
178181
)
182+
logicalInputType = Property(
183+
str,
184+
fget=_get_logical_input_type,
185+
notify=logicalInputIdentifierChanged
186+
)
179187
axisMode = Property(
180188
str,
181189
fget=_get_axis_mode,
@@ -293,7 +301,7 @@ def _handle_behavior_change(
293301
old_behavior: InputType,
294302
new_behavior: InputType
295303
) -> None:
296-
self._logical_input_type = new_behavior
304+
self.logical_input_type = new_behavior
297305

298306

299307
create = MapToLogicalDeviceData

action_plugins/map_to_vjoy/MapToVjoyAction.qml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ Item {
8888
minValue: 0
8989
maxValue: 100
9090
stepSize: 0.1
91+
value: _root.action.axisScaling
9192

92-
onValueModified: (value) => {
93-
_root.action.axisScaling = value
93+
onValueModified: (newValue) => {
94+
_root.action.axisScaling = newValue
9495
}
9596
}
9697
}

action_plugins/merge_axis/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def _bidirectional(value1: float, value2: float) -> float:
138138
"""Merges two axes into one:
139139
- the 1st axis controls the lower half of the value range
140140
- the 2nd axis controls the upper half
141-
141+
142142
Allows full deflection either way if only one axis is used.
143143
Performs differential mixing if both are used.
144144
@@ -330,7 +330,7 @@ class MergeAxisData(AbstractActionData):
330330
version = 1
331331
name = "Merge Axis"
332332
tag = "merge-axis"
333-
icon = "\uF859"
333+
icon = "\uF85C"
334334

335335
functor = MergeAxisFunctor
336336
model = MergeAxisModel

0 commit comments

Comments
 (0)