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,6 +75,52 @@ ApplicationWindow {
return px * 72 / (Screen.pixelDensity * 25.4)
}
StackView {
id: rootStack
anchors.fill: parent
property bool splash: true
// Splash pane
initialItem: Rectangle {
anchors.fill: parent
color: Theme.backgroundMainColor
visible: true
SplashPane {
id: splashPane
anchors.fill: parent
running: true
}
}
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
Toolbar {
id: toolbar
@ -100,35 +144,20 @@ ApplicationWindow {
StackLayout {
id: parentStack
currentIndex: 1
currentIndex: managementPane
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: statusbar.top
anchors.top: toolbar.bottom
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
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
Rectangle { // Splash pane
color: Theme.backgroundMainColor
Layout.fillHeight: true
Layout.fillWidth: true
//anchors.fill: parent
visible: true
SplashPane {
id: splashPane
anchors.fill: parent
running: true
}
}
Rectangle { // Profile login/management pane
Layout.fillHeight: true
Layout.fillWidth: true
@ -152,7 +181,6 @@ ApplicationWindow {
}
}
Rectangle { // Profile Add / Edit pane
Layout.fillHeight: true
Layout.fillWidth: true
@ -281,9 +309,8 @@ ApplicationWindow {
onCurrentIndexChanged : { updateToolbar(); statusbar.resetHeight() }
function updateToolbar() {
if (currentIndex == splashPane) {
if (rootStack.splash == true) {
toolbar.hideTitle()
toolbar.rightMenuVisible = false
toolbar.visible = false
@ -324,6 +351,10 @@ ApplicationWindow {
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