melawy-plasma-plasmoid-arch.../com.github.Melawy.ArchUpdate/contents/ui/Compact.qml

58 lines
1002 B
QML
Raw Normal View History

2023-04-17 12:12:12 +05:00
import QtQuick 2.15
import QtQuick.Layouts 1.15
import org.kde.plasma.plasmoid 2.0
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
2023-05-24 11:19:31 +05:00
visible: root.badgeVisible
2023-04-17 12:12:12 +05:00
anchors {
right: parent.right
top: parent.top
}
}
Text {
2023-05-24 12:47:45 +05:00
text: root.badgeText
2023-04-17 12:12:12 +05:00
font.pointSize: 6
color: "White"
anchors.centerIn: circle
2023-05-24 11:19:31 +05:00
visible: root.badgeVisible
2023-04-17 12:12:12 +05:00
}
MouseArea {
property bool wasExpanded: false
anchors.fill: parent
onClicked: {
if (mouse.button == Qt.LeftButton) {
plasmoid.expanded = !plasmoid.expanded
}
}
}
}