TopBar.qml 1.3 KB

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