Commit 2f18ccbd authored by Noah Davis's avatar Noah Davis 🌵
Browse files

[MenuItem] Set reserve space properties in MenuItem

parent 6eaba9b2
......@@ -14,10 +14,27 @@ import "impl"
T.MenuItem {
id: control
property bool __reserveSpaceForIndicator: true
property bool __reserveSpaceForIcon: false
property bool __reserveSpaceForArrow: true
Kirigami.Theme.colorSet: Kirigami.Theme.Button
property bool __reserveSpaceForIndicator: {
if (menu && menu.hasOwnProperty("__hasIndicators")) {
menu.__hasIndicators |= indicator && indicator.visible
return menu.__hasIndicators
}
return false
}
property bool __reserveSpaceForIcon: {
if (menu && menu.hasOwnProperty("__hasIcons")) {
menu.__hasIcons |= contentItem && contentItem.hasIcon
return menu.__hasIcons
}
return false
}
property bool __reserveSpaceForArrow: {
if (menu && menu.hasOwnProperty("__hasArrows")) {
menu.__hasArrows |= arrow && arrow.visible
return menu.__hasArrows
}
return false
}
Kirigami.Theme.colorSet: control.down || control.highlighted ? Kirigami.Theme.Button : -1
Kirigami.Theme.inherit: !background || !background.visible && !(control.highlighted || control.down)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment