@@ -12,6 +12,9 @@ MenuItem {
1212 implicitHeight: menu .hideDisabledItems && ! enabled ? 0 : 38
1313 objectName: action ? action .objectName : " StatusMenuItemDelegate"
1414
15+ spacing: 4
16+ horizontalPadding: 8
17+
1518// property int subMenuIndex
1619// property var statusPopupMenu: null
1720
@@ -33,6 +36,7 @@ MenuItem {
3336
3437 readonly property bool isSubMenu: !! root .subMenu
3538 readonly property bool isStatusSubMenu: isSubMenu && (root .subMenu instanceof StatusPopupMenu)
39+ readonly property bool subMenuOpened: isSubMenu && root .subMenu .opened
3640 readonly property bool hasAction: !! root .action
3741 readonly property bool isStatusAction: d .hasAction && (root .action instanceof StatusMenuItem)
3842 readonly property bool isDangerIcon: d .isStatusAction && root .action .type === StatusMenuItem .Type .Danger
@@ -72,6 +76,8 @@ MenuItem {
7276 const c = d .assetSettings .color ;
7377 if (! Qt .colorEqual (c, " transparent" ))
7478 return c;
79+ if (! root .enabled )
80+ return Theme .palette .baseColor1 ;
7581 if (d .isDangerIcon )
7682 return Theme .palette .dangerColor1 ;
7783 return Theme .palette .primaryColor1 ;
@@ -104,14 +110,21 @@ MenuItem {
104110 }
105111
106112 indicator: Item {
107- anchors .verticalCenter : parent .verticalCenter
108- anchors .left : parent .left
109- anchors .leftMargin : 8
113+ x: root .mirrored ? root .width - width - root .rightPadding : root .leftPadding
114+ y: root .topPadding + (root .availableHeight - height) / 2
115+
116+ // anchors.verticalCenter: parent.verticalCenter
117+ // anchors.left: parent.left
118+ // anchors.leftMargin: root.leftPadding
110119 implicitWidth: 24
111120 implicitHeight: 24
121+ visible: d .assetSettings .isLetterIdenticon
122+ || d .assetSettings .isImage
123+ || !! d .assetSettings .name
112124
113125 Loader {
114126 anchors .centerIn : parent
127+ active: parent .visible
115128 sourceComponent: {
116129 if (d .assetSettings .isImage )
117130 return indicatorImage;
@@ -120,24 +133,25 @@ MenuItem {
120133 return indicatorIcon;
121134 }
122135
123- active: enabled
124- && (d .assetSettings .isLetterIdenticon
125- || d .assetSettings .isImage
126- || !! d .assetSettings .name )
127136 }
128137 }
129138
130139 contentItem: StatusBaseText {
131- anchors .left : root .indicator .right
132- anchors .right : arrowIcon .visible ? arrowIcon .left : arrowIcon .right
133- anchors .rightMargin : 8
134- anchors .leftMargin : 4
140+ readonly property real arrowPadding: root .subMenu && root .arrow ? root .arrow .width + root .spacing : 0
141+ readonly property real indicatorPadding: root .indicator .visible ? root .indicator .width + root .spacing : 0
142+ leftPadding: ! root .mirrored ? indicatorPadding : arrowPadding
143+ rightPadding: root .mirrored ? indicatorPadding : arrowPadding
144+
145+ // anchors.left: root.indicator.visible ? parent.indicator.right : parent.left
146+ // anchors.right: arrowIcon.visible ? arrowIcon.left : arrowIcon.right
147+ // anchors.rightMargin: root.rightPadding
148+ // anchors.leftMargin: root.spacing
135149
136150 horizontalAlignment: Text .AlignLeft
137151 verticalAlignment: Text .AlignVCenter
138152
139153 text: root .text
140- color: ! root .enabled ? Theme .palette .directColor5
154+ color: ! root .enabled ? Theme .palette .baseColor1
141155 : d .isDangerIcon ? Theme .palette .dangerColor1 : Theme .palette .directColor1
142156
143157 font .pixelSize : d .fontSettings .pixelSize // !!root.action.fontSettings ? root.action.fontSettings.pixelSize : 13
@@ -149,9 +163,12 @@ MenuItem {
149163
150164 arrow: StatusIcon {
151165 id: arrowIcon
152- anchors .verticalCenter : parent .verticalCenter
153- anchors .right : parent .right
154- anchors .rightMargin : 8
166+ x: root .mirrored ? root .leftPadding : root .width - width - root .rightPadding
167+ y: root .topPadding + (root .availableHeight - height) / 2
168+
169+ // anchors.verticalCenter: parent.verticalCenter
170+ // anchors.right: parent.right
171+ // anchors.rightMargin: root.rightPadding
155172 height: 16
156173 visible: d .isSubMenu
157174 icon: " next"
@@ -160,7 +177,7 @@ MenuItem {
160177
161178 background: Rectangle {
162179 color: {
163- if (! root .hovered )
180+ if (! root .hovered && ! d . subMenuOpened )
164181 return " transparent"
165182 if (root .action .type === StatusMenuItem .Type .Danger )
166183 return Theme .palette .dangerColor3 ;
0 commit comments