mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Improve 1st start experience
This commit adds a start page that is shown when there are no dives in the list, for example when the user first starts the app. Instead of a large empty screen, we offer 3 ways for the user to get dives onto the device: download from cloud storage, dive computer and adding dives manually. This fills in the empty space in the dive list, and isn't a top-level item since it really just makes sure the user isn't greeted with a big empty space, which looks pretty unpolished, but rather guided through the first steps. Needs aligning of the naming in the actions. Signed-off-by: Sebastian Kügler <sebas@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6dfac6a081
commit
6b886f0da2
3 changed files with 69 additions and 0 deletions
|
|
@ -167,4 +167,12 @@ Rectangle {
|
||||||
section.criteria: ViewSection.FullString
|
section.criteria: ViewSection.FullString
|
||||||
section.delegate: tripHeading
|
section.delegate: tripHeading
|
||||||
}
|
}
|
||||||
|
StartPage {
|
||||||
|
anchors.fill: parent
|
||||||
|
opacity: (diveModel.rowCount() == 0) ? 1.0 : 0
|
||||||
|
Behavior on opacity { NumberAnimation { duration: units.shortDuration } }
|
||||||
|
Component.onCompleted: {
|
||||||
|
print("diveModel.count " + diveModel.rowCount());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
60
qt-mobile/qml/StartPage.qml
Normal file
60
qt-mobile/qml/StartPage.qml
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.2
|
||||||
|
import QtQuick.Layouts 1.1
|
||||||
|
|
||||||
|
Item {
|
||||||
|
ColumnLayout {
|
||||||
|
id: startpage
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: units.gridUnit * 4
|
||||||
|
|
||||||
|
property int buttonWidth: welcomeText.width * 0.66
|
||||||
|
|
||||||
|
Label {
|
||||||
|
Layout.bottomMargin: units.largeSpacing
|
||||||
|
text: "Subsurface Divelog"
|
||||||
|
font.pointSize: welcomeText.font.pointSize * 2
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
id: welcomeText
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.bottomMargin: units.largeSpacing
|
||||||
|
text: "No recorded dives found. You can download your dives to this device from the Subsurface cloud storage service, from your dive computer, or add them manually."
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
id: cloudstorageButton
|
||||||
|
Layout.bottomMargin: units.largeSpacing
|
||||||
|
Layout.preferredWidth: startpage.buttonWidth
|
||||||
|
text: "Connect to CloudStorage..."
|
||||||
|
onClicked: {
|
||||||
|
stackView.push(prefsWindow)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
id: computerButton
|
||||||
|
Layout.preferredWidth: startpage.buttonWidth
|
||||||
|
Layout.bottomMargin: units.largeSpacing
|
||||||
|
text: "Transfer from dive computer..."
|
||||||
|
onClicked: {
|
||||||
|
stackView.push(downloadDivesWindow)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
id: manualButton
|
||||||
|
Layout.preferredWidth: startpage.buttonWidth
|
||||||
|
Layout.bottomMargin: units.largeSpacing
|
||||||
|
text: "Add dive manually..."
|
||||||
|
onClicked: {
|
||||||
|
manager.addDive();
|
||||||
|
stackView.push(detailsWindow)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
width: parent.width
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
<file>Log.qml</file>
|
<file>Log.qml</file>
|
||||||
<file>TopBar.qml</file>
|
<file>TopBar.qml</file>
|
||||||
<file>ThemeTest.qml</file>
|
<file>ThemeTest.qml</file>
|
||||||
|
<file>StartPage.qml</file>
|
||||||
<file alias="Label.qml">components/Label.qml</file>
|
<file alias="Label.qml">components/Label.qml</file>
|
||||||
<file alias="subsurface-mobile-icon.png">../../icons/subsurface-mobile-icon.png</file>
|
<file alias="subsurface-mobile-icon.png">../../icons/subsurface-mobile-icon.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue