diff --git a/src/app/constant/JamiStrings.qml b/src/app/constant/JamiStrings.qml index 28fda05b43cabed80ff116c04663615aeb5231c8..6dbc5a109131585f7fb1ff228ec1359e47e1a5fe 100644 --- a/src/app/constant/JamiStrings.qml +++ b/src/app/constant/JamiStrings.qml @@ -742,6 +742,7 @@ Item { property string sendFile: qsTr("Send file") property string leaveAudioMessage: qsTr("Audio message") property string leaveVideoMessage: qsTr("Video message") + property string discardRestart: qsTr("Discard and restart") property string showMore: qsTr("Show more") property string showLess: qsTr("Show less") diff --git a/src/app/mainview/components/ChatViewFooter.qml b/src/app/mainview/components/ChatViewFooter.qml index 516bb811d4a044de1b59ed7749dfc3eebe94b0f4..1017baed29f93e6bba17ebd81786ca6bf31d3b40 100644 --- a/src/app/mainview/components/ChatViewFooter.qml +++ b/src/app/mainview/components/ChatViewFooter.qml @@ -94,6 +94,9 @@ Rectangle { id: recordBox visible: false + parent: root + x: messageBar.x + 140 + y: isVideo ? -165 : -65 } ColumnLayout { @@ -171,7 +174,7 @@ Rectangle { sendButtonVisibility: text || messageBar.fileContainer.filesToSendCount onEmojiButtonClicked: { - if (emojiPicker != null && emojiPicker.opened) { + if (emojiPicker !== null && emojiPicker.opened) { emojiPicker.closeEmojiPicker(); } else { openEmojiPicker(); @@ -193,14 +196,10 @@ Rectangle { } onVideoRecordMessageButtonClicked: { - recordBox.y = -recordBox.height - 200; - recordBox.x = recordBox.width + 200 recordBox.openRecorder(true); } onAudioRecordMessageButtonClicked: { - recordBox.y = -recordBox.height - 150; - recordBox.x = recordBox.width + 200; recordBox.openRecorder(false); } diff --git a/src/app/mainview/components/MessageBar.qml b/src/app/mainview/components/MessageBar.qml index daa6f9be73935b60de2c0a42bc9c333ff6a5ef61..3f2415b7d845383427d2d6e6b0e59dbfc263f394 100644 --- a/src/app/mainview/components/MessageBar.qml +++ b/src/app/mainview/components/MessageBar.qml @@ -57,7 +57,6 @@ RowLayout { height: rectHeight + (dataTransferSendContainer.visible ? dataTransferSendContainer.height + (!showTypo ? 40 : - marginSize) : 0 ) Rectangle { - Layout.preferredHeight: parent.height Layout.preferredWidth: childrenRect.width visible: !CurrentConversation.isSip diff --git a/src/app/mainview/components/RecordBox.qml b/src/app/mainview/components/RecordBox.qml index c3895a13893fc215622d3271289caf00d7ede864..24264bad5921ec11a647272f2719846c3501698a 100644 --- a/src/app/mainview/components/RecordBox.qml +++ b/src/app/mainview/components/RecordBox.qml @@ -53,7 +53,7 @@ Popup { signal validatePhoto(string photo) modal: true - closePolicy: Popup.CloseOnPressOutsideParent + closePolicy: Popup.NoAutoClose function openRecorder(vid) { isVideo = vid; @@ -233,7 +233,7 @@ Popup { hoveredColor: JamiTheme.recordBoxHoverColor source: JamiResources.round_close_24dp_svg - toolTipText: JamiStrings.back + toolTipText: JamiStrings.close focusPolicy: Qt.TabFocus onClicked: { @@ -259,16 +259,19 @@ Popup { Layout.alignment: Qt.AlignCenter preferredSize: btnSize - source: JamiResources.record_black_24dp_svg + imageColor: JamiTheme.whiteColor - imageContainerHeight: 20 - imageContainerWidth: 20 + + source: JamiResources.record_round_black_24dp_svg + + imageContainerHeight: 25 + imageContainerWidth: 25 focusPolicy: Qt.TabFocus background: RoundedBorderRectangle { - opacity: recordButton.hovered ? 1 : 0.7 - fillColor: recordButton.hovered ? JamiTheme.recordBoxHoverColor : JamiTheme.recordBoxButtonColor + opacity: recordButton.hovered ? 1 : 0.5 + fillColor: JamiTheme.screenshotButtonColor //recordButton.hovered ? JamiTheme.recordBoxHoverColor : JamiTheme.recordBoxButtonColor radius: { "tl": 5, "tr": root.isAudio ? 0 : 5, @@ -277,6 +280,8 @@ Popup { } } + toolTipText: JamiStrings.startRec + onClicked: { updateState(RecordBox.States.RECORDING); if (!root.isPhoto) @@ -289,18 +294,25 @@ Popup { Layout.alignment: Qt.AlignCenter preferredSize: btnSize + source: JamiResources.record_black_24dp_svg - normalColor: JamiTheme.screenshotButtonColor - hoveredColor: JamiTheme.screenshotButtonColor - background.opacity: hovered ? 1 : 0.5 - - source: JamiResources.record_round_black_24dp_svg + imageContainerHeight: 20 + imageContainerWidth: 20 imageColor: JamiTheme.whiteColor - imageContainerHeight: 25 - imageContainerWidth: 25 focusPolicy: Qt.TabFocus + background: RoundedBorderRectangle { + opacity: screenshotBtn.hovered ? 1 : 0.7 + fillColor: screenshotBtn.hovered ? JamiTheme.recordBoxHoverColor : JamiTheme.recordBoxButtonColor + radius: { + "tl": 5, + "tr": root.isAudio ? 0 : 5, + "br": root.isAudio ? 0 : 5, + "bl": 5 + } + } + onClicked: { root.photo = videoProvider.captureVideoFrame(VideoDevices.getDefaultDevice()); updateState(RecordBox.States.REC_SUCCESS); @@ -322,6 +334,8 @@ Popup { focusPolicy: Qt.TabFocus + toolTipText: JamiStrings.stopRec + background: RoundedBorderRectangle { opacity: btnStop.hovered ? 1 : 0.7 fillColor: btnStop.hovered ? JamiTheme.recordBoxHoverColor : JamiTheme.recordBoxButtonColor @@ -355,6 +369,8 @@ Popup { focusPolicy: Qt.TabFocus + toolTipText: JamiStrings.discardRestart + background: RoundedBorderRectangle { opacity: btnRestart.hovered ? 1 : 0.7 fillColor: btnRestart.hovered ? JamiTheme.recordBoxHoverColor : JamiTheme.recordBoxButtonColor @@ -374,6 +390,33 @@ Popup { } } + RoundedBorderRectangle { + opacity: 0.7 + fillColor: JamiTheme.recordBoxButtonColor + visible: (!recordButton.visible && !root.isPhoto) || root.isAudio + + Layout.preferredHeight: btnSend.height + Layout.preferredWidth: time.width + 20 + radius: { + "tl": 0, + "tr": timer.running ? 5 : 0, + "br": timer.running ? 5 : 0, + "bl": 0 + } + + Text { + id: time + + anchors.centerIn: parent + opacity: 1 + + text: "00:00" + color: JamiTheme.whiteColor + font.pointSize: (isVideo ? 12 : 20) + } + } + + JamiPushButton { id: btnSend @@ -385,17 +428,19 @@ Popup { imageContainerHeight: 25 imageContainerWidth: 25 - source: JamiResources.check_circle_24dp_svg + source: root.isPhoto ? JamiResources.check_circle_24dp_svg : JamiResources.send_black_24dp_svg focusPolicy: Qt.TabFocus + toolTipText: JamiStrings.send + background: RoundedBorderRectangle { opacity: btnSend.hovered ? 1 : 0.7 - fillColor: btnSend.hovered ? JamiTheme.recordBoxHoverColor : JamiTheme.recordBoxButtonColor + fillColor: JamiTheme.chatViewFooterSendButtonColor //btnSend.hovered ? JamiTheme.recordBoxHoverColor : JamiTheme.recordBoxButtonColor radius: { "tl": 0, - "tr": root.isPhoto ? 5 : 0, - "br": root.isPhoto ? 5 : 0, + "tr": 5, + "br": 5, "bl": 0 } } @@ -411,6 +456,7 @@ Popup { updateState(RecordBox.States.INIT); } } + Timer { id: timer @@ -420,32 +466,7 @@ Popup { onTriggered: updateTimer() } - RoundedBorderRectangle { - opacity: 0.7 - fillColor: JamiTheme.recordBoxButtonColor - visible: (!recordButton.visible && !root.isPhoto) || root.isAudio - - Layout.preferredHeight: btnSend.height - Layout.preferredWidth: time.width + 20 - radius: { - "tl": 0, - "tr": 5, - "br": 5, - "bl": 0 - } - - Text { - id: time - - anchors.centerIn: parent - opacity: 1 - - text: "00:00" - color: JamiTheme.whiteColor - font.pointSize: (isVideo ? 12 : 20) - } } - } } } }