44 import org.kde.plasma.core 0.1 as PlasmaCore
59 property alias titleText: titleAreaText.text
62 property string titleIcon
65 property variant buttonTexts: []
71 signal buttonClicked(
int index)
73 onButtonTextsChanged: {
74 for (var i = buttonRow.children.length; i > 0; --i) {
75 buttonRow.children[i - 1].destroy()
77 for (var j = 0; j < buttonTexts.length; ++j) {
78 var button = buttonComponent.createObject(buttonRow)
79 button.text = buttonTexts[j]
91 root.buttonClicked(index)
110 function iconSource() {
111 return root.titleIcon
115 title: PlasmaCore.FrameSvgItem {
116 imagePath:
"widgets/extender-dragger"
118 visible: titleAreaText.
text !=
""
119 anchors.left: parent.left
120 anchors.right: parent.right
122 height: titleAreaText.paintedHeight + margins.top + margins.bottom
124 LayoutMirroring.childrenInherit:
true
127 id: titleLayoutHelper
131 left: titleAreaIcon.source ==
"" ? parent.left : titleAreaIcon.right
133 bottom: parent.bottom
134 leftMargin: parent.margins.left
135 rightMargin: parent.margins.right
136 topMargin: parent.margins.top
137 bottomMargin: parent.margins.bottom
142 LayoutMirroring.enabled: root.LayoutMirroring.enabled
143 elide:
Text.ElideRight
144 height: paintedHeight
149 horizontalAlignment:
Text.AlignHCenter
150 verticalAlignment:
Text.AlignVCenter
154 PlasmaCore.IconItem {
156 width: theme.iconSizeSmall
157 height: theme.iconSizeSmall
159 anchors.left: parent.left
160 anchors.rightMargin: 4
161 anchors.verticalCenter: parent.verticalCenter
168 LayoutMirroring.enabled:
false
169 LayoutMirroring.childrenInherit:
true
170 objectName:
"buttonRow"
171 anchors.centerIn: parent
This is a label which uses the plasma theme.