Changeset View
Changeset View
Standalone View
Standalone View
org.kde.desktop/MenuItem.qml
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 77 | Label { | |||
---|---|---|---|---|---|
82 | text: controlRoot.Kirigami.MnemonicData.richTextLabel | 82 | text: controlRoot.Kirigami.MnemonicData.richTextLabel | ||
83 | font: controlRoot.font | 83 | font: controlRoot.font | ||
84 | color: (controlRoot.highlighted || controlRoot.hovered) ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor | 84 | color: (controlRoot.highlighted || controlRoot.hovered) ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor | ||
85 | elide: Text.ElideRight | 85 | elide: Text.ElideRight | ||
86 | visible: controlRoot.text | 86 | visible: controlRoot.text | ||
87 | horizontalAlignment: Text.AlignLeft | 87 | horizontalAlignment: Text.AlignLeft | ||
88 | verticalAlignment: Text.AlignVCenter | 88 | verticalAlignment: Text.AlignVCenter | ||
89 | } | 89 | } | ||
90 | Label { | ||||
91 | id: shortcut | ||||
92 | Layout.alignment: Qt.AlignVCenter | ||||
93 | | ||||
94 | visible: controlRoot.action && controlRoot.action.hasOwnProperty("shortcut") && controlRoot.action.shortcut !== undefined | ||||
95 | text: visible ? controlRoot.action.shortcut : "" | ||||
96 | font: controlRoot.font | ||||
97 | color: label.color | ||||
98 | horizontalAlignment: Text.AlignRight | ||||
apol: label.color? | |||||
99 | verticalAlignment: Text.AlignVCenter | ||||
100 | } | ||||
101 | Item { | ||||
102 | Layout.preferredWidth: Kirigami.Units.smallSpacing | ||||
103 | } | ||||
Use Layout.rightMargin on the shortcut object. apol: Use Layout.rightMargin on the shortcut object.
https://doc.qt.io/qt-5/qml-qtquick-layouts… | |||||
I think the original approach to use an Item was correct, both because now it looks wrong, but also because using an Item makes the layout automatically RTL compatible, while setting the right padding property requires conditional handling for the reversed case. ngraham: I think the original approach to use an Item was correct, both because now it looks wrong, but… | |||||
90 | } | 104 | } | ||
91 | 105 | | |||
92 | //we can't use arrow: on old qqc2 releases | 106 | //we can't use arrow: on old qqc2 releases | ||
93 | @DISABLE_UNDER_QQC2_2_3@ arrow: Kirigami.Icon { | 107 | @DISABLE_UNDER_QQC2_2_3@ arrow: Kirigami.Icon { | ||
94 | @DISABLE_UNDER_QQC2_2_3@ x: controlRoot.mirrored ? controlRoot.padding : controlRoot.width - width - controlRoot.padding | 108 | @DISABLE_UNDER_QQC2_2_3@ x: controlRoot.mirrored ? controlRoot.padding : controlRoot.width - width - controlRoot.padding | ||
95 | @DISABLE_UNDER_QQC2_2_3@ y: controlRoot.topPadding + (controlRoot.availableHeight - height) / 2 | 109 | @DISABLE_UNDER_QQC2_2_3@ y: controlRoot.topPadding + (controlRoot.availableHeight - height) / 2 | ||
96 | @DISABLE_UNDER_QQC2_2_3@ source: controlRoot.mirrored ? "go-next-symbolic-rtl" : "go-next-symbolic" | 110 | @DISABLE_UNDER_QQC2_2_3@ source: controlRoot.mirrored ? "go-next-symbolic-rtl" : "go-next-symbolic" | ||
97 | @DISABLE_UNDER_QQC2_2_3@ selected: controlRoot.highlighted | 111 | @DISABLE_UNDER_QQC2_2_3@ selected: controlRoot.highlighted | ||
Show All 25 Lines |
label.color?