sentBanner

Adds a confirmation banner when sending a Toot
This commit is contained in:
molan-git 2020-05-24 19:54:46 +02:00
parent b177884567
commit c8ad3f02cc
21 changed files with 325 additions and 196 deletions

View file

@ -53,6 +53,7 @@ HEADERS += src/dbusAdaptor.h
HEADERS += src/dbus.h HEADERS += src/dbus.h
DISTFILES += qml/harbour-tooter.qml \ DISTFILES += qml/harbour-tooter.qml \
qml/pages/components/InfoBanner.qml \
qml/pages/components/VisualContainer.qml \ qml/pages/components/VisualContainer.qml \
qml/pages/components/MiniStatus.qml \ qml/pages/components/MiniStatus.qml \
qml/pages/components/MiniHeader.qml \ qml/pages/components/MiniHeader.qml \

View file

@ -4,9 +4,11 @@ import harbour.tooter.Uploader 1.0
import "../lib/API.js" as Logic import "../lib/API.js" as Logic
import "./components/" import "./components/"
Page { Page {
id: conversationPage id: conversationPage
property string type property string headerTitle: ""
property string type
property alias title: header.title property alias title: header.title
property alias description: header.description property alias description: header.description
property alias avatar: header.image property alias avatar: header.image
@ -40,6 +42,10 @@ Page {
} }
} }
InfoBanner {
id: sentBanner
}
ListModel { ListModel {
id: mediaModel id: mediaModel
onCountChanged: { onCountChanged: {
@ -62,7 +68,7 @@ Page {
SilicaListView { SilicaListView {
id: conversationList id: conversationList
header: PageHeader { header: PageHeader {
title: qsTr("Conversation") title: headerTitle // pageTitle pushed from MainPage.qml or VisualContainer.qml
} }
clip: true clip: true
anchors { anchors {
@ -208,7 +214,6 @@ Page {
|| description.charAt( || description.charAt(
0) == '#') ? description + ' ' : '' 0) == '#') ? description + ' ' : ''
height: Math.max(270, Math.min(900, implicitHeight)) height: Math.max(270, Math.min(900, implicitHeight))
//height: implicitHeight
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
placeholderText: qsTr("What's on your mind?") placeholderText: qsTr("What's on your mind?")
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
@ -304,7 +309,6 @@ Page {
} }
} }
IconButton { IconButton {
id: btnContentWarning id: btnContentWarning
anchors { anchors {
top: toot.bottom top: toot.bottom
@ -426,11 +430,11 @@ Page {
msg.params['spoiler_text'] = warningContent.text msg.params['spoiler_text'] = warningContent.text
} }
worker.sendMessage(msg) worker.sendMessage(msg)
warningContent.text = "" warningContent.text = ""
toot.text = "" toot.text = ""
mediaModel.clear() mediaModel.clear()
pageStack.pop() sentBanner.showText(qsTr("Toot sent!"))
} }
} }

View file

@ -246,7 +246,7 @@ Page {
visible: !isPortrait ? true : !infoPanel.open visible: !isPortrait ? true : !infoPanel.open
icon.source: "image://theme/icon-l-add" icon.source: "image://theme/icon-l-add"
onClicked: { onClicked: {
pageStack.push(Qt.resolvedUrl("Conversation.qml"), {title: qsTr("New Toot"), type: "new"}) pageStack.push(Qt.resolvedUrl("Conversation.qml"), {headerTitle: qsTr("New Toot"), type: "new"})
} }
} }

View file

@ -0,0 +1,62 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
DockedPanel {
id: root
z: 100;
width: parent.width //- Theme.paddingLarge*4
//x: Theme.paddingLarge*2
height: content.height
dock: Dock.Bottom
Rectangle {
id: content
width: root.width
height: infoLabel.height + 4*Theme.paddingMedium
//anchors.topMargin: 20
color: Theme.highlightBackgroundColor
opacity: 1.0
Label {
id: infoLabel
text : ""
color: Theme.primaryColor
font.family: Theme.fontFamilyHeading
font.pixelSize: Theme.fontSizeMedium
//font.weight: Font.Bold
width: parent.width
wrapMode: Text.WrapAnywhere
anchors {
left: parent.left
leftMargin: Theme.horizontalPageMargin
right: parent.right
rightMargin: Theme.horizontalPageMargin
verticalCenter: parent.verticalCenter
}
}
MouseArea {
anchors.fill: parent
onClicked: {
root.hide()
autoClose.stop()
}
}
}
function showText(text) {
infoLabel.text = text
root.show()
autoClose.start()
}
Timer {
id: autoClose
interval: 6000
running: false
onTriggered: {
root.hide()
stop()
}
}
}

View file

@ -0,0 +1,61 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
DockedPanel {
id: root
z: 100;
width: parent.width
height: content.height
dock: Dock.Bottom
Rectangle {
id: content
width: root.width
height: infoLabel.height + 4*Theme.paddingMedium
//anchors.topMargin: 20
color: Theme.highlightBackgroundColor
opacity: 1.0
Label {
id: infoLabel
text : ""
color: Theme.primaryColor
font.family: Theme.fontFamilyHeading
font.pixelSize: Theme.fontSizeMedium
//font.weight: Font.Bold
width: parent.width
wrapMode: Text.WrapAnywhere
anchors {
left: parent.left
leftMargin: Theme.horizontalPageMargin
right: parent.right
rightMargin: Theme.ho rizontalPageMargin
verticalCenter: parent.verticalCenter
}
}
MouseArea {
anchors.fill: parent
onClicked: {
root.hide()
autoClose.stop()
}
}
}
function showText(text) {
infoLabel.text = text
root.show()
autoClose.start()
}
Timer {
id: autoClose
interval: 6000
running: false
onTriggered: {
root.hide()
stop()
}
}
}

View file

@ -277,6 +277,7 @@ BackgroundItem {
if (typeof mdl !== "undefined") if (typeof mdl !== "undefined")
m.append(mdl.get(index)) m.append(mdl.get(index))
pageStack.push(Qt.resolvedUrl("../Conversation.qml"), { pageStack.push(Qt.resolvedUrl("../Conversation.qml"), {
headerTitle: "Conversation",
toot_id: status_id, toot_id: status_id,
title: account_display_name, title: account_display_name,
description: '@'+account_acct, description: '@'+account_acct,

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Konversation</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Löschen</translation> <translation>Löschen</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation>Was gibt&apos;s Neues?</translation> <translation>Was gibt&apos;s Neues?</translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Συνομιλία</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Διαγραφή</translation> <translation>Διαγραφή</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Conversación</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Borrar</translation> <translation>Borrar</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation>¿En qué estás pensando?</translation> <translation>¿En qué estás pensando?</translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation type="unfinished"></translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Conversation</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Supprimer</translation> <translation>Supprimer</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation>Qu&apos;avez-vous en tête?</translation> <translation>Qu&apos;avez-vous en tête?</translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -28,52 +28,52 @@
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message> <message>
<location filename="../qml/pages/Conversation.qml" line="65"/> <location filename="../qml/pages/Conversation.qml" line="188"/>
<source>Conversation</source>
<translation>Conversazione</translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="182"/>
<source>Write your warning here</source> <source>Write your warning here</source>
<translation>Contenuto avviso</translation> <translation>Contenuto avviso</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/Conversation.qml" line="213"/> <location filename="../qml/pages/Conversation.qml" line="218"/>
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation>A cosa stai pensando?</translation> <translation>A cosa stai pensando?</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/Conversation.qml" line="276"/> <location filename="../qml/pages/Conversation.qml" line="281"/>
<source>Delete</source> <source>Delete</source>
<translation>Elimina</translation> <translation>Elimina</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/Conversation.qml" line="376"/> <location filename="../qml/pages/Conversation.qml" line="380"/>
<source>Public</source> <source>Public</source>
<translation>Pubblico</translation> <translation>Pubblico</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/Conversation.qml" line="379"/> <location filename="../qml/pages/Conversation.qml" line="383"/>
<source>Unlisted</source> <source>Unlisted</source>
<translation>Non elencato</translation> <translation>Non elencato</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/Conversation.qml" line="382"/> <location filename="../qml/pages/Conversation.qml" line="386"/>
<source>Followers-only</source> <source>Followers-only</source>
<translation>Solo ai seguaci</translation> <translation>Solo ai seguaci</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/Conversation.qml" line="385"/> <location filename="../qml/pages/Conversation.qml" line="389"/>
<source>Direct</source> <source>Direct</source>
<translation>Diretto</translation> <translation>Diretto</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/Conversation.qml" line="499"/> <location filename="../qml/pages/Conversation.qml" line="437"/>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="503"/>
<source>Emojis</source> <source>Emojis</source>
<translation>Emojis</translation> <translation>Emojis</translation>
</message> </message>
<message> <message>
<location filename="../qml/pages/Conversation.qml" line="500"/> <location filename="../qml/pages/Conversation.qml" line="504"/>
<source>Tap to insert</source> <source>Tap to insert</source>
<translation>Tap per inserire</translation> <translation>Tap per inserire</translation>
</message> </message>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Gesprek</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Verwijderen</translation> <translation>Verwijderen</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Gesprek</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Verwijderen</translation> <translation>Verwijderen</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Discutida</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Escafar</translation> <translation>Escafar</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Konwersacja</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Usuń</translation> <translation>Usuń</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Беседа</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Удалить</translation> <translation>Удалить</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Разговор</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Обриши</translation> <translation>Обриши</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Konversation</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Radera</translation> <translation>Radera</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation></translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation></translation> <translation></translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation>?</translation> <translation>?</translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context> </context>
<context> <context>
<name>Conversation</name> <name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Conversation</translation>
</message>
<message> <message>
<source>Delete</source> <source>Delete</source>
<translation>Delete</translation> <translation>Delete</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source> <source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>ImageFullScreen</name> <name>ImageFullScreen</name>