D23501: If a submenu action has an icon set, make sure to also display it
Arjen Hiemstra
noreply at phabricator.kde.org
Tue Aug 27 17:49:32 BST 2019
ahiemstra created this revision.
ahiemstra added reviewers: Kirigami, mart.
Herald added a project: Kirigami.
Herald added a subscriber: plasma-devel.
ahiemstra requested review of this revision.
REVISION SUMMARY
QQC2's Menu does not support icons, but the MenuItem that gets created
when it is used as a submenu does. Since we already have a reference to
that MenuItem, also update the MenuItem's icon property with those of
the Action. This way submenus will properly display icons if set.
TEST PLAN
The following test code, ran through qmlscene, should produce a context menu
with icons for both entries, even though one of them is a menu.
Note that you will need D23499 <https://phabricator.kde.org/D23499> for the context menu button to show up again.
import QtQuick 2.12
import QtQuick.Controls 2.12
import org.kde.kirigami 2.8 as Kirigami
Kirigami.ApplicationWindow {
pageStack.initialPage: Kirigami.Page {
actions.main: Kirigami.Action { text: "Main"; icon.name: "document-new" }
actions.contextualActions: [
Kirigami.Action { text: "Action 1"; icon.name: "document-new" },
Kirigami.Action {
text: "Action 2"
icon.name: "document-new"
Kirigami.Action { text: "Nested Action" }
}
]
}
}
REPOSITORY
R169 Kirigami
BRANCH
actionmenu_icons
REVISION DETAIL
https://phabricator.kde.org/D23501
AFFECTED FILES
src/controls/private/ActionsMenu.qml
To: ahiemstra, #kirigami, mart
Cc: plasma-devel, fbampaloukas, GB_2, domson, dkardarakos, apol, davidedmundson, mart, hein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190827/6e13beaf/attachment.html>
More information about the Plasma-devel
mailing list