add tabbar
the build was successful
Details
the build was successful
Details
This commit is contained in:
parent
4179e2798b
commit
a0bbfa7721
|
@ -1 +1 @@
|
||||||
Subproject commit d6b56d02780c675a0acc36bd0f9ae65a42789077
|
Subproject commit d78fcdc8e6b0f484e29e404810b6660677ab840d
|
|
@ -18,7 +18,7 @@ Rectangle {
|
||||||
color: Theme.backgroundPaneColor
|
color: Theme.backgroundPaneColor
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
addStack.currentIndex = addStack.addPeer
|
tabBar.currentIndex = 0
|
||||||
|
|
||||||
peerAddr.text = ""
|
peerAddr.text = ""
|
||||||
peerName.text = ""
|
peerName.text = ""
|
||||||
|
@ -74,75 +74,20 @@ Rectangle {
|
||||||
color: root.color
|
color: root.color
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
Opaque.TabBar {
|
||||||
id: switcher
|
id: tabBar
|
||||||
visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment")
|
visible: gcd.experimentsEnabled && Utils.checkMap(gcd.experiments, "tapir-groups-experiment")
|
||||||
|
width: parent.width - parent.leftPadding - parent.rightPadding
|
||||||
height: addPeerTab.height
|
model: [qsTr("add-peer-tab"), qsTr("create-group-tab"), qsTr("join-group-tab")]
|
||||||
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}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
StackLayout {
|
StackLayout {
|
||||||
id: addStack
|
id: addStack
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
implicitHeight: height
|
implicitHeight: height
|
||||||
currentIndex: addPeer
|
currentIndex: tabBar.currentIndex
|
||||||
|
|
||||||
readonly property int addPeer: 0
|
|
||||||
readonly property int createGroup: 1
|
|
||||||
readonly property int joinGroup: 2
|
|
||||||
|
|
||||||
Column { // Add a peer
|
Column { // Add a peer
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -176,7 +121,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column { // Create a group
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
leftPadding: 20 * gcd.themeScale
|
leftPadding: 20 * gcd.themeScale
|
||||||
rightPadding: 20 * gcd.themeScale
|
rightPadding: 20 * gcd.themeScale
|
||||||
|
@ -219,7 +164,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column { // Join a group
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
leftPadding: 20 * gcd.themeScale
|
leftPadding: 20 * gcd.themeScale
|
||||||
rightPadding: 20 * gcd.themeScale
|
rightPadding: 20 * gcd.themeScale
|
||||||
|
@ -267,10 +212,10 @@ Rectangle {
|
||||||
height: 40 * gcd.themeScale
|
height: 40 * gcd.themeScale
|
||||||
|
|
||||||
//: Add Peer | Create Group | Join Group
|
//: 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: {
|
onClicked: {
|
||||||
if (addStack.currentIndex == addStack.addPeer) {
|
if (tabBar.currentIndex == 0) {
|
||||||
gcd.addPeer(peerName.text, peerAddr.text)
|
gcd.addPeer(peerName.text, peerAddr.text)
|
||||||
theStack.currentIndex = theStack.emptyPane
|
theStack.currentIndex = theStack.emptyPane
|
||||||
} // Else Group stuff
|
} // Else Group stuff
|
||||||
|
|
|
@ -19,52 +19,12 @@ ColumnLayout {
|
||||||
property bool accepted
|
property bool accepted
|
||||||
property bool inGroup
|
property bool inGroup
|
||||||
|
|
||||||
RowLayout {
|
Opaque.TabBar {
|
||||||
id: switcher
|
id: tabBar
|
||||||
|
|
||||||
height: chatTab.height
|
|
||||||
implicitHeight: height
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
property string selectedTab: "chat"
|
model: [qsTr("chat-btn"), qsTr("lists-btn"), qsTr("bulletins-btn")]
|
||||||
|
onCurrentIndexChanged: overlayStack.overlay = currentIndex + 1
|
||||||
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 }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StackLayout {
|
StackLayout {
|
||||||
|
@ -107,7 +67,7 @@ ColumnLayout {
|
||||||
target: gcd
|
target: gcd
|
||||||
|
|
||||||
onResetMessagePane: function() {
|
onResetMessagePane: function() {
|
||||||
overlayStack.overlay = overlayStack.chatOverlay
|
tabBar.currentIndex = 0
|
||||||
overlay.inGroup = false
|
overlay.inGroup = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue