Busy indicator for chat list

This commit is contained in:
Sebastian J. Wolf 2020-08-30 13:42:22 +02:00
parent a6768bc9dd
commit d4954e0d7e
3 changed files with 186 additions and 158 deletions

View file

@ -54,11 +54,6 @@ Page {
} }
} }
BusyLabel {
text: qsTr("Loading...")
running: overviewPage.loading
}
function setPageStatus() { function setPageStatus() {
switch (overviewPage.connectionState) { switch (overviewPage.connectionState) {
case TelegramAPI.WaitingForNetwork: case TelegramAPI.WaitingForNetwork:
@ -187,15 +182,21 @@ Page {
} }
} }
Item {
id: chatListItem
width: parent.width
height: parent.height - Theme.paddingMedium - headerRow.height
SilicaListView { SilicaListView {
id: chatListView id: chatListView
width: parent.width anchors.fill: parent
height: parent.height - Theme.paddingMedium - headerRow.height
clip: true clip: true
visible: count > 0 visible: count > 0
opacity: overviewPage.chatListCreated ? 1 : 0
Behavior on opacity { NumberAnimation {} }
model: chatListModel model: chatListModel
delegate: ListItem { delegate: ListItem {
@ -381,6 +382,33 @@ Page {
VerticalScrollDecorator {} VerticalScrollDecorator {}
} }
Column {
width: parent.width
height: loadingLabel.height + loadingBusyIndicator.height + Theme.paddingMedium
spacing: Theme.paddingMedium
anchors.verticalCenter: parent.verticalCenter
opacity: overviewPage.chatListCreated ? 0 : 1
Behavior on opacity { NumberAnimation {} }
visible: !overviewPage.chatListCreated
InfoLabel {
id: loadingLabel
text: qsTr("Loading chat list...")
}
BusyIndicator {
id: loadingBusyIndicator
anchors.horizontalCenter: parent.horizontalCenter
running: !overviewPage.chatListCreated
size: BusyIndicatorSize.Large
}
}
}
} }
} }

View file

@ -151,7 +151,7 @@
</message> </message>
<message> <message>
<source>Loading messages...</source> <source>Loading messages...</source>
<translation>Nachrichten laden...</translation> <translation>Lade Nachrichten...</translation>
</message> </message>
</context> </context>
<context> <context>
@ -275,10 +275,6 @@
<source>About Fernschreiber</source> <source>About Fernschreiber</source>
<translation>Über Fernschreiber</translation> <translation>Über Fernschreiber</translation>
</message> </message>
<message>
<source>Loading...</source>
<translation>Laden...</translation>
</message>
<message> <message>
<source>Fernschreiber</source> <source>Fernschreiber</source>
<translation>Fernschreiber</translation> <translation>Fernschreiber</translation>
@ -307,6 +303,10 @@
<source>You</source> <source>You</source>
<translation>Sie</translation> <translation>Sie</translation>
</message> </message>
<message>
<source>Loading chat list...</source>
<translation>Lade Chatliste...</translation>
</message>
</context> </context>
<context> <context>
<name>VideoPage</name> <name>VideoPage</name>

View file

@ -275,10 +275,6 @@
<source>About Fernschreiber</source> <source>About Fernschreiber</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Loading...</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Fernschreiber</source> <source>Fernschreiber</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -307,6 +303,10 @@
<source>You</source> <source>You</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Loading chat list...</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>VideoPage</name> <name>VideoPage</name>