@@ -37,30 +37,22 @@ MenuItem {
3737 readonly property bool isStatusAction: d .hasAction && (root .action instanceof StatusMenuItem)
3838 readonly property bool isDangerIcon: d .isStatusAction && root .action .type === StatusMenuItem .Type .Danger
3939
40- readonly property StatusImageSettings imageSettings: d .isStatusSubMenu
41- ? root .subMenu .imageSettings
42- : d .isStatusAction ? root .action .image : d .defaultImage
43-
44- readonly property StatusIconSettings iconSettings: {
45- console .log (" <<<--- Calling iconSettings" , root .logObjectName )
46- return d .isStatusSubMenu
47- ? root .subMenu .iconSettings
48- : d .isStatusAction ? root .action .iconSettings : d .defaultIcon
49- }
40+ readonly property StatusAssetSettings assetSettings: d .isStatusSubMenu
41+ ? root .subMenu .assetSettings
42+ : d .isStatusAction
43+ ? root .action .assetSettings
44+ : d .defaultAsset
5045
5146 readonly property StatusFontSettings fontSettings: d .isStatusSubMenu
5247 ? root .subMenu .fontSettings
5348 : d .isStatusAction ? root .action .fontSettings : d .defaultFontSettings
5449
55- readonly property StatusImageSettings defaultImage: StatusImageSettings {
56- width: 16
57- height: 16
58- }
59- readonly property StatusIconSettings defaultIcon: StatusIconSettings {
50+ readonly property StatusAssetSettings defaultAsset: StatusAssetSettings {
6051 width: 18
6152 height: 18
6253 rotation: 0
6354 }
55+
6456 readonly property StatusFontSettings defaultFontSettings: StatusFontSettings {
6557 pixelSize: 13
6658 bold: false
@@ -74,7 +66,7 @@ MenuItem {
7466 StatusIcon {
7567 width: d .assetSettings .width // TODO: Also process action.icon.width?
7668 height: d .assetSettings .height // TODO: Also process action.icon.height?
77- rotation: d .assetSettings .rotation // TODO: Also process action.icon.rotation? // !!root.action.iconRotation ? root.action.iconRotation : 0
69+ rotation: d .assetSettings .rotation // TODO: Also process action.icon.rotation?
7870 icon: d .assetSettings .name // TODO: Also process action.icon?
7971 color: {
8072 const c = d .assetSettings .color ;
@@ -105,36 +97,33 @@ MenuItem {
10597 StatusRoundedImage {
10698 width: d .assetSettings .width
10799 height: d .assetSettings .height
108- image .source : d .assetSettings .source
100+ image .source : d .assetSettings .name
109101 border .width : d .isSubMenu && d .assetSettings .imgIsIdenticon ? 1 : 0
110102 border .color : Theme .palette .directColor7
111103 }
112104 }
113105
114106 indicator: Item {
107+ anchors .verticalCenter : parent .verticalCenter
108+ anchors .left : parent .left
109+ anchors .leftMargin : 8
115110 implicitWidth: 24
116111 implicitHeight: 24
112+
117113 Loader {
118114 anchors .centerIn : parent
119- // sourceComponent: {
120- // if (d.assetSettings.isImage)
121- // return indicatorImage;
122- // if (d.assetSettings.isLetterIdenticon)
123- // return indicatorLetterIdenticon;
124- // return indicatorIcon;
125- // }
126-
127- // sourceComponent: indicatorIcon
128- // sourceComponent: indicatorLetterIdenticon
129- // sourceComponent: indicatorImage
130-
131- anchors .verticalCenter : parent .verticalCenter
132- anchors .left : parent .left
133- anchors .leftMargin : 8
134- // active: enabled // TODO: Also process action.icon.name ?
135- // && (d.assetSettings.isLetterIdenticon
136- // || d.assetSettings.isImage
137- // || !!d.assetSettings.name)
115+ sourceComponent: {
116+ if (d .assetSettings .isImage )
117+ return indicatorImage;
118+ if (d .assetSettings .isLetterIdenticon )
119+ return indicatorLetterIdenticon;
120+ return indicatorIcon;
121+ }
122+
123+ active: enabled
124+ && (d .assetSettings .isLetterIdenticon
125+ || d .assetSettings .isImage
126+ || !! d .assetSettings .name )
138127 }
139128 }
140129
@@ -148,7 +137,9 @@ MenuItem {
148137 verticalAlignment: Text .AlignVCenter
149138
150139 text: root .text
151- color: d .isDangerIcon ? Theme .palette .dangerColor1 : Theme .palette .directColor1
140+ color: ! root .enabled ? Theme .palette .directColor5
141+ : d .isDangerIcon ? Theme .palette .dangerColor1 : Theme .palette .directColor1
142+
152143 font .pixelSize : d .fontSettings .pixelSize // !!root.action.fontSettings ? root.action.fontSettings.pixelSize : 13
153144 font .bold : d .fontSettings .bold // !!root.action.fontSettings ? root.action.fontSettings.bold : false
154145 font .italic : d .fontSettings .italic // !!root.action.fontSettings ? root.action.fontSettings.italic : false
@@ -180,7 +171,7 @@ MenuItem {
180171 MouseArea {
181172 anchors .fill : parent
182173 cursorShape: Qt .PointingHandCursor
183- hoverEnabled: root .enabled // WARNING: use root.enabled ?
174+ hoverEnabled: root .enabled
184175 onPressed: mouse .accepted = false
185176 }
186177}
0 commit comments