TopBar.qml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import QtQuick 2.0
  2. import QtQuick.Dialogs 1.2
  3. import QtQuick.Controls 1.4
  4. Item {
  5. id: root
  6. anchors.right: parent.right
  7. anchors.left: parent.left
  8. height: childrenRect.height
  9. signal closeClicked()
  10. property alias closeVisible: closeButton.visible
  11. Row {
  12. spacing: 10
  13. height: 50
  14. Text {
  15. text: "Active repository" + repoOpenDialog.fileUrl
  16. }
  17. Button {
  18. text: "Choose..."
  19. onClicked: repoOpenDialog.open()
  20. }
  21. Text {
  22. text: _handler.activeRepo.name
  23. }
  24. FileDialog {
  25. id: repoOpenDialog
  26. folder: "."
  27. selectFolder: true
  28. selectMultiple: false
  29. onAccepted: {
  30. //TODO: repo open is not available
  31. _handler.open(repoOpenDialog.fileUrl)
  32. }
  33. }
  34. }
  35. Image {
  36. id: closeButton
  37. anchors.right: parent.right
  38. anchors.top: parent.top
  39. anchors.topMargin: 10
  40. anchors.rightMargin: 10
  41. source: closeControl.pressed ? "qrc:///images/x-mark-3-24_active.png" : "qrc:///images/x-mark-3-24.png"
  42. MouseArea {
  43. id: closeControl
  44. anchors.fill: parent
  45. onClicked: {
  46. root.closeClicked()
  47. }
  48. }
  49. }
  50. }