PrintJobTitle.qml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.3
  4. import QtQuick.Controls 2.0
  5. import UM 1.3 as UM
  6. Column {
  7. property var job: null;
  8. height: childrenRect.height;
  9. spacing: Math.floor( UM.Theme.getSize("default_margin").height / 2); // TODO: Use explicit theme size
  10. width: parent.width;
  11. Item {
  12. id: jobName;
  13. height: UM.Theme.getSize("monitor_text_line").height;
  14. width: parent.width;
  15. // Skeleton loading
  16. Rectangle {
  17. color: UM.Theme.getColor("monitor_skeleton_fill");
  18. height: parent.height;
  19. visible: !job;
  20. width: Math.round(parent.width / 3);
  21. }
  22. Label {
  23. anchors.fill: parent;
  24. color: UM.Theme.getColor("text");
  25. elide: Text.ElideRight;
  26. font: UM.Theme.getFont("default_bold");
  27. text: job && job.name ? job.name : "";
  28. visible: job;
  29. }
  30. }
  31. Item {
  32. id: ownerName;
  33. height: UM.Theme.getSize("monitor_text_line").height;
  34. width: parent.width;
  35. // Skeleton loading
  36. Rectangle {
  37. color: UM.Theme.getColor("monitor_skeleton_fill");
  38. height: parent.height;
  39. visible: !job;
  40. width: Math.round(parent.width / 2);
  41. }
  42. Label {
  43. anchors.fill: parent;
  44. color: UM.Theme.getColor("text")
  45. elide: Text.ElideRight;
  46. font: UM.Theme.getFont("default");
  47. text: job ? job.owner : "";
  48. visible: job;
  49. }
  50. }
  51. }