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

Reviewed-on: #376

Tested on Android: #377
This commit is contained in:
Sarah Jamie Lewis 2020-11-17 12:49:26 -08:00
commit 7f011663d7
6 changed files with 243 additions and 203 deletions

2
go.mod
View File

@ -4,7 +4,7 @@ go 1.12
require (
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
github.com/c-bata/go-prompt v0.2.3 // indirect
github.com/google/go-cmp v0.4.0 // indirect

6
go.sum
View File

@ -19,6 +19,8 @@ cwtch.im/tapir v0.2.1 h1:t1YJB9q5sV1A9xwiiwL6WVfw3dwQWLoecunuzT1PQtw=
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/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.1 h1:oRL56TR9ZQnKkGkTIQ9wYbJ2IkOOsi/zLYExYiAS+sE=
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.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.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.1 h1:NWV5oBTatvlSzUE6wtB+UQCulgyMOtm4BXGd34evMys=
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.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-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=
go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg=
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=

View File

@ -301,7 +301,6 @@ func loadNetworkingAndFiles(gcd *ui.GrandCentralDispatcher, service bool, client
the.CwtchApp = libapp.NewAppClient(the.CwtchDir, clientBridge)
}
} else {
if gcd.GlobalSettings.PreviousPid != -1 {
// 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)
@ -321,7 +320,6 @@ func loadNetworkingAndFiles(gcd *ui.GrandCentralDispatcher, service bool, client
log.Infoln("Creating New App")
the.CwtchApp = libapp.NewApp(the.ACN, the.CwtchDir)
}
if !service {

View File

@ -25,8 +25,6 @@ ApplicationWindow {
font.family: Fonts.applicationFontRegular.name
font.styleName: "Light"
readonly property real ratio: height / width
FontAwesome { // PRETTY BUTTON ICONS
@ -77,48 +75,19 @@ ApplicationWindow {
return px * 72 / (Screen.pixelDensity * 25.4)
}
Toolbar {
id: toolbar
onLeftMenu: {
gcd.requestSettings()
parentStack.pane = parentStack.settingsPane
}
onBack: { backFn() }
StackView {
id: rootStack
onRightMenu: {
if (gcd.selectedConversation.length == 32) {
theStack.pane = theStack.groupProfilePane
gcd.requestGroupSettings(gcd.selectedConversation)
} else {
theStack.pane = theStack.userProfilePane
gcd.requestPeerSettings(gcd.selectedConversation)
}
}
}
anchors.fill: parent
StackLayout {
id: parentStack
currentIndex: 1
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: statusbar.top
anchors.top: toolbar.bottom
property bool splash: true
readonly property int splashPane: 0
readonly property int managementPane: 1
readonly property int settingsPane: 2
readonly property int addEditProfilePane: 3
readonly property int profilePane: 4
readonly property int addEditServerPane: 5
property alias pane: parentStack.currentIndex
Rectangle { // Splash pane
// Splash pane
initialItem: Rectangle {
anchors.fill: parent
color: Theme.backgroundMainColor
Layout.fillHeight: true
Layout.fillWidth: true
//anchors.fill: parent
visible: true
@ -129,201 +98,263 @@ ApplicationWindow {
}
}
Rectangle { // Profile login/management pane
Layout.fillHeight: true
Layout.fillWidth: true
visible: false
replaceEnter: Transition {
PropertyAnimation{
property: "opacity"
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
ProfileManagerPane {
id: profilesPane
anchors.fill: parent
}
}
Toolbar {
id: toolbar
Rectangle { // Settings pane
Layout.fillHeight: true
Layout.fillWidth: true
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
onLeftMenu: {
gcd.requestSettings()
parentStack.pane = parentStack.settingsPane
}
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
}
}
onBack: { backFn() }
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
}
onRightMenu: {
if (gcd.selectedConversation.length == 32) {
theStack.pane = theStack.groupProfilePane
gcd.requestGroupSettings(gcd.selectedConversation)
} else {
theStack.pane = theStack.userProfilePane
gcd.requestPeerSettings(gcd.selectedConversation)
}
}
}
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 {
id: addPeerGroupPaneInstance
Rectangle { // Profile login/management pane
Layout.fillHeight: true
Layout.fillWidth: true
visible: false
color: Theme.backgroundMainColor
ProfileManagerPane {
id: profilesPane
anchors.fill: parent
}
}
ServerInfoPane { anchors.fill: parent }
Rectangle { // Settings pane
Layout.fillHeight: true
Layout.fillWidth: true
color: Theme.backgroundPaneColor
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()
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 {
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
Layout.fillHeight: true
Layout.fillWidth: true
color: Theme.backgroundPaneColor
Rectangle { // Server Add / Edit pane
Layout.fillHeight: true
Layout.fillWidth: true
color: Theme.backgroundPaneColor
ServerAddEditPane{
id: serverAddEditPane
anchors.fill: parent
}
}
ServerAddEditPane{
id: serverAddEditPane
anchors.fill: parent
}
}
focus: true
Keys.onPressed: {
if (event.key == Qt.Key_Back) {
event.accepted = true
backFn()
}
}
focus: true
Keys.onPressed: {
if (event.key == Qt.Key_Back) {
event.accepted = true
backFn()
}
}
onCurrentIndexChanged : { updateToolbar(); statusbar.resetHeight() }
onCurrentIndexChanged : { updateToolbar(); statusbar.resetHeight() }
function updateToolbar() {
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) {
function updateToolbar() {
if (rootStack.splash == true) {
toolbar.hideTitle()
toolbar.rightMenuVisible = false
toolbar.color = Theme.toolbarMainColor
toolbar.visible = false
} 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()
Connections {
target: Theme
onThemeChanged: {
parentStack.updateToolbar()
Statusbar {
id: statusbar
}
}
}
Statusbar {
id: statusbar
}
function backFn() {
if (parentStack.currentIndex == parentStack.managementPane) {
@ -368,6 +399,7 @@ ApplicationWindow {
}
Connections { // POPUPS ARE INVOKED BY GO FUNCS
target: gcd
@ -379,8 +411,12 @@ ApplicationWindow {
}
onLoaded: function() {
parentStack.pane = parentStack.managementPane
//parentStack.pane = parentStack.managementPane
rootStack.replace(rootStack.mainLayout)
splashPane.running = false
rootStack.splash = false
parentStack.updateToolbar()
statusbar.resetHeight()
}
}

View File

@ -27,10 +27,10 @@ Item {
width: splashImage.width
indeterminate: true
visible: sp.running
style: ProgressBarStyle {
progress: CwtchProgress { running: sp.running }
}
}
}

View File

@ -173,7 +173,7 @@ Rectangle {
onStatusChanged: { changeStatus() }
Component.onCompleted: { resetHeight() }
Component.onCompleted: { resetHeight(); changeStatus() }
Connections {
target: gcd