ToolboxBackColumn.qml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 QtQuick.Controls.Styles 1.4
  6. import UM 1.1 as UM
  7. Item
  8. {
  9. id: sidebar
  10. height: parent.height
  11. width: UM.Theme.getSize("toolbox_back_column").width
  12. anchors
  13. {
  14. top: parent.top
  15. left: parent.left
  16. topMargin: UM.Theme.getSize("wide_margin").height
  17. leftMargin: UM.Theme.getSize("default_margin").width
  18. rightMargin: UM.Theme.getSize("default_margin").width
  19. }
  20. Button
  21. {
  22. id: button
  23. text: catalog.i18nc("@action:button", "Back")
  24. UM.RecolorImage
  25. {
  26. id: backArrow
  27. anchors
  28. {
  29. verticalCenter: parent.verticalCenter
  30. left: parent.left
  31. rightMargin: UM.Theme.getSize("default_margin").width
  32. }
  33. width: UM.Theme.getSize("standard_arrow").width
  34. height: UM.Theme.getSize("standard_arrow").height
  35. sourceSize
  36. {
  37. width: width
  38. height: height
  39. }
  40. color: button.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text")
  41. source: UM.Theme.getIcon("arrow_left")
  42. }
  43. width: UM.Theme.getSize("base_unit").width * 4
  44. height: UM.Theme.getSize("base_unit").height * 2
  45. onClicked:
  46. {
  47. toolbox.viewPage = "overview"
  48. toolbox.filterModelByProp("packages", "type", toolbox.viewCategory)
  49. toolbox.filterModelByProp("authors", "type", toolbox.viewCategory)
  50. }
  51. style: ButtonStyle
  52. {
  53. background: Rectangle
  54. {
  55. color: "transparent"
  56. }
  57. label: Label
  58. {
  59. id: labelStyle
  60. text: control.text
  61. color: control.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text")
  62. font: UM.Theme.getFont("default_bold")
  63. horizontalAlignment: Text.AlignRight
  64. width: control.width
  65. }
  66. }
  67. }
  68. }