There is no way to unset action 'shortcut' property
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical System Image |
Fix Released
|
Critical
|
Zoltan Balogh | ||
ubuntu-ui-toolkit (Ubuntu RTM) |
Fix Released
|
Critical
|
Zsombor Egri |
Bug Description
Since all the actions are enabled and active by default (causing the Ambiguous bug#1514856) I implement a workaround in my app to disable action shortcuts if the page is not active. Something like:
shortcut: page.active ? "Esc" : ""
The problem is, that I am receiving serveral error messages on terminal while running the app:
"QML Action: Invalid shortcut:"
-------
Note: the shortcut (and any property that can be reset) should be cleared/reset using undefined. So the above binding should look like:
shortcut: page.active ? "Esc" : undefined
Note2: actions added to any ActionItem derived type will automatically activate/deactivate depending on the page or dialog activation. This means that those Actions which are in an inactive Page will not be active, so there will be no need for the above binding.
Related branches
- Cris Dywan: Approve
- PS Jenkins bot: Approve (continuous-integration)
-
Diff: 94 lines (+33/-2)3 files modifiedsrc/Ubuntu/Components/plugin/ucaction.cpp (+14/-0)
src/Ubuntu/Components/plugin/ucaction.h (+3/-1)
tests/unit_x11/tst_components/tst_shortcuts.qml (+16/-1)
Changed in ubuntu-ui-toolkit (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Confirmed |
tags: | added: contextual-actions |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
status: | Confirmed → In Progress |
description: | updated |
Changed in canonical-devices-system-image: | |
milestone: | none → ww02-2016 |
assignee: | nobody → Zoltan Balogh (bzoltan) |
importance: | Undecided → Critical |
status: | New → In Progress |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in canonical-devices-system-image: | |
status: | In Progress → Fix Committed |
affects: | ubuntu-ui-toolkit (Ubuntu) → ubuntu-ui-toolkit (Ubuntu RTM) |
Changed in canonical-devices-system-image: | |
status: | Fix Committed → Fix Released |
as workaround you can disable the action instead of trying to clear the shortcut value.