Advertisement
Guest User

CompactRepresentation.qml

a guest
May 4th, 2015
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. import QtQuick 2.0
  2. import QtQuick.Layouts 1.1
  3. import org.kde.plasma.plasmoid 2.0
  4. import org.kde.plasma.core 2.0 as PlasmaCore
  5. import org.kde.plasma.components 2.0 as PlasmaComponents
  6.  
  7. Column {
  8. id: container
  9. Layout.fillWidth: true
  10. Layout.fillHeight: true
  11. Layout.preferredWidth: 80
  12. Layout.preferredHeight: 20
  13. property date dateTime: new Date()
  14.  
  15. Timer {
  16. interval: 100; running: true; repeat: true;
  17. onTriggered: container.dateTime = new Date()
  18. }
  19. Text {
  20. id: time
  21. anchors.horizontalCenter: parent.horizontalCenter
  22.  
  23. color: container.color
  24.  
  25. text : Qt.formatDateTime(container.dateTime, "dd/MM/yyyy hh:mm")
  26. font.pointSize: 12
  27. }
  28.  
  29. MouseArea {
  30. anchors.fill: parent
  31.  
  32. acceptedButtons: Qt.LeftButton
  33.  
  34. hoverEnabled: true
  35.  
  36. onClicked: {
  37. plasmoid.expanded = !plasmoid.expanded
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement