Start with voice notes

This commit is contained in:
Sebastian Wolf 2020-12-31 19:12:50 +01:00
parent a8ad2a6a22
commit 9662df3c74
No known key found for this signature in database
GPG key ID: CEA9522B5F38A90A
14 changed files with 176 additions and 2 deletions

View file

@ -58,6 +58,7 @@ DISTFILES += qml/harbour-fernschreiber.qml \
qml/components/ReplyMarkupButtons.qml \ qml/components/ReplyMarkupButtons.qml \
qml/components/StickerPicker.qml \ qml/components/StickerPicker.qml \
qml/components/PhotoTextsListItem.qml \ qml/components/PhotoTextsListItem.qml \
qml/components/VoiceNoteOverlay.qml \
qml/components/WebPagePreview.qml \ qml/components/WebPagePreview.qml \
qml/components/chatInformationPage/ChatInformationEditArea.qml \ qml/components/chatInformationPage/ChatInformationEditArea.qml \
qml/components/chatInformationPage/ChatInformationPageContent.qml \ qml/components/chatInformationPage/ChatInformationPageContent.qml \

View file

@ -0,0 +1,72 @@
/*
Copyright (C) 2020 Sebastian J. Wolf and other contributors
This file is part of Fernschreiber.
Fernschreiber is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Fernschreiber is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Fernschreiber. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.6
import Sailfish.Silica 1.0
import "../components"
import "../js/twemoji.js" as Emoji
Item {
id: voiceNoteOverlayItem
anchors.fill: parent
Rectangle {
id: stickerPickerOverlayBackground
anchors.fill: parent
color: Theme.overlayBackgroundColor
opacity: Theme.opacityHigh
}
Flickable {
id: voiceNoteFlickable
anchors.fill: parent
anchors.margins: Theme.paddingMedium
Behavior on opacity { NumberAnimation {} }
contentHeight: voiceNoteColumn.height
clip: true
Column {
id: voiceNoteColumn
spacing: Theme.paddingMedium
width: voiceNoteFlickable.width
InfoLabel {
text: qsTr("Record a Voice Note")
}
Image {
id: recorderImage
source: "image://theme/icon-l-recorder"
anchors {
horizontalCenter: parent.horizontalCenter
}
fillMode: Image.PreserveAspectFit
asynchronous: true
width: Theme.itemSizeLarge
height: Theme.itemSizeLarge
}
}
}
}

View file

@ -621,7 +621,7 @@ Page {
contentWidth: width contentWidth: width
PullDownMenu { PullDownMenu {
visible: chatInformation.id !== chatPage.myUserId && !stickerPickerLoader.active && !messageOverlayLoader.active visible: chatInformation.id !== chatPage.myUserId && !stickerPickerLoader.active && !voiceNoteOverlayLoader.active && !messageOverlayLoader.active
MenuItem { MenuItem {
id: closeSecretChatMenuItem id: closeSecretChatMenuItem
visible: chatPage.isSecretChat && chatPage.secretChatDetails.state["@type"] !== "secretChatStateClosed" visible: chatPage.isSecretChat && chatPage.secretChatDetails.state["@type"] !== "secretChatStateClosed"
@ -874,7 +874,7 @@ Page {
id: chatView id: chatView
visible: !blurred visible: !blurred
property bool blurred: messageOverlayLoader.item property bool blurred: messageOverlayLoader.item || stickerPickerLoader.item || voiceNoteOverlayLoader.item
anchors.fill: parent anchors.fill: parent
opacity: chatPage.loading ? 0 : 1 opacity: chatPage.loading ? 0 : 1
@ -1132,6 +1132,15 @@ Page {
} }
} }
Loader {
id: voiceNoteOverlayLoader
active: false
asynchronous: true
width: parent.width
height: active ? parent.height : 0
source: "../components/VoiceNoteOverlay.qml"
}
} }
Column { Column {
@ -1216,6 +1225,19 @@ Page {
}) })
} }
} }
IconButton {
visible: chatPage.hasSendPrivilege("can_send_media_messages")
icon.source: "image://theme/icon-m-mic"
icon.sourceSize {
width: Theme.iconSizeMedium
height: Theme.iconSizeMedium
}
highlighted: down || voiceNoteOverlayLoader.active
onClicked: {
voiceNoteOverlayLoader.active = !voiceNoteOverlayLoader.active;
stickerPickerLoader.active = false;
}
}
IconButton { IconButton {
visible: chatPage.hasSendPrivilege("can_send_media_messages") visible: chatPage.hasSendPrivilege("can_send_media_messages")
icon.source: "image://theme/icon-m-document" icon.source: "image://theme/icon-m-document"
@ -1243,6 +1265,7 @@ Page {
highlighted: down || stickerPickerLoader.active highlighted: down || stickerPickerLoader.active
onClicked: { onClicked: {
stickerPickerLoader.active = !stickerPickerLoader.active; stickerPickerLoader.active = !stickerPickerLoader.active;
voiceNoteOverlayLoader.active = false;
} }
} }
IconButton { IconButton {
@ -1528,6 +1551,7 @@ Page {
if (attachmentOptionsRow.isNeeded) { if (attachmentOptionsRow.isNeeded) {
attachmentOptionsRow.isNeeded = false; attachmentOptionsRow.isNeeded = false;
stickerPickerLoader.active = false; stickerPickerLoader.active = false;
voiceNoteOverlayLoader.active = false;
} else { } else {
attachmentOptionsRow.isNeeded = true; attachmentOptionsRow.isNeeded = true;
} }

View file

@ -1418,6 +1418,13 @@
<translation>Download fehlgeschlagen.</translation> <translation>Download fehlgeschlagen.</translation>
</message> </message>
</context> </context>
<context>
<name>VoiceNoteOverlay</name>
<message>
<source>Record a Voice Note</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>WebPagePreview</name> <name>WebPagePreview</name>
<message> <message>

View file

@ -1418,6 +1418,13 @@
<translation>Download failed.</translation> <translation>Download failed.</translation>
</message> </message>
</context> </context>
<context>
<name>VoiceNoteOverlay</name>
<message>
<source>Record a Voice Note</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>WebPagePreview</name> <name>WebPagePreview</name>
<message> <message>

View file

@ -1399,6 +1399,13 @@
<translation>Error al bajar</translation> <translation>Error al bajar</translation>
</message> </message>
</context> </context>
<context>
<name>VoiceNoteOverlay</name>
<message>
<source>Record a Voice Note</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>WebPagePreview</name> <name>WebPagePreview</name>
<message> <message>

View file

@ -1419,6 +1419,13 @@
<translation>Lataus epäonnistui.</translation> <translation>Lataus epäonnistui.</translation>
</message> </message>
</context> </context>
<context>
<name>VoiceNoteOverlay</name>
<message>
<source>Record a Voice Note</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>WebPagePreview</name> <name>WebPagePreview</name>
<message> <message>

View file

@ -1399,6 +1399,13 @@
<translation>A letöltés nem sikerült.</translation> <translation>A letöltés nem sikerült.</translation>
</message> </message>
</context> </context>
<context>
<name>VoiceNoteOverlay</name>
<message>
<source>Record a Voice Note</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>WebPagePreview</name> <name>WebPagePreview</name>
<message> <message>

View file

@ -1418,6 +1418,13 @@
<translation>Download non riuscito.</translation> <translation>Download non riuscito.</translation>
</message> </message>
</context> </context>
<context>
<name>VoiceNoteOverlay</name>
<message>
<source>Record a Voice Note</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>WebPagePreview</name> <name>WebPagePreview</name>
<message> <message>

View file

@ -1437,6 +1437,13 @@
<translation>Nieudane pobieranie</translation> <translation>Nieudane pobieranie</translation>
</message> </message>
</context> </context>
<context>
<name>VoiceNoteOverlay</name>
<message>
<source>Record a Voice Note</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>WebPagePreview</name> <name>WebPagePreview</name>
<message> <message>

View file

@ -1437,6 +1437,13 @@
<translation>Ошибка скачивания.</translation> <translation>Ошибка скачивания.</translation>
</message> </message>
</context> </context>
<context>
<name>VoiceNoteOverlay</name>
<message>
<source>Record a Voice Note</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>WebPagePreview</name> <name>WebPagePreview</name>
<message> <message>

View file

@ -1418,6 +1418,13 @@
<translation>Nerladdning misslyckades.</translation> <translation>Nerladdning misslyckades.</translation>
</message> </message>
</context> </context>
<context>
<name>VoiceNoteOverlay</name>
<message>
<source>Record a Voice Note</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>WebPagePreview</name> <name>WebPagePreview</name>
<message> <message>

View file

@ -1399,6 +1399,13 @@
<translation></translation> <translation></translation>
</message> </message>
</context> </context>
<context>
<name>VoiceNoteOverlay</name>
<message>
<source>Record a Voice Note</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>WebPagePreview</name> <name>WebPagePreview</name>
<message> <message>

View file

@ -1418,6 +1418,13 @@
<translation>Download failed.</translation> <translation>Download failed.</translation>
</message> </message>
</context> </context>
<context>
<name>VoiceNoteOverlay</name>
<message>
<source>Record a Voice Note</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>WebPagePreview</name> <name>WebPagePreview</name>
<message> <message>