ToolboxBackColumn.qml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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("toolbox_back_button").width
  44. height: UM.Theme.getSize("toolbox_back_button").height
  45. onClicked:
  46. {
  47. toolbox.viewPage = "overview"
  48. toolbox.filterModelByProp("packages", "type", toolbox.viewCategory)
  49. }
  50. style: ButtonStyle
  51. {
  52. background: Rectangle
  53. {
  54. color: "transparent"
  55. }
  56. label: Label
  57. {
  58. id: labelStyle
  59. text: control.text
  60. color: control.hovered ? UM.Theme.getColor("primary") : UM.Theme.getColor("text")
  61. font: UM.Theme.getFont("default_bold")
  62. horizontalAlignment: Text.AlignRight
  63. width: control.width
  64. }
  65. }
  66. }
  67. }