58 lines
988 B
QML
58 lines
988 B
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
|
|
|
|
import org.kde.plasma.plasmoid
|
|
|
|
Item {
|
|
id: compactRep
|
|
|
|
anchors.fill: parent
|
|
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
|
|
Image {
|
|
id: mainIcon
|
|
fillMode: Image.PreserveAspectFit
|
|
anchors.fill: parent
|
|
Layout.fillWidth: true
|
|
Layout.fillHeight: true
|
|
source: root.mainIcon
|
|
sourceSize: Qt.size(height, height)
|
|
smooth: true
|
|
}
|
|
|
|
Rectangle {
|
|
id: circle
|
|
width: 15
|
|
height: width
|
|
radius: Math.round(width / 2)
|
|
color: "Black"
|
|
opacity: 0.7
|
|
visible: root.badgeVisible
|
|
anchors {
|
|
right: parent.right
|
|
top: parent.top
|
|
}
|
|
}
|
|
|
|
Text {
|
|
text: root.badgeText
|
|
font.pointSize: 6
|
|
color: "White"
|
|
anchors.centerIn: circle
|
|
visible: root.badgeVisible
|
|
}
|
|
|
|
MouseArea {
|
|
property bool wasExpanded: false
|
|
anchors.fill: parent
|
|
onClicked: {
|
|
if (mouse.button == Qt.LeftButton) {
|
|
plasmoid.expanded = !plasmoid.expanded
|
|
}
|
|
}
|
|
}
|
|
}
|