this is the main cwtch gui with the pretty interface https://cwtch.im
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
3.5KB

  1. import QtGraphicalEffects 1.0
  2. import QtQuick 2.7
  3. import QtQuick.Controls 2.4
  4. import QtQuick.Controls.Material 2.0
  5. import QtQuick.Layouts 1.3
  6. import "../widgets"
  7. import "../overlays"
  8. ColumnLayout {
  9. Layout.fillWidth: true
  10. property alias title: toolbar.text
  11. id: overlay
  12. property string name
  13. property bool accepted
  14. StackToolbar {
  15. id: toolbar
  16. membership.visible: gcd.currentOpenConversation.length == 32
  17. membership.onClicked: overlayStack.overlay = overlayStack.membershipOverlay
  18. aux.onClicked: {
  19. if (gcd.currentOpenConversation.length == 32) {
  20. theStack.pane = theStack.groupProfilePane
  21. gcd.requestGroupSettings(gcd.currentOpenConversation)
  22. } else {
  23. theStack.pane = theStack.userProfilePane
  24. gcd.requestPeerSettings()
  25. }
  26. }
  27. back.visible: true
  28. }
  29. RowLayout {
  30. visible:!overlay.accepted && (gcd.currentOpenConversation.length == 32)
  31. Text {
  32. text: "Do you want to accept the invitation to " + overlay.name + "?"
  33. }
  34. SimpleButton {
  35. text: "Accept"
  36. icon: "regular/heart"
  37. onClicked: {
  38. gcd.acceptGroup(gcd.currentOpenConversation)
  39. gcd.requestGroupSettings(gcd.currentOpenConversation)
  40. }
  41. }
  42. SimpleButton {
  43. text: "Reject"
  44. icon: "regular/trash-alt"
  45. onClicked: {
  46. gcd.leaveGroup(gcd.currentOpenConversation)
  47. theStack.pane = theStack.emptyPane
  48. }
  49. }
  50. }
  51. RowLayout {
  52. id: switcher
  53. SimpleButton {
  54. text: "Chat"
  55. onClicked: overlayStack.overlay = overlayStack.chatOverlay
  56. }
  57. SimpleButton {
  58. text: "Lists"
  59. onClicked: overlayStack.overlay = overlayStack.listOverlay
  60. }
  61. SimpleButton {
  62. text: "Bulletins"
  63. onClicked: overlayStack.overlay = overlayStack.bulletinOverlay
  64. }
  65. SimpleButton {
  66. text: "Puzzle Game"
  67. onClicked: overlayStack.overlay = overlayStack.game1Overlay
  68. }
  69. }
  70. StackLayout {
  71. id: overlayStack
  72. anchors.left: parent.left
  73. anchors.right: parent.right
  74. anchors.bottom: parent.bottom
  75. anchors.top: switcher.bottom
  76. implicitHeight: height
  77. currentIndex: 0
  78. property alias overlay: overlayStack.currentIndex
  79. readonly property int chatOverlay: 0
  80. readonly property int listOverlay: 1
  81. readonly property int bulletinOverlay: 2
  82. readonly property int game1Overlay: 3
  83. readonly property int membershipOverlay: 4
  84. ChatOverlay { //0
  85. Layout.maximumHeight: overlayStack.height
  86. Layout.maximumWidth: overlayStack.width
  87. }
  88. ListOverlay{ //1
  89. Layout.maximumHeight: overlayStack.height
  90. Layout.maximumWidth: overlayStack.width
  91. }
  92. BulletinOverlay{ //2
  93. Layout.maximumHeight: overlayStack.height
  94. Layout.maximumWidth: overlayStack.width
  95. }
  96. Game1Overlay{ //3
  97. Layout.maximumHeight: overlayStack.height
  98. Layout.maximumWidth: overlayStack.width
  99. }
  100. MembershipOverlay { //4
  101. Layout.maximumHeight: overlayStack.height
  102. Layout.maximumWidth: overlayStack.width
  103. }
  104. }
  105. Connections {
  106. target: gcd
  107. onResetMessagePane: function() {
  108. overlayStack.overlay = overlayStack.chatOverlay
  109. }
  110. onSupplyGroupSettings: function(gid, name, server, invite, accepted, addrbooknames, addrbookaddrs) {
  111. console.log("Supplied " + gid + " " + name + "Accepted " + accepted)
  112. overlay.name = name
  113. overlay.accepted = accepted
  114. }
  115. }
  116. }