ToolboxHeader.qml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright (c) 2018 Ultimaker B.V.
  2. // Toolbox is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.4
  5. import UM 1.1 as UM
  6. Item
  7. {
  8. id: header
  9. width: parent.width
  10. height: UM.Theme.getSize("toolbox_header").height
  11. Row
  12. {
  13. id: bar
  14. spacing: UM.Theme.getSize("default_margin").width
  15. height: childrenRect.height
  16. width: childrenRect.width
  17. anchors
  18. {
  19. left: parent.left
  20. leftMargin: UM.Theme.getSize("default_margin").width
  21. }
  22. ToolboxTabButton
  23. {
  24. text: catalog.i18nc("@title:tab", "Plugins")
  25. active: toolbox.viewCategory == "plugin"
  26. onClicked:
  27. {
  28. toolbox.filterModelByProp("packages", "type", "plugin")
  29. toolbox.viewCategory = "plugin"
  30. toolbox.viewPage = "overview"
  31. }
  32. }
  33. ToolboxTabButton
  34. {
  35. text: catalog.i18nc("@title:tab", "Materials")
  36. active: toolbox.viewCategory == "material"
  37. onClicked:
  38. {
  39. toolbox.filterModelByProp("authors", "package_types", "material")
  40. toolbox.viewCategory = "material"
  41. toolbox.viewPage = "overview"
  42. }
  43. }
  44. }
  45. ToolboxTabButton
  46. {
  47. text: catalog.i18nc("@title:tab", "Installed")
  48. active: toolbox.viewCategory == "installed"
  49. anchors
  50. {
  51. right: parent.right
  52. rightMargin: UM.Theme.getSize("default_margin").width
  53. }
  54. onClicked: toolbox.viewCategory = "installed"
  55. }
  56. ToolboxShadow
  57. {
  58. anchors.top: bar.bottom
  59. }
  60. }