Add shortcut keys to HMD menu

This commit is contained in:
David Rowe 2016-03-12 12:53:16 +13:00
parent ecf67282d5
commit 9da64e540d
2 changed files with 13 additions and 2 deletions

View file

@ -81,15 +81,25 @@ Item {
}
Item {
// Space for shortcut key or disclosure icon.
id: tail
width: 48
width: 48 + (shortcut.visible ? shortcut.width : 0)
anchors {
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: hifi.dimensions.menuPadding.x
}
RalewayLight {
id: shortcut
text: source.shortcut ? source.shortcut : ""
size: hifi.fontSizes.shortcutText
color: hifi.colors.baseGrayShadow
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 15
visible: source.visible && text != ""
}
HiFiGlyphs {
text: hifi.glyphs.disclosureExpand
color: source.enabled ? hifi.colors.baseGrayShadow : hifi.colors.baseGrayShadow25

View file

@ -104,6 +104,7 @@ void updateQmlItemFromAction(QObject* target, QAction* source) {
target->setProperty("checkable", source->isCheckable());
target->setProperty("enabled", source->isEnabled());
target->setProperty("text", source->text());
target->setProperty("shortcut", source->shortcut().toString());
target->setProperty("checked", source->isChecked());
target->setProperty("visible", source->isVisible());
}