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.
Details
Details
- Reviewers
mart - Group Reviewers
Kirigami - Commits
- R169:b5d86e2fc7e7: If a submenu action has an icon set, make sure to also display it
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 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" } } ] } }
Diff Detail
Diff Detail
- Repository
- R169 Kirigami
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.