Commit f66f1c76 authored by Michael Abrahams's avatar Michael Abrahams

Rework shortcut internals

Summary: Here is a diff which contains my local work done so far.  Although there is always more work to do to get the internals looking cleaner, I think the core is now in an acceptable state. The primary step after this will be to implement loading and saving.  Once that is finished, schemes support should be straightforward to implement.

Reviewers: rempt

Maniphest Tasks: T947

Differential Revision: https://phabricator.kde.org/D498
parent e295307d
......@@ -198,7 +198,7 @@ endif ()
install(TARGETS krita ${INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS krita.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES krita.rc DESTINATION ${DATA_INSTALL_DIR}/krita)
install(FILES krita.action DESTINATION ${DATA_INSTALL_DIR}/krita/actions)
install(FILES krita.action kritamenu.action DESTINATION ${DATA_INSTALL_DIR}/krita/actions)
install(FILES krita.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata/ )
if (NOT APPLE AND HAVE_OPENGL AND Qt5Quick_FOUND)
......
......@@ -74,7 +74,9 @@ use constant CONTEXT_SPEC =>
"label" => [30, []],
},
"action" => {
"action" => [20, ["name"]],
"ActionCollection" => [10, ["name"]],
"Actions" => [20, ["category"]],
"Action" => [30, ["name"]],
}
};
......
<?xml version="1.0" encoding="UTF-8"?>
<Actions version="2" name="ArtisticTextTool">
<Action name="artistictext_subscript">
<iconText>Subscript</iconText>
<shortcut></shortcut>
<toolTip>Subscript</toolTip>
<icon>format-text-subscript</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Subscript</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_detach_from_path">
<iconText>Detach Path</iconText>
<shortcut></shortcut>
<toolTip>Detach Path</toolTip>
<icon>artistictext-detach-path</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Detach Path</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_font_italic">
<iconText>Italic text</iconText>
<shortcut></shortcut>
<toolTip>Italic text</toolTip>
<icon>format-text-italic</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Italic text</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_anchor_middle">
<iconText>Anchor at Middle</iconText>
<shortcut></shortcut>
<toolTip>Anchor at Middle</toolTip>
<icon>format-justify-center</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Anchor at Middle</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_anchor_end">
<iconText>Anchor at End</iconText>
<shortcut></shortcut>
<toolTip>Anchor at End</toolTip>
<icon>format-justify-right</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Anchor at End</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_convert_to_path">
<iconText>Convert to Path</iconText>
<shortcut></shortcut>
<toolTip>Convert to Path</toolTip>
<icon>pathshape</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Convert to Path</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_anchor_start">
<iconText>Anchor at Start</iconText>
<shortcut></shortcut>
<toolTip>Anchor at Start</toolTip>
<icon>format-justify-left</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Anchor at Start</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_font_bold">
<iconText>Bold text</iconText>
<shortcut></shortcut>
<toolTip>Bold text</toolTip>
<icon>format-text-bold</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Bold text</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="edit_deselect_all">
<iconText>Deselect</iconText>
<shortcut>Ctrl+Shift+A</shortcut>
<toolTip>Deselect</toolTip>
<icon></icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Dese&amp;lect</text>
<defaultShortcut>Ctrl+Shift+A</defaultShortcut>
</Action>
<Action name="artistictext_superscript">
<iconText>Superscript</iconText>
<shortcut></shortcut>
<toolTip>Superscript</toolTip>
<icon>format-text-superscript</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Superscript</text>
<defaultShortcut></defaultShortcut>
</Action>
</Actions>
<ActionCollection version="2" name="Tools">
<Actions category="Artistic Text Tool">
<text>Artistic Text Tool</text>
<Action name="artistictext_subscript">
<iconText>Subscript</iconText>
<shortcut></shortcut>
<toolTip>Subscript</toolTip>
<icon>format-text-subscript</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Subscript</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_detach_from_path">
<iconText>Detach Path</iconText>
<shortcut></shortcut>
<toolTip>Detach Path</toolTip>
<icon>artistictext-detach-path</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Detach Path</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_font_italic">
<iconText>Italic text</iconText>
<shortcut></shortcut>
<toolTip>Italic text</toolTip>
<icon>format-text-italic</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Italic text</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_anchor_middle">
<iconText>Anchor at Middle</iconText>
<shortcut></shortcut>
<toolTip>Anchor at Middle</toolTip>
<icon>format-justify-center</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Anchor at Middle</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_anchor_end">
<iconText>Anchor at End</iconText>
<shortcut></shortcut>
<toolTip>Anchor at End</toolTip>
<icon>format-justify-right</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Anchor at End</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_convert_to_path">
<iconText>Convert to Path</iconText>
<shortcut></shortcut>
<toolTip>Convert to Path</toolTip>
<icon>pathshape</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Convert to Path</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_anchor_start">
<iconText>Anchor at Start</iconText>
<shortcut></shortcut>
<toolTip>Anchor at Start</toolTip>
<icon>format-justify-left</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Anchor at Start</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="artistictext_font_bold">
<iconText>Bold text</iconText>
<shortcut></shortcut>
<toolTip>Bold text</toolTip>
<icon>format-text-bold</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Bold text</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="edit_deselect_all">
<iconText>Deselect</iconText>
<shortcut>Ctrl+Shift+A</shortcut>
<toolTip>Deselect</toolTip>
<icon></icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Dese&amp;lect</text>
<defaultShortcut>Ctrl+Shift+A</defaultShortcut>
</Action>
<Action name="artistictext_superscript">
<iconText>Superscript</iconText>
<shortcut></shortcut>
<toolTip>Superscript</toolTip>
<icon>format-text-superscript</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Superscript</text>
<defaultShortcut></defaultShortcut>
</Action>
</Actions>
</ActionCollection>
......@@ -3,4 +3,6 @@ install( FILES
InteractionTool.action
PathTool.action
TextTool.action
ConnectionTool.action
ReferencesTool.action
DESTINATION ${DATA_INSTALL_DIR}/krita/actions)
<?xml version="1.0" encoding="UTF-8"?>
<ActionCollection version="2" name="Tools">
<Actions category="connection-tool">
<text>Connection Tool</text>
<Action name="toggle-edit-mode">
<iconText>Edit connection points</iconText>
<shortcut></shortcut>
<toolTip>Edit connection points</toolTip>
<icon>path-break-segment</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Edit connection points</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="align-relative">
<iconText>%</iconText>
<shortcut></shortcut>
<toolTip>%</toolTip>
<icon>path-break-segment</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>%</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="align-left">
<iconText>Align to left edge</iconText>
<shortcut></shortcut>
<toolTip>Align to left edge</toolTip>
<icon>align-horizontal-left</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Align to left edge</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="align-centerh">
<iconText>Align to horizontal center</iconText>
<shortcut></shortcut>
<toolTip>Align to horizontal center</toolTip>
<icon>align-horizontal-center</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Align to horizontal center</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="align-right">
<iconText>Align to right edge</iconText>
<shortcut></shortcut>
<toolTip>Align to right edge</toolTip>
<icon>align-horizontal-right</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Align to right edge</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="align-top">
<iconText>Align to top edge</iconText>
<shortcut></shortcut>
<toolTip>Align to top edge</toolTip>
<icon>align-vertical-top</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Align to top edge</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="align-centerv">
<iconText>Align to vertical center</iconText>
<shortcut></shortcut>
<toolTip>Align to vertical center</toolTip>
<icon>align-vertical-center</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Align to vertical center</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="align-bottom">
<iconText>Align to bottom edge</iconText>
<shortcut></shortcut>
<toolTip>Align to bottom edge</toolTip>
<icon>align-vertical-bottom</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Align to bottom edge</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="escape-all">
<iconText>Escape in all directions</iconText>
<shortcut></shortcut>
<toolTip>Escape in all directions</toolTip>
<icon>escape-direction-all</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Escape in all directions</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="escape-horizontal">
<iconText>Escape in horizontal directions</iconText>
<shortcut></shortcut>
<toolTip>Escape in horizontal directions</toolTip>
<icon>escape-direction-horizontal</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Escape in horizontal directions</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="escape-vertical">
<iconText>Escape in vertical directions</iconText>
<shortcut></shortcut>
<toolTip>Escape in vertical directions</toolTip>
<icon>escape-direction-vertical</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Escape in vertical directions</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="escape-left">
<iconText>Escape in left direction</iconText>
<shortcut></shortcut>
<toolTip>Escape in left direction</toolTip>
<icon>escape-direction-left</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Escape in left direction</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="escape-right">
<iconText>Escape in right direction</iconText>
<shortcut></shortcut>
<toolTip>Escape in right direction</toolTip>
<icon>escape-direction-right</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Escape in right direction</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="escape-up">
<iconText>Escape in up direction</iconText>
<shortcut></shortcut>
<toolTip>Escape in up direction</toolTip>
<icon>escape-direction-up</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Escape in up direction</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="escape-down">
<iconText>Escape in down direction</iconText>
<shortcut></shortcut>
<toolTip>Escape in down direction</toolTip>
<icon>escape-direction-down</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>true</isCheckable>
<text>Escape in down direction</text>
<defaultShortcut></defaultShortcut>
</Action>
</Actions>
</ActionCollection>
<?xml version="1.0" encoding="UTF-8"?>
<Actions version="2" name="InteractionTool">
<Action name="object_order_raise">
<iconText>Raise</iconText>
<shortcut>Ctrl+]</shortcut>
<toolTip>Raise</toolTip>
<icon>object-order-raise-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>&amp;Raise</text>
<defaultShortcut>Ctrl+]</defaultShortcut>
</Action>
<Action name="object_align_horizontal_right">
<iconText>Align Right</iconText>
<shortcut></shortcut>
<toolTip>Align Right</toolTip>
<icon>object-align-horizontal-right-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Align Right</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="object_ungroup">
<iconText>Ungroup</iconText>
<shortcut></shortcut>
<toolTip>Ungroup</toolTip>
<icon>object-ungroup-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Ungroup</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="object_order_back">
<iconText>Send to Back</iconText>
<shortcut>Ctrl+Shift+[</shortcut>
<toolTip>Send to Back</toolTip>
<icon>object-order-back-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Send to &amp;Back</text>
<defaultShortcut>Ctrl+Shift+[</defaultShortcut>
</Action>
<Action name="object_order_front">
<iconText>Bring to Front</iconText>
<shortcut>Ctrl+Shift+]</shortcut>
<toolTip>Bring to Front</toolTip>
<icon>object-order-front-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Bring to &amp;Front</text>
<defaultShortcut>Ctrl+Shift+]</defaultShortcut>
</Action>
<Action name="object_align_vertical_center">
<iconText>Vertically Center</iconText>
<shortcut></shortcut>
<toolTip>Vertically Center</toolTip>
<icon>object-align-vertical-center-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Vertically Center</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="object_group">
<iconText>Group</iconText>
<shortcut></shortcut>
<toolTip>Group</toolTip>
<icon>object-group-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Group</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="object_align_horizontal_left">
<iconText>Align Left</iconText>
<shortcut></shortcut>
<toolTip>Align Left</toolTip>
<icon>object-align-horizontal-left-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Align Left</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="object_align_vertical_top">
<iconText>Align Top</iconText>
<shortcut></shortcut>
<toolTip>Align Top</toolTip>
<icon>object-align-vertical-top-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Align Top</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="object_align_horizontal_center">
<iconText>Horizontally Center</iconText>
<shortcut></shortcut>
<toolTip>Horizontally Center</toolTip>
<icon>object-align-horizontal-center-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Horizontally Center</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="object_order_lower">
<iconText>Lower</iconText>
<shortcut>Ctrl+[</shortcut>
<toolTip>Lower</toolTip>
<icon>object-order-lower-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>&amp;Lower</text>
<defaultShortcut>Ctrl+[</defaultShortcut>
</Action>
<Action name="object_align_vertical_bottom">
<iconText>Align Bottom</iconText>
<shortcut></shortcut>
<toolTip>Align Bottom</toolTip>
<icon>object-align-vertical-bottom-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Align Bottom</text>
<defaultShortcut></defaultShortcut>
</Action>
</Actions>
<ActionCollection version="2" name="Tools">
<Actions category="Interaction Tool">
<text>Interaction Tool</text>
<Action name="object_order_raise">
<iconText>Raise</iconText>
<shortcut>Ctrl+]</shortcut>
<toolTip>Raise</toolTip>
<icon>object-order-raise-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>&amp;Raise</text>
<defaultShortcut>Ctrl+]</defaultShortcut>
</Action>
<Action name="object_align_horizontal_right">
<iconText>Align Right</iconText>
<shortcut></shortcut>
<toolTip>Align Right</toolTip>
<icon>object-align-horizontal-right-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Align Right</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="object_ungroup">
<iconText>Ungroup</iconText>
<shortcut></shortcut>
<toolTip>Ungroup</toolTip>
<icon>object-ungroup-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Ungroup</text>
<defaultShortcut></defaultShortcut>
</Action>
<Action name="object_order_back">
<iconText>Send to Back</iconText>
<shortcut>Ctrl+Shift+[</shortcut>
<toolTip>Send to Back</toolTip>
<icon>object-order-back-calligra</icon>
<whatsThis></whatsThis>
<statusTip></statusTip>
<isCheckable>false</isCheckable>
<text>Send to &amp;Back</text>
<defaultShortcut>Ctrl+Shift+[</defaultShortcut>
</Action>
<Action name="object_order_front">
<iconText>Bring to Front</iconText>
<shortcut>Ctrl+Shift+]</shortcut>