2021-10-15 22:18:30 +02:00
|
|
|
import QtQuick 2.8
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
|
|
import org.kde.plasma.components 3.0 as PlasmaComponents3
|
2023-05-21 20:14:24 +02:00
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
2021-10-15 22:18:30 +02:00
|
|
|
|
|
|
|
PlasmaComponents3.ToolButton {
|
|
|
|
id: root
|
|
|
|
Layout.fillHeight: true
|
|
|
|
contentItem: Grid {
|
|
|
|
columns: 2
|
2023-05-21 20:14:24 +02:00
|
|
|
columnSpacing: label.visible ? Kirigami.Units.smallSpacing : 0
|
2021-10-15 22:18:30 +02:00
|
|
|
verticalItemAlignment: Grid.AlignVCenter
|
2023-11-14 01:50:24 +01:00
|
|
|
Kirigami.Theme.inherit: true
|
2021-10-15 22:18:30 +02:00
|
|
|
Image {
|
|
|
|
source: root.icon.source
|
2022-02-05 21:31:53 +01:00
|
|
|
cache: false
|
2021-10-15 22:18:30 +02:00
|
|
|
height: parent.height
|
|
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
}
|
|
|
|
PlasmaComponents3.Label {
|
|
|
|
id: label
|
|
|
|
visible: text.length > 0
|
|
|
|
text: root.text
|
2023-11-14 23:58:22 +01:00
|
|
|
color: Kirigami.Theme.textColor
|
2021-10-15 22:18:30 +02:00
|
|
|
elide: Text.ElideRight
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|