PrinterTile.qml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import QtQuick 2.2
  2. import QtQuick.Controls 1.4
  3. import QtQuick.Controls.Styles 1.4
  4. import UM 1.3 as UM
  5. import Cura 1.0 as Cura
  6. Rectangle
  7. {
  8. id: base
  9. width: 250 * screenScaleFactor
  10. height: 250 * screenScaleFactor
  11. signal clicked()
  12. MouseArea
  13. {
  14. anchors.fill:parent
  15. onClicked: base.clicked()
  16. }
  17. Rectangle
  18. {
  19. // TODO: Actually add UM icon / picture
  20. width: 100 * screenScaleFactor
  21. height: 100 * screenScaleFactor
  22. border.width: UM.Theme.getSize("default_lining").width
  23. anchors.horizontalCenter: parent.horizontalCenter
  24. anchors.top: parent.top
  25. anchors.topMargin: UM.Theme.getSize("default_margin").height
  26. }
  27. Label
  28. {
  29. id: nameLabel
  30. anchors.bottom: ipLabel.top
  31. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  32. anchors.left: parent.left
  33. anchors.right: parent.right
  34. anchors.leftMargin: UM.Theme.getSize("default_margin").width
  35. anchors.rightMargin: UM.Theme.getSize("default_margin").width
  36. text: modelData.friendly_name.toString()
  37. font: UM.Theme.getFont("large")
  38. elide: Text.ElideMiddle;
  39. height: UM.Theme.getSize("section").height;
  40. }
  41. Label
  42. {
  43. id: ipLabel
  44. text: modelData.ip_address.toString()
  45. anchors.bottom: parent.bottom
  46. anchors.bottomMargin: UM.Theme.getSize("default_margin").height
  47. font: UM.Theme.getFont("default")
  48. height:10 * screenScaleFactor
  49. anchors.horizontalCenter: parent.horizontalCenter
  50. }
  51. }