add tabbar #389
|
@ -1 +1 @@
|
|||
Subproject commit d6b56d02780c675a0acc36bd0f9ae65a42789077
|
||||
Subproject commit a69fb3cff29a56fd2ea9c3b3d2b61f4ebe34e3c7
|
|
@ -18,7 +18,7 @@ Rectangle {
|
|||
color: Theme.backgroundPaneColor
|
||||
|
||||
function reset() {
|
||||
addStack.currentIndex = addStack.addPeer
|
||||
tabBar.currentIndex = 0
|
||||
|
||||
peerAddr.text = ""
|
||||
peerName.text = ""
|
||||
|
@ -74,63 +74,12 @@ Rectangle {
|
|||
color: root.color
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: switcher
|
||||
Opaque.TabBar {
|
||||
id: tabBar
|
||||
visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment")
|
||||
|
||||
height: addPeerTab.height
|
||||
implicitHeight: height
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
Opaque.Tab {
|
||||
id: addPeerTab
|
||||
Layout.fillWidth: true
|
||||
active: addStack.currentIndex == addStack.addPeer
|
||||
//: Add a peer
|
||||
text: qsTr("add-peer-tab")
|
||||
|
||||
size: Theme.chatMetaTextSize
|
||||
|
||||
onClicked: { addStack.currentIndex = addStack.addPeer; }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 2
|
||||
height: parent.height
|
||||
color: Theme.dividerColor
|
||||
}
|
||||
|
||||
Opaque.Tab {
|
||||
Layout.fillWidth: true
|
||||
active: addStack.currentIndex == addStack.createGroup
|
||||
//: Create a group
|
||||
text: qsTr("create-group-tab")
|
||||
|
||||
size: Theme.chatMetaTextSize
|
||||
|
||||
onClicked: { addStack.currentIndex = addStack.createGroup }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 2
|
||||
height: parent.height
|
||||
color: Theme.dividerColor
|
||||
}
|
||||
|
||||
Opaque.Tab {
|
||||
Layout.fillWidth: true
|
||||
active: addStack.currentIndex == addStack.joinGroup
|
||||
//: Join a group
|
||||
text: qsTr("join-group-tab")
|
||||
|
||||
size: Theme.chatMetaTextSize
|
||||
|
||||
onClicked: { addStack.currentIndex = addStack.joinGroup}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
width: parent.width - parent.leftPadding - parent.rightPadding
|
||||
model: [qsTr("add-peer-tab"), qsTr("create-group-tab"), qsTr("join-group-tab")]
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
id: addStack
|
||||
|
@ -138,11 +87,7 @@ Rectangle {
|
|||
anchors.right: parent.right
|
||||
|
||||
implicitHeight: height
|
||||
currentIndex: addPeer
|
||||
|
||||
readonly property int addPeer: 0
|
||||
readonly property int createGroup: 1
|
||||
readonly property int joinGroup: 2
|
||||
currentIndex: tabBar.currentIndex
|
||||
|
||||
Column { // Add a peer
|
||||
Layout.fillWidth: true
|
||||
|
@ -176,7 +121,7 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
Column { // Create a group
|
||||
Layout.fillWidth: true
|
||||
leftPadding: 20 * gcd.themeScale
|
||||
rightPadding: 20 * gcd.themeScale
|
||||
|
@ -219,7 +164,7 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
Column { // Join a group
|
||||
Layout.fillWidth: true
|
||||
leftPadding: 20 * gcd.themeScale
|
||||
rightPadding: 20 * gcd.themeScale
|
||||
|
@ -267,10 +212,10 @@ Rectangle {
|
|||
height: 40 * gcd.themeScale
|
||||
|
||||
//: Add Peer | Create Group | Join Group
|
||||
text: addStack.currentIndex == addStack.addPeer ? qsTr("add-peer") : addStack.currentIndex == addStack.createGroup ? qsTr("create-group") : qsTr("join-group")
|
||||
text: tabBar.currentItem.text
|
||||
|
||||
onClicked: {
|
||||
if (addStack.currentIndex == addStack.addPeer) {
|
||||
if (tabBar.currentIndex == 0) {
|
||||
gcd.addPeer(peerName.text, peerAddr.text)
|
||||
theStack.currentIndex = theStack.emptyPane
|
||||
} // Else Group stuff
|
||||
|
|
|
@ -19,53 +19,13 @@ ColumnLayout {
|
|||
property bool accepted
|
||||
property bool inGroup
|
||||
|
||||
RowLayout {
|
||||
id: switcher
|
||||
|
||||
height: chatTab.height
|
||||
implicitHeight: height
|
||||
Opaque.TabBar {
|
||||
id: tabBar
|
||||
Layout.fillWidth: true
|
||||
|
||||
property string selectedTab: "chat"
|
||||
|
||||
Opaque.Tab {
|
||||
id: chatTab
|
||||
Layout.fillWidth: true
|
||||
active: switcher.selectedTab == "chat"
|
||||
text: qsTr("chat-btn")
|
||||
|
||||
onClicked: { switcher.selectedTab = "chat"; overlayStack.overlay = overlayStack.chatOverlay }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 2
|
||||
height: parent.height
|
||||
color: Theme.dividerColor
|
||||
}
|
||||
|
||||
Opaque.Tab {
|
||||
Layout.fillWidth: true
|
||||
active: switcher.selectedTab == "lists"
|
||||
text: qsTr("lists-btn")
|
||||
|
||||
onClicked: { switcher.selectedTab = "lists"; overlayStack.overlay = overlayStack.listOverlay }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 2
|
||||
height: parent.height
|
||||
color: Theme.dividerColor
|
||||
}
|
||||
|
||||
Opaque.Tab {
|
||||
Layout.fillWidth: true
|
||||
active: switcher.selectedTab == "bullitin"
|
||||
text: qsTr("bulletins-btn")
|
||||
|
||||
onClicked: { switcher.selectedTab = "bullitin"; overlayStack.overlay = overlayStack.bulletinOverlay }
|
||||
}
|
||||
|
||||
}
|
||||
model: [qsTr("chat-btn"), qsTr("lists-btn"), qsTr("bulletins-btn")]
|
||||
onCurrentIndexChanged: overlayStack.overlay = currentIndex + 1
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
id: overlayStack
|
||||
|
@ -107,7 +67,7 @@ ColumnLayout {
|
|||
target: gcd
|
||||
|
||||
onResetMessagePane: function() {
|
||||
overlayStack.overlay = overlayStack.chatOverlay
|
||||
tabBar.currentIndex = 0
|
||||
overlay.inGroup = false
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue