Skip to content
Snippets Groups Projects
Commit 73419e41 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

recordbox: fix focus policy on record box

The focus policy was broken and this patch fix also the tests
due to an incorrect conversationModel.

Change-Id: I9e7f76b0dff80548d3b92296f22bdd7b848ee931
parent 2ce88067
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,6 @@ protected:
using Role = ConversationList::Role;
// Convenience pointer to be pulled from lrcinstance
ConversationModel* model_;
ConversationModel* model_ {nullptr};
QString accountId_;
};
......@@ -149,6 +149,7 @@ Popup {
PushButton {
id: cancelBtn
objectName: "cancelBtn"
z: 1
normalColor: "transparent"
......@@ -164,6 +165,7 @@ Popup {
anchors.top: box.top
anchors.margins: 8
focusPolicy: Qt.TabFocus
onClicked: {
closeRecorder();
updateState(RecordBox.States.INIT);
......@@ -253,7 +255,7 @@ Popup {
PushButton {
id: recordButton
objectName: "recordButton"
Layout.alignment: Qt.AlignCenter
preferredSize: btnSize
......@@ -264,6 +266,7 @@ Popup {
source: JamiResources.fiber_manual_record_24dp_svg
imageColor: JamiTheme.recordIconColor
focusPolicy: Qt.TabFocus
onClicked: {
updateState(RecordBox.States.RECORDING);
if (!root.isPhoto)
......@@ -273,7 +276,7 @@ Popup {
PushButton {
id: screenshotBtn
objectName: "screenshotBtn"
Layout.alignment: Qt.AlignCenter
preferredSize: btnSize
......@@ -286,6 +289,7 @@ Popup {
source: JamiResources.fiber_manual_record_24dp_svg
imageColor: UtilsAdapter.luma(JamiTheme.backgroundColor) ? "white" : JamiTheme.redColor
focusPolicy: Qt.TabFocus
onClicked: {
root.photo = videoProvider.captureVideoFrame(VideoDevices.getDefaultDevice());
updateState(RecordBox.States.REC_SUCCESS);
......@@ -294,7 +298,7 @@ Popup {
PushButton {
id: btnStop
objectName: "btnStop"
Layout.alignment: Qt.AlignCenter
preferredSize: btnSize
......@@ -307,6 +311,7 @@ Popup {
border.width: 1
border.color: imageColor
focusPolicy: Qt.TabFocus
onClicked: {
if (!root.isPhoto)
stopRecording();
......@@ -316,7 +321,7 @@ Popup {
PushButton {
id: btnRestart
objectName: "btnRestart"
Layout.alignment: Qt.AlignCenter
preferredSize: btnSize
......@@ -329,6 +334,7 @@ Popup {
border.width: 1
border.color: imageColor
focusPolicy: Qt.TabFocus
onClicked: {
if (!root.isPhoto)
stopRecording();
......@@ -338,7 +344,7 @@ Popup {
PushButton {
id: btnSend
objectName: "btnSend"
Layout.alignment: Qt.AlignCenter
preferredSize: btnSize
......@@ -350,6 +356,7 @@ Popup {
border.width: 1
border.color: imageColor
focusPolicy: Qt.TabFocus
onClicked: {
if (!root.isPhoto) {
stopRecording();
......
/*
* Copyright (C) 2023 Savoir-faire Linux Inc.
*
* This program 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.
*
* This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtTest
import "../../../src/app/"
import "../../../src/app/mainview/components"
ColumnLayout {
id: root
spacing: 0
width: 300
height: 300
RecordBox {
id: uut
TestCase {
name: "Take picture"
when: windowShown
function test_takePicture() {
// Open the recorder and take a picture
uut.openRecorder(true)
compare(uut.state, RecordBox.States.INIT)
var screenshotBtn = findChild(uut, "screenshotBtn")
screenshotBtn.clicked()
compare(uut.state, RecordBox.States.REC_SUCCESS)
uut.closeRecorder()
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment