sentBanner
Adds a confirmation banner when sending a Toot
This commit is contained in:
parent
b177884567
commit
c8ad3f02cc
21 changed files with 325 additions and 196 deletions
|
@ -53,6 +53,7 @@ HEADERS += src/dbusAdaptor.h
|
|||
HEADERS += src/dbus.h
|
||||
|
||||
DISTFILES += qml/harbour-tooter.qml \
|
||||
qml/pages/components/InfoBanner.qml \
|
||||
qml/pages/components/VisualContainer.qml \
|
||||
qml/pages/components/MiniStatus.qml \
|
||||
qml/pages/components/MiniHeader.qml \
|
||||
|
|
|
@ -4,8 +4,10 @@ import harbour.tooter.Uploader 1.0
|
|||
import "../lib/API.js" as Logic
|
||||
import "./components/"
|
||||
|
||||
|
||||
Page {
|
||||
id: conversationPage
|
||||
property string headerTitle: ""
|
||||
property string type
|
||||
property alias title: header.title
|
||||
property alias description: header.description
|
||||
|
@ -40,6 +42,10 @@ Page {
|
|||
}
|
||||
}
|
||||
|
||||
InfoBanner {
|
||||
id: sentBanner
|
||||
}
|
||||
|
||||
ListModel {
|
||||
id: mediaModel
|
||||
onCountChanged: {
|
||||
|
@ -62,7 +68,7 @@ Page {
|
|||
SilicaListView {
|
||||
id: conversationList
|
||||
header: PageHeader {
|
||||
title: qsTr("Conversation")
|
||||
title: headerTitle // pageTitle pushed from MainPage.qml or VisualContainer.qml
|
||||
}
|
||||
clip: true
|
||||
anchors {
|
||||
|
@ -208,7 +214,6 @@ Page {
|
|||
|| description.charAt(
|
||||
0) == '#') ? description + ' ' : ''
|
||||
height: Math.max(270, Math.min(900, implicitHeight))
|
||||
//height: implicitHeight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
placeholderText: qsTr("What's on your mind?")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
|
@ -304,7 +309,6 @@ Page {
|
|||
}
|
||||
}
|
||||
IconButton {
|
||||
|
||||
id: btnContentWarning
|
||||
anchors {
|
||||
top: toot.bottom
|
||||
|
@ -430,7 +434,7 @@ Page {
|
|||
warningContent.text = ""
|
||||
toot.text = ""
|
||||
mediaModel.clear()
|
||||
pageStack.pop()
|
||||
sentBanner.showText(qsTr("Toot sent!"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ Page {
|
|||
visible: !isPortrait ? true : !infoPanel.open
|
||||
icon.source: "image://theme/icon-l-add"
|
||||
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"})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
62
qml/pages/components/InfoBanner.qml
Normal file
62
qml/pages/components/InfoBanner.qml
Normal 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()
|
||||
}
|
||||
}
|
||||
}
|
61
qml/pages/components/InfoBanner.qml.autosave
Normal file
61
qml/pages/components/InfoBanner.qml.autosave
Normal 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()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -277,6 +277,7 @@ BackgroundItem {
|
|||
if (typeof mdl !== "undefined")
|
||||
m.append(mdl.get(index))
|
||||
pageStack.push(Qt.resolvedUrl("../Conversation.qml"), {
|
||||
headerTitle: "Conversation",
|
||||
toot_id: status_id,
|
||||
title: account_display_name,
|
||||
description: '@'+account_acct,
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Konversation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Löschen</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation>Was gibt's Neues?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Συνομιλία</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Διαγραφή</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Conversación</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Borrar</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation>¿En qué estás pensando?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Conversation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Supprimer</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation>Qu'avez-vous en tête?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -28,52 +28,52 @@
|
|||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<location filename="../qml/pages/Conversation.qml" line="65"/>
|
||||
<source>Conversation</source>
|
||||
<translation>Conversazione</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/pages/Conversation.qml" line="182"/>
|
||||
<location filename="../qml/pages/Conversation.qml" line="188"/>
|
||||
<source>Write your warning here</source>
|
||||
<translation>Contenuto avviso</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/pages/Conversation.qml" line="213"/>
|
||||
<location filename="../qml/pages/Conversation.qml" line="218"/>
|
||||
<source>What's on your mind?</source>
|
||||
<translation>A cosa stai pensando?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/pages/Conversation.qml" line="276"/>
|
||||
<location filename="../qml/pages/Conversation.qml" line="281"/>
|
||||
<source>Delete</source>
|
||||
<translation>Elimina</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/pages/Conversation.qml" line="376"/>
|
||||
<location filename="../qml/pages/Conversation.qml" line="380"/>
|
||||
<source>Public</source>
|
||||
<translation>Pubblico</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/pages/Conversation.qml" line="379"/>
|
||||
<location filename="../qml/pages/Conversation.qml" line="383"/>
|
||||
<source>Unlisted</source>
|
||||
<translation>Non elencato</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/pages/Conversation.qml" line="382"/>
|
||||
<location filename="../qml/pages/Conversation.qml" line="386"/>
|
||||
<source>Followers-only</source>
|
||||
<translation>Solo ai seguaci</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/pages/Conversation.qml" line="385"/>
|
||||
<location filename="../qml/pages/Conversation.qml" line="389"/>
|
||||
<source>Direct</source>
|
||||
<translation>Diretto</translation>
|
||||
</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>
|
||||
<translation>Emojis</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../qml/pages/Conversation.qml" line="500"/>
|
||||
<location filename="../qml/pages/Conversation.qml" line="504"/>
|
||||
<source>Tap to insert</source>
|
||||
<translation>Tap per inserire</translation>
|
||||
</message>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Gesprek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Verwijderen</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Gesprek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Verwijderen</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Discutida</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Escafar</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Konwersacja</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Usuń</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Беседа</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Удалить</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Разговор</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Обриши</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Konversation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Radera</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>对话</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>删除</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation>有何想法?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
</context>
|
||||
<context>
|
||||
<name>Conversation</name>
|
||||
<message>
|
||||
<source>Conversation</source>
|
||||
<translation>Conversation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Delete</source>
|
||||
<translation>Delete</translation>
|
||||
|
@ -62,6 +58,10 @@
|
|||
<source>What's on your mind?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Toot sent!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ImageFullScreen</name>
|
||||
|
|
Loading…
Reference in a new issue