Merge pull request 'splash screen is back, just covering ACN/Cwtch app initialization, now with sweet new fade in transition' (#376) from dan/ui:splashFade into master
the build was successful
Details
the build was successful
Details
Reviewed-on: #376 Tested on Android: #377
This commit is contained in:
commit
7f011663d7
2
go.mod
2
go.mod
|
@ -4,7 +4,7 @@ go 1.12
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cwtch.im/cwtch v0.4.8
|
cwtch.im/cwtch v0.4.8
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.3.1
|
git.openprivacy.ca/openprivacy/connectivity v1.3.2
|
||||||
git.openprivacy.ca/openprivacy/log v1.0.1
|
git.openprivacy.ca/openprivacy/log v1.0.1
|
||||||
github.com/c-bata/go-prompt v0.2.3 // indirect
|
github.com/c-bata/go-prompt v0.2.3 // indirect
|
||||||
github.com/google/go-cmp v0.4.0 // indirect
|
github.com/google/go-cmp v0.4.0 // indirect
|
||||||
|
|
6
go.sum
6
go.sum
|
@ -19,6 +19,8 @@ cwtch.im/tapir v0.2.1 h1:t1YJB9q5sV1A9xwiiwL6WVfw3dwQWLoecunuzT1PQtw=
|
||||||
cwtch.im/tapir v0.2.1/go.mod h1:xzzZ28adyUXNkYL1YodcHsAiTt3IJ8Loc29YVn9mIEQ=
|
cwtch.im/tapir v0.2.1/go.mod h1:xzzZ28adyUXNkYL1YodcHsAiTt3IJ8Loc29YVn9mIEQ=
|
||||||
git.openprivacy.ca/openprivacy/bine v0.0.3 h1:PSHUmNqaW7BZUX8n2eTDeNbjsuRe+t5Ae0Og+P+jDM0=
|
git.openprivacy.ca/openprivacy/bine v0.0.3 h1:PSHUmNqaW7BZUX8n2eTDeNbjsuRe+t5Ae0Og+P+jDM0=
|
||||||
git.openprivacy.ca/openprivacy/bine v0.0.3/go.mod h1:13ZqhKyqakDsN/ZkQkIGNULsmLyqtXc46XBcnuXm/mU=
|
git.openprivacy.ca/openprivacy/bine v0.0.3/go.mod h1:13ZqhKyqakDsN/ZkQkIGNULsmLyqtXc46XBcnuXm/mU=
|
||||||
|
git.openprivacy.ca/openprivacy/bine v0.0.4 h1:CO7EkGyz+jegZ4ap8g5NWRuDHA/56KKvGySR6OBPW+c=
|
||||||
|
git.openprivacy.ca/openprivacy/bine v0.0.4/go.mod h1:13ZqhKyqakDsN/ZkQkIGNULsmLyqtXc46XBcnuXm/mU=
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.2.0/go.mod h1:B7vzuVmChJtSKoh0ezph5vu6DQ0gIk0zHUNG6IgXCcA=
|
git.openprivacy.ca/openprivacy/connectivity v1.2.0/go.mod h1:B7vzuVmChJtSKoh0ezph5vu6DQ0gIk0zHUNG6IgXCcA=
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.2.1 h1:oRL56TR9ZQnKkGkTIQ9wYbJ2IkOOsi/zLYExYiAS+sE=
|
git.openprivacy.ca/openprivacy/connectivity v1.2.1 h1:oRL56TR9ZQnKkGkTIQ9wYbJ2IkOOsi/zLYExYiAS+sE=
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.2.1/go.mod h1:B7vzuVmChJtSKoh0ezph5vu6DQ0gIk0zHUNG6IgXCcA=
|
git.openprivacy.ca/openprivacy/connectivity v1.2.1/go.mod h1:B7vzuVmChJtSKoh0ezph5vu6DQ0gIk0zHUNG6IgXCcA=
|
||||||
|
@ -26,6 +28,8 @@ git.openprivacy.ca/openprivacy/connectivity v1.3.0 h1:e2EeV6CaMNwOb+PzAjF0hGCeOq
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.3.0/go.mod h1:s0/QhONuUqJQfYTAgUlu+ya7G3Ov6bKgpT5QkOhVxDI=
|
git.openprivacy.ca/openprivacy/connectivity v1.3.0/go.mod h1:s0/QhONuUqJQfYTAgUlu+ya7G3Ov6bKgpT5QkOhVxDI=
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.3.1 h1:d1t7rtzn+Fc63Z2M4mAGmGYU8hSeoZqglvfVBYkg0Lw=
|
git.openprivacy.ca/openprivacy/connectivity v1.3.1 h1:d1t7rtzn+Fc63Z2M4mAGmGYU8hSeoZqglvfVBYkg0Lw=
|
||||||
git.openprivacy.ca/openprivacy/connectivity v1.3.1/go.mod h1:s0/QhONuUqJQfYTAgUlu+ya7G3Ov6bKgpT5QkOhVxDI=
|
git.openprivacy.ca/openprivacy/connectivity v1.3.1/go.mod h1:s0/QhONuUqJQfYTAgUlu+ya7G3Ov6bKgpT5QkOhVxDI=
|
||||||
|
git.openprivacy.ca/openprivacy/connectivity v1.3.2 h1:gbQ0YsrghzPEtIYBbI1/+S66l8AzuMM/G0XZiq9uPWI=
|
||||||
|
git.openprivacy.ca/openprivacy/connectivity v1.3.2/go.mod h1:DL9QitHjpyNspMUe3wjIej9gFgDK2FdRKP2JE4+7T90=
|
||||||
git.openprivacy.ca/openprivacy/log v1.0.0/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=
|
git.openprivacy.ca/openprivacy/log v1.0.0/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=
|
||||||
git.openprivacy.ca/openprivacy/log v1.0.1 h1:NWV5oBTatvlSzUE6wtB+UQCulgyMOtm4BXGd34evMys=
|
git.openprivacy.ca/openprivacy/log v1.0.1 h1:NWV5oBTatvlSzUE6wtB+UQCulgyMOtm4BXGd34evMys=
|
||||||
git.openprivacy.ca/openprivacy/log v1.0.1/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=
|
git.openprivacy.ca/openprivacy/log v1.0.1/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw=
|
||||||
|
@ -79,6 +83,8 @@ github.com/therecipe/qt/internal/binding/files/docs/5.12.0 v0.0.0-20200126204426
|
||||||
github.com/therecipe/qt/internal/binding/files/docs/5.12.0 v0.0.0-20200126204426-5074eb6d8c41/go.mod h1:7m8PDYDEtEVqfjoUQc2UrFqhG0CDmoVJjRlQxexndFc=
|
github.com/therecipe/qt/internal/binding/files/docs/5.12.0 v0.0.0-20200126204426-5074eb6d8c41/go.mod h1:7m8PDYDEtEVqfjoUQc2UrFqhG0CDmoVJjRlQxexndFc=
|
||||||
github.com/therecipe/qt/internal/binding/files/docs/5.13.0 v0.0.0-20200126204426-5074eb6d8c41 h1:jTzKrQ6EIPvKw1B9/wwoKJLrXF+ManMsXoUzufxAdsg=
|
github.com/therecipe/qt/internal/binding/files/docs/5.13.0 v0.0.0-20200126204426-5074eb6d8c41 h1:jTzKrQ6EIPvKw1B9/wwoKJLrXF+ManMsXoUzufxAdsg=
|
||||||
github.com/therecipe/qt/internal/binding/files/docs/5.13.0 v0.0.0-20200126204426-5074eb6d8c41/go.mod h1:mH55Ek7AZcdns5KPp99O0bg+78el64YCYWHiQKrOdt4=
|
github.com/therecipe/qt/internal/binding/files/docs/5.13.0 v0.0.0-20200126204426-5074eb6d8c41/go.mod h1:mH55Ek7AZcdns5KPp99O0bg+78el64YCYWHiQKrOdt4=
|
||||||
|
github.com/therecipe/qt/internal/binding/files/docs/5.13.0 v0.0.0-20200904063919-c0c124a5770d h1:AJRoBel/g9cDS+yE8BcN3E+TDD/xNAguG21aoR8DAIE=
|
||||||
|
github.com/therecipe/qt/internal/binding/files/docs/5.13.0 v0.0.0-20200904063919-c0c124a5770d/go.mod h1:mH55Ek7AZcdns5KPp99O0bg+78el64YCYWHiQKrOdt4=
|
||||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg=
|
go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg=
|
||||||
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||||
|
|
2
main.go
2
main.go
|
@ -301,7 +301,6 @@ func loadNetworkingAndFiles(gcd *ui.GrandCentralDispatcher, service bool, client
|
||||||
the.CwtchApp = libapp.NewAppClient(the.CwtchDir, clientBridge)
|
the.CwtchApp = libapp.NewAppClient(the.CwtchDir, clientBridge)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if gcd.GlobalSettings.PreviousPid != -1 {
|
if gcd.GlobalSettings.PreviousPid != -1 {
|
||||||
// Todo: Check if there is an older version of the ACN running...
|
// Todo: Check if there is an older version of the ACN running...
|
||||||
log.Debugf("checking to see if we shutdown the previous ACN (%v)", gcd.GlobalSettings.PreviousPid)
|
log.Debugf("checking to see if we shutdown the previous ACN (%v)", gcd.GlobalSettings.PreviousPid)
|
||||||
|
@ -321,7 +320,6 @@ func loadNetworkingAndFiles(gcd *ui.GrandCentralDispatcher, service bool, client
|
||||||
|
|
||||||
log.Infoln("Creating New App")
|
log.Infoln("Creating New App")
|
||||||
the.CwtchApp = libapp.NewApp(the.ACN, the.CwtchDir)
|
the.CwtchApp = libapp.NewApp(the.ACN, the.CwtchDir)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !service {
|
if !service {
|
||||||
|
|
432
qml/main.qml
432
qml/main.qml
|
@ -25,8 +25,6 @@ ApplicationWindow {
|
||||||
font.family: Fonts.applicationFontRegular.name
|
font.family: Fonts.applicationFontRegular.name
|
||||||
font.styleName: "Light"
|
font.styleName: "Light"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
readonly property real ratio: height / width
|
readonly property real ratio: height / width
|
||||||
|
|
||||||
FontAwesome { // PRETTY BUTTON ICONS
|
FontAwesome { // PRETTY BUTTON ICONS
|
||||||
|
@ -77,48 +75,19 @@ ApplicationWindow {
|
||||||
return px * 72 / (Screen.pixelDensity * 25.4)
|
return px * 72 / (Screen.pixelDensity * 25.4)
|
||||||
}
|
}
|
||||||
|
|
||||||
Toolbar {
|
|
||||||
id: toolbar
|
|
||||||
|
|
||||||
onLeftMenu: {
|
|
||||||
gcd.requestSettings()
|
|
||||||
parentStack.pane = parentStack.settingsPane
|
|
||||||
}
|
|
||||||
|
|
||||||
onBack: { backFn() }
|
StackView {
|
||||||
|
id: rootStack
|
||||||
|
|
||||||
onRightMenu: {
|
anchors.fill: parent
|
||||||
if (gcd.selectedConversation.length == 32) {
|
|
||||||
theStack.pane = theStack.groupProfilePane
|
|
||||||
gcd.requestGroupSettings(gcd.selectedConversation)
|
|
||||||
} else {
|
|
||||||
theStack.pane = theStack.userProfilePane
|
|
||||||
gcd.requestPeerSettings(gcd.selectedConversation)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StackLayout {
|
property bool splash: true
|
||||||
id: parentStack
|
|
||||||
currentIndex: 1
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.bottom: statusbar.top
|
|
||||||
anchors.top: toolbar.bottom
|
|
||||||
|
|
||||||
readonly property int splashPane: 0
|
// Splash pane
|
||||||
readonly property int managementPane: 1
|
initialItem: Rectangle {
|
||||||
readonly property int settingsPane: 2
|
anchors.fill: parent
|
||||||
readonly property int addEditProfilePane: 3
|
|
||||||
readonly property int profilePane: 4
|
|
||||||
readonly property int addEditServerPane: 5
|
|
||||||
property alias pane: parentStack.currentIndex
|
|
||||||
|
|
||||||
Rectangle { // Splash pane
|
|
||||||
color: Theme.backgroundMainColor
|
color: Theme.backgroundMainColor
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
//anchors.fill: parent
|
|
||||||
|
|
||||||
visible: true
|
visible: true
|
||||||
|
|
||||||
|
@ -129,201 +98,263 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle { // Profile login/management pane
|
replaceEnter: Transition {
|
||||||
Layout.fillHeight: true
|
PropertyAnimation{
|
||||||
Layout.fillWidth: true
|
property: "opacity"
|
||||||
visible: false
|
from: 0
|
||||||
|
to: 1
|
||||||
|
duration: 500
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
replaceExit: Transition {
|
||||||
|
PropertyAnimation{
|
||||||
|
property: "opacity"
|
||||||
|
from: 1
|
||||||
|
to: 0
|
||||||
|
duration: 450
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The actual app
|
||||||
|
property Item mainLayout: Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
color: Theme.backgroundMainColor
|
color: Theme.backgroundMainColor
|
||||||
|
|
||||||
ProfileManagerPane {
|
Toolbar {
|
||||||
id: profilesPane
|
id: toolbar
|
||||||
anchors.fill: parent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle { // Settings pane
|
onLeftMenu: {
|
||||||
Layout.fillHeight: true
|
gcd.requestSettings()
|
||||||
Layout.fillWidth: true
|
parentStack.pane = parentStack.settingsPane
|
||||||
color: Theme.backgroundPaneColor
|
|
||||||
|
|
||||||
SettingsPane {
|
|
||||||
id: settingsPane
|
|
||||||
anchors.fill: parent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Rectangle { // Profile Add / Edit pane
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
color: Theme.backgroundPaneColor
|
|
||||||
|
|
||||||
|
|
||||||
ProfileAddEditPane{
|
|
||||||
id: profileAddEditPane
|
|
||||||
anchors.fill: parent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout { // Profile Pane (contact list + overlays)
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
Rectangle { // THE LEFT PANE WITH TOOLS AND CONTACTS
|
|
||||||
color: Theme.backgroundMainColor
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.minimumWidth: Theme.sidePaneMinSize
|
|
||||||
Layout.maximumWidth: theStack.pane == theStack.emptyPane ? parent.width : Theme.sidePaneMinSize
|
|
||||||
Layout.fillWidth: theStack.pane == theStack.emptyPane ? true : false
|
|
||||||
visible: (windowItem.width >= Theme.doublePaneMinSize && !Qt.inputMethod.visible) || theStack.pane == theStack.emptyPane
|
|
||||||
|
|
||||||
ContactList {
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.right: (divider.visible ? divider.left : parent.right)
|
|
||||||
//anchors.topMargin: 10 * gcd.themeScale
|
|
||||||
dualPane: theStack.pane != theStack.emptyPane || theStack.pane == undefined
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
onBack: { backFn() }
|
||||||
id: divider
|
|
||||||
width: 2
|
|
||||||
anchors.right: parent.right
|
|
||||||
height: parent.height - (20 * gcd.themeScale)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
visible: theStack.pane != theStack.emptyPane
|
|
||||||
//Layout.fillHeight: true
|
|
||||||
color: Theme.dividerColor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle { // THE RIGHT PANE WHERE THE MESSAGES AND STUFF GO
|
onRightMenu: {
|
||||||
color: Theme.backgroundPaneColor
|
if (gcd.selectedConversation.length == 32) {
|
||||||
Layout.fillWidth: true
|
theStack.pane = theStack.groupProfilePane
|
||||||
Layout.fillHeight: true
|
gcd.requestGroupSettings(gcd.selectedConversation)
|
||||||
|
} else {
|
||||||
StackLayout {
|
theStack.pane = theStack.userProfilePane
|
||||||
id: theStack
|
gcd.requestPeerSettings(gcd.selectedConversation)
|
||||||
anchors.fill: parent
|
|
||||||
currentIndex: 0
|
|
||||||
|
|
||||||
property alias pane: theStack.currentIndex
|
|
||||||
readonly property int emptyPane: 0
|
|
||||||
readonly property int messagePane: 1
|
|
||||||
readonly property int userProfilePane: 2
|
|
||||||
readonly property int groupProfilePane: 3
|
|
||||||
readonly property int addPeerGroupPane: 4
|
|
||||||
readonly property int serverInfoPane: 5
|
|
||||||
|
|
||||||
Item { anchors.fill: parent } // empty
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
color: Theme.backgroundMainColor
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
OverlayPane { // messagePane
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: 10 * gcd.themeScale
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StackLayout {
|
||||||
|
id: parentStack
|
||||||
|
currentIndex: managementPane
|
||||||
|
|
||||||
PeerSettingsPane { anchors.fill: parent }
|
anchors.right: parent.right
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.bottom: statusbar.top
|
||||||
|
anchors.top: toolbar.bottom
|
||||||
|
|
||||||
GroupSettingsPane{ anchors.fill: parent }
|
readonly property int managementPane: 0
|
||||||
|
readonly property int settingsPane: 1
|
||||||
|
readonly property int addEditProfilePane: 2
|
||||||
|
readonly property int profilePane: 3
|
||||||
|
readonly property int addEditServerPane: 4
|
||||||
|
property alias pane: parentStack.currentIndex
|
||||||
|
|
||||||
AddPeerGroupPane {
|
Rectangle { // Profile login/management pane
|
||||||
id: addPeerGroupPaneInstance
|
Layout.fillHeight: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
visible: false
|
||||||
|
color: Theme.backgroundMainColor
|
||||||
|
|
||||||
|
ProfileManagerPane {
|
||||||
|
id: profilesPane
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ServerInfoPane { anchors.fill: parent }
|
Rectangle { // Settings pane
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
color: Theme.backgroundPaneColor
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
SettingsPane {
|
||||||
parentStack.updateToolbar()
|
id: settingsPane
|
||||||
if (currentIndex == emptyPane) {
|
anchors.fill: parent
|
||||||
toolbar.hideTitle()
|
}
|
||||||
toolbar.rightMenuVisible = false
|
}
|
||||||
} else if (currentIndex == addPeerGroupPane) {
|
|
||||||
//: New Connection
|
Rectangle { // Profile Add / Edit pane
|
||||||
toolbar.setTitle(qsTr('new-connection-pane-title'))
|
Layout.fillHeight: true
|
||||||
toolbar.rightMenuVisible = false
|
Layout.fillWidth: true
|
||||||
addPeerGroupPaneInstance.reset()
|
color: Theme.backgroundPaneColor
|
||||||
|
|
||||||
|
|
||||||
|
ProfileAddEditPane{
|
||||||
|
id: profileAddEditPane
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout { // Profile Pane (contact list + overlays)
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
Rectangle { // THE LEFT PANE WITH TOOLS AND CONTACTS
|
||||||
|
color: Theme.backgroundMainColor
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.minimumWidth: Theme.sidePaneMinSize
|
||||||
|
Layout.maximumWidth: theStack.pane == theStack.emptyPane ? parent.width : Theme.sidePaneMinSize
|
||||||
|
Layout.fillWidth: theStack.pane == theStack.emptyPane ? true : false
|
||||||
|
visible: (windowItem.width >= Theme.doublePaneMinSize && !Qt.inputMethod.visible) || theStack.pane == theStack.emptyPane
|
||||||
|
|
||||||
|
ContactList {
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.right: (divider.visible ? divider.left : parent.right)
|
||||||
|
//anchors.topMargin: 10 * gcd.themeScale
|
||||||
|
dualPane: theStack.pane != theStack.emptyPane || theStack.pane == undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: divider
|
||||||
|
width: 2
|
||||||
|
anchors.right: parent.right
|
||||||
|
height: parent.height - (20 * gcd.themeScale)
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: theStack.pane != theStack.emptyPane
|
||||||
|
//Layout.fillHeight: true
|
||||||
|
color: Theme.dividerColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onWidthChanged: {toolbar.titleWidth = width}
|
Rectangle { // THE RIGHT PANE WHERE THE MESSAGES AND STUFF GO
|
||||||
|
color: Theme.backgroundPaneColor
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
|
||||||
|
StackLayout {
|
||||||
|
id: theStack
|
||||||
|
anchors.fill: parent
|
||||||
|
currentIndex: 0
|
||||||
|
|
||||||
|
property alias pane: theStack.currentIndex
|
||||||
|
readonly property int emptyPane: 0
|
||||||
|
readonly property int messagePane: 1
|
||||||
|
readonly property int userProfilePane: 2
|
||||||
|
readonly property int groupProfilePane: 3
|
||||||
|
readonly property int addPeerGroupPane: 4
|
||||||
|
readonly property int serverInfoPane: 5
|
||||||
|
|
||||||
|
Item { anchors.fill: parent } // empty
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
color: Theme.backgroundMainColor
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
OverlayPane { // messagePane
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: 10 * gcd.themeScale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PeerSettingsPane { anchors.fill: parent }
|
||||||
|
|
||||||
|
GroupSettingsPane{ anchors.fill: parent }
|
||||||
|
|
||||||
|
AddPeerGroupPane {
|
||||||
|
id: addPeerGroupPaneInstance
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerInfoPane { anchors.fill: parent }
|
||||||
|
|
||||||
|
onCurrentIndexChanged: {
|
||||||
|
parentStack.updateToolbar()
|
||||||
|
if (currentIndex == emptyPane) {
|
||||||
|
toolbar.hideTitle()
|
||||||
|
toolbar.rightMenuVisible = false
|
||||||
|
} else if (currentIndex == addPeerGroupPane) {
|
||||||
|
//: New Connection
|
||||||
|
toolbar.setTitle(qsTr('new-connection-pane-title'))
|
||||||
|
toolbar.rightMenuVisible = false
|
||||||
|
addPeerGroupPaneInstance.reset()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onWidthChanged: {toolbar.titleWidth = width}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle { // Server Add / Edit pane
|
Rectangle { // Server Add / Edit pane
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: Theme.backgroundPaneColor
|
color: Theme.backgroundPaneColor
|
||||||
|
|
||||||
|
|
||||||
ServerAddEditPane{
|
ServerAddEditPane{
|
||||||
id: serverAddEditPane
|
id: serverAddEditPane
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
focus: true
|
focus: true
|
||||||
Keys.onPressed: {
|
Keys.onPressed: {
|
||||||
if (event.key == Qt.Key_Back) {
|
if (event.key == Qt.Key_Back) {
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
backFn()
|
backFn()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onCurrentIndexChanged : { updateToolbar(); statusbar.resetHeight() }
|
onCurrentIndexChanged : { updateToolbar(); statusbar.resetHeight() }
|
||||||
|
|
||||||
|
function updateToolbar() {
|
||||||
function updateToolbar() {
|
if (rootStack.splash == true) {
|
||||||
if (currentIndex == splashPane) {
|
|
||||||
toolbar.hideTitle()
|
|
||||||
toolbar.rightMenuVisible = false
|
|
||||||
toolbar.visible = false
|
|
||||||
} else {
|
|
||||||
toolbar.visible = true
|
|
||||||
if (currentIndex == managementPane) {
|
|
||||||
toolbar.hideTitle()
|
|
||||||
toolbar.rightMenuVisible = false
|
|
||||||
toolbar.color = Theme.toolbarMainColor
|
|
||||||
toolbar.leftMenuVisible = true
|
|
||||||
toolbar.backVisible = false
|
|
||||||
} else {
|
|
||||||
toolbar.leftMenuVisible = false
|
|
||||||
toolbar.backVisible = true
|
|
||||||
|
|
||||||
if (currentIndex == profilePane && theStack.currentIndex == theStack.emptyPane) {
|
|
||||||
toolbar.hideTitle()
|
toolbar.hideTitle()
|
||||||
toolbar.rightMenuVisible = false
|
toolbar.rightMenuVisible = false
|
||||||
toolbar.color = Theme.toolbarMainColor
|
toolbar.visible = false
|
||||||
} else {
|
} else {
|
||||||
toolbar.color = Theme.toolbarAltColor
|
toolbar.visible = true
|
||||||
|
if (currentIndex == managementPane) {
|
||||||
|
toolbar.hideTitle()
|
||||||
|
toolbar.rightMenuVisible = false
|
||||||
|
toolbar.color = Theme.toolbarMainColor
|
||||||
|
toolbar.leftMenuVisible = true
|
||||||
|
toolbar.backVisible = false
|
||||||
|
} else {
|
||||||
|
toolbar.leftMenuVisible = false
|
||||||
|
toolbar.backVisible = true
|
||||||
|
|
||||||
|
if (currentIndex == profilePane && theStack.currentIndex == theStack.emptyPane) {
|
||||||
|
toolbar.hideTitle()
|
||||||
|
toolbar.rightMenuVisible = false
|
||||||
|
toolbar.color = Theme.toolbarMainColor
|
||||||
|
} else {
|
||||||
|
toolbar.color = Theme.toolbarAltColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: updateToolbar()
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: Theme
|
||||||
|
|
||||||
|
onThemeChanged: {
|
||||||
|
parentStack.updateToolbar()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: updateToolbar()
|
Statusbar {
|
||||||
|
id: statusbar
|
||||||
Connections {
|
|
||||||
target: Theme
|
|
||||||
|
|
||||||
onThemeChanged: {
|
|
||||||
parentStack.updateToolbar()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Statusbar {
|
|
||||||
id: statusbar
|
|
||||||
}
|
|
||||||
|
|
||||||
function backFn() {
|
function backFn() {
|
||||||
if (parentStack.currentIndex == parentStack.managementPane) {
|
if (parentStack.currentIndex == parentStack.managementPane) {
|
||||||
|
@ -368,6 +399,7 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Connections { // POPUPS ARE INVOKED BY GO FUNCS
|
Connections { // POPUPS ARE INVOKED BY GO FUNCS
|
||||||
target: gcd
|
target: gcd
|
||||||
|
|
||||||
|
@ -379,8 +411,12 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoaded: function() {
|
onLoaded: function() {
|
||||||
parentStack.pane = parentStack.managementPane
|
//parentStack.pane = parentStack.managementPane
|
||||||
|
rootStack.replace(rootStack.mainLayout)
|
||||||
splashPane.running = false
|
splashPane.running = false
|
||||||
|
rootStack.splash = false
|
||||||
|
parentStack.updateToolbar()
|
||||||
|
statusbar.resetHeight()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,10 @@ Item {
|
||||||
width: splashImage.width
|
width: splashImage.width
|
||||||
|
|
||||||
indeterminate: true
|
indeterminate: true
|
||||||
|
visible: sp.running
|
||||||
|
|
||||||
style: ProgressBarStyle {
|
style: ProgressBarStyle {
|
||||||
progress: CwtchProgress { running: sp.running }
|
progress: CwtchProgress { running: sp.running }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ Rectangle {
|
||||||
|
|
||||||
onStatusChanged: { changeStatus() }
|
onStatusChanged: { changeStatus() }
|
||||||
|
|
||||||
Component.onCompleted: { resetHeight() }
|
Component.onCompleted: { resetHeight(); changeStatus() }
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: gcd
|
target: gcd
|
||||||
|
|
Reference in New Issue