MachineSelection.qml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright (c) 2017 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.1
  5. import QtQuick.Controls.Styles 1.1
  6. import QtQuick.Layouts 1.1
  7. import UM 1.2 as UM
  8. import Cura 1.0 as Cura
  9. import "Menus"
  10. ToolButton
  11. {
  12. text: Cura.MachineManager.activeMachineName
  13. tooltip: Cura.MachineManager.activeMachineName
  14. style: ButtonStyle
  15. {
  16. background: Rectangle
  17. {
  18. color:
  19. {
  20. if(control.pressed)
  21. {
  22. return UM.Theme.getColor("sidebar_header_active");
  23. }
  24. else if(control.hovered)
  25. {
  26. return UM.Theme.getColor("sidebar_header_hover");
  27. }
  28. else
  29. {
  30. return UM.Theme.getColor("sidebar_header_bar");
  31. }
  32. }
  33. Behavior on color { ColorAnimation { duration: 50; } }
  34. UM.RecolorImage
  35. {
  36. id: downArrow
  37. anchors.verticalCenter: parent.verticalCenter
  38. anchors.right: parent.right
  39. anchors.rightMargin: UM.Theme.getSize("default_margin").width
  40. width: UM.Theme.getSize("standard_arrow").width
  41. height: UM.Theme.getSize("standard_arrow").height
  42. sourceSize.width: width
  43. sourceSize.height: width
  44. color: UM.Theme.getColor("text_emphasis")
  45. source: UM.Theme.getIcon("arrow_bottom")
  46. }
  47. Label
  48. {
  49. id: sidebarComboBoxLabel
  50. color: UM.Theme.getColor("sidebar_header_text_active")
  51. text: control.text;
  52. elide: Text.ElideRight;
  53. anchors.left: parent.left;
  54. anchors.leftMargin: UM.Theme.getSize("default_margin").width * 2
  55. anchors.right: downArrow.left;
  56. anchors.rightMargin: control.rightMargin;
  57. anchors.verticalCenter: parent.verticalCenter;
  58. font: UM.Theme.getFont("large")
  59. }
  60. }
  61. label: Label {}
  62. }
  63. menu: PrinterMenu { }
  64. }