on xenial help sign in
Added two JavaScript-functions that extract icon-name and label from additional actions meant to populate the ComboButton.
commite15b84f1333b9eab1f966cafccc113c017976724 authorMirco Müller <mirco.mueller@canonical.com> dateThu 29 May 2014, 11:01 (12 years ago) parentbd29802
1 file changed+16−2
qml/Notifications/Notification.qml+16−2
qml/Notifications/Notification.qml+16−2
@@ -368,6 +368,16 @@ Item {
368368 width: comboButton.width
369369 height: comboIcon.height + units.gu(2)
370370
371+ function getComboIcon (str) {
372+ var result = str.split(":")
373+ return result[0]
374+ }
375+
376+ function getComboLabel (str) {
377+ var result = str.split(":")
378+ return result[1]
379+ }
380+
371381 onClicked: {
372382 notification.notification.invokeAction(actionId)
373383 }
@@ -376,6 +386,10 @@ Item {
376386 visible: index > 3
377387 }
378388
389+ Component.onCompleted: {
390+ comboIcon.name = getComboIcon(actionLabel)
391+ }
392+
379393 Icon {
380394 id: comboIcon
381395
@@ -389,7 +403,7 @@ Item {
389403 }
390404 width: units.gu(2)
391405 height: units.gu(2)
392− name: "messages"
406+ //name: getComboIcon(actionLabel)
393407 color: "white"
394408 }
395409
@@ -403,7 +417,7 @@ Item {
403417 height: comboIcon.height
404418 fontSize: "small"
405419 color: "white"
406− text: actionLabel
420+ text: getComboLabel(actionLabel)
407421 }
408422 }
409423 }