From c58868819743d468c4e07d679646ee11c009608b Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Wed, 7 Feb 2024 16:31:12 +0100 Subject: [PATCH] FIXES: correctly initialize remote params + create video call paused call ui calls window simplify carousel effect image : don't show effect if no colorization use our custom button instead of qtquick one image buttons size security page ui update right panel on call history deleted --- Linphone/core/call/CallCore.cpp | 20 +- Linphone/data/image/down_arrow.svg | 1 - Linphone/data/image/welcome_linphone_logo.svg | 1 - Linphone/data/image/welcome_lock.svg | 1 - Linphone/data/image/welcome_opensource.svg | 1 - Linphone/model/tool/ToolModel.cpp | 4 +- Linphone/model/tool/ToolModel.hpp | 1 + Linphone/tool/Utils.cpp | 5 +- Linphone/tool/Utils.hpp | 1 + Linphone/view/App/CallsWindow.qml | 176 +++++++++++------- Linphone/view/App/Layout/ContactLayout.qml | 39 ++-- Linphone/view/App/Layout/LoginLayout.qml | 3 +- Linphone/view/App/Layout/MainLayout.qml | 21 +-- Linphone/view/Item/Button.qml | 65 +++++-- Linphone/view/Item/Call/CallContactsLists.qml | 63 +++---- .../view/Item/Call/OngoingCallRightPanel.qml | 12 +- Linphone/view/Item/Carousel.qml | 66 ++++--- Linphone/view/Item/ComboBox.qml | 16 +- Linphone/view/Item/Contact/ContactEdition.qml | 23 ++- Linphone/view/Item/Contact/ContactsList.qml | 2 +- Linphone/view/Item/Contact/Sticker.qml | 11 +- Linphone/view/Item/Dialog.qml | 8 + Linphone/view/Item/EffectImage.qml | 1 + Linphone/view/Item/Form/LoginForm.qml | 4 + Linphone/view/Item/NumericPad.qml | 36 ++-- Linphone/view/Item/PopupButton.qml | 10 +- Linphone/view/Item/RadioButton.qml | 21 +-- Linphone/view/Item/SearchBar.qml | 25 ++- Linphone/view/Item/Test/ItemsTest.qml | 4 +- Linphone/view/Item/TextInput.qml | 13 +- Linphone/view/Page/Login/LoginPage.qml | 22 ++- .../view/Page/Login/RegisterCheckingPage.qml | 12 +- Linphone/view/Page/Login/RegisterPage.qml | 16 +- Linphone/view/Page/Login/SIPLoginPage.qml | 11 +- Linphone/view/Page/Login/SecurityModePage.qml | 7 +- Linphone/view/Page/Login/WelcomePage.qml | 9 +- Linphone/view/Page/Main/AbstractMainPage.qml | 2 +- Linphone/view/Page/Main/CallPage.qml | 81 ++------ Linphone/view/Page/Main/ContactPage.qml | 48 ++--- 39 files changed, 435 insertions(+), 427 deletions(-) delete mode 100644 Linphone/data/image/down_arrow.svg delete mode 100644 Linphone/data/image/welcome_linphone_logo.svg delete mode 100644 Linphone/data/image/welcome_lock.svg delete mode 100644 Linphone/data/image/welcome_opensource.svg diff --git a/Linphone/core/call/CallCore.cpp b/Linphone/core/call/CallCore.cpp index 2d4f325cb..89602052e 100644 --- a/Linphone/core/call/CallCore.cpp +++ b/Linphone/core/call/CallCore.cpp @@ -50,13 +50,19 @@ CallCore::CallCore(const std::shared_ptr &call) : QObject(nullpt mPeerAddress = Utils::coreStringToAppString(mCallModel->getRemoteAddress()->asStringUriOnly()); mStatus = LinphoneEnums::fromLinphone(call->getCallLog()->getStatus()); mTransferState = LinphoneEnums::fromLinphone(call->getTransferState()); + auto token = Utils::coreStringToAppString(mCallModel->getAuthenticationToken()); + auto localToken = mDir == LinphoneEnums::CallDir::Incoming ? token.left(2).toUpper() : token.right(2).toUpper(); + auto remoteToken = mDir == LinphoneEnums::CallDir::Outgoing ? token.left(2).toUpper() : token.right(2).toUpper(); mEncryption = LinphoneEnums::fromLinphone(call->getParams()->getMediaEncryption()); auto tokenVerified = mCallModel->getAuthenticationTokenVerified(); + mLocalSas = localToken; + mRemoteSas = remoteToken; mIsSecured = (mEncryption == LinphoneEnums::MediaEncryption::Zrtp && tokenVerified) || mEncryption == LinphoneEnums::MediaEncryption::Srtp || mEncryption == LinphoneEnums::MediaEncryption::Dtls; mPaused = mState == LinphoneEnums::CallState::Pausing || mState == LinphoneEnums::CallState::Paused || mState == LinphoneEnums::CallState::PausedByRemote; + mRemoteVideoEnabled = call->getRemoteParams() && call->getRemoteParams()->videoEnabled(); mRecording = call->getParams() && call->getParams()->isRecording(); mRemoteRecording = call->getRemoteParams() && call->getRemoteParams()->isRecording(); mRecordable = mState == LinphoneEnums::CallState::StreamsRunning; @@ -159,12 +165,14 @@ void CallCore::setSelf(QSharedPointer me) { auto tokenVerified = mCallModel->getAuthenticationTokenVerified(); auto token = Utils::coreStringToAppString(mCallModel->getAuthenticationToken()); mCallModelConnection->invokeToCore([this, call, encryption, tokenVerified, token]() { - auto localToken = - mDir == LinphoneEnums::CallDir::Incoming ? token.left(2).toUpper() : token.right(2).toUpper(); - auto remoteToken = - mDir == LinphoneEnums::CallDir::Outgoing ? token.left(2).toUpper() : token.right(2).toUpper(); - setLocalSas(localToken); - setRemoteSas(remoteToken); + if (token.size() == 4) { + auto localToken = + mDir == LinphoneEnums::CallDir::Incoming ? token.left(2).toUpper() : token.right(2).toUpper(); + auto remoteToken = + mDir == LinphoneEnums::CallDir::Outgoing ? token.left(2).toUpper() : token.right(2).toUpper(); + setLocalSas(localToken); + setRemoteSas(remoteToken); + } setEncryption(encryption); setIsSecured((encryption == LinphoneEnums::MediaEncryption::Zrtp && tokenVerified) || encryption == LinphoneEnums::MediaEncryption::Srtp || diff --git a/Linphone/data/image/down_arrow.svg b/Linphone/data/image/down_arrow.svg deleted file mode 100644 index 8b1378917..000000000 --- a/Linphone/data/image/down_arrow.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Linphone/data/image/welcome_linphone_logo.svg b/Linphone/data/image/welcome_linphone_logo.svg deleted file mode 100644 index 8b1378917..000000000 --- a/Linphone/data/image/welcome_linphone_logo.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Linphone/data/image/welcome_lock.svg b/Linphone/data/image/welcome_lock.svg deleted file mode 100644 index 8b1378917..000000000 --- a/Linphone/data/image/welcome_lock.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Linphone/data/image/welcome_opensource.svg b/Linphone/data/image/welcome_opensource.svg deleted file mode 100644 index 8b1378917..000000000 --- a/Linphone/data/image/welcome_opensource.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Linphone/model/tool/ToolModel.cpp b/Linphone/model/tool/ToolModel.cpp index d5e06b80f..f32efb877 100644 --- a/Linphone/model/tool/ToolModel.cpp +++ b/Linphone/model/tool/ToolModel.cpp @@ -82,6 +82,7 @@ QString ToolModel::getDisplayName(QString address) { } QSharedPointer ToolModel::createCall(const QString &sipAddress, + bool withVideo, const QString &prepareTransfertAddress, const QHash &headers, linphone::MediaEncryption mediaEncryption) { @@ -96,7 +97,7 @@ QSharedPointer ToolModel::createCall(const QString &sipAddress, } std::shared_ptr params = core->createCallParams(nullptr); - params->enableVideo(false); + params->enableVideo(withVideo); params->setMediaEncryption(mediaEncryption); if (Utils::coreStringToAppString(params->getRecordFile()).isEmpty()) { @@ -116,6 +117,7 @@ QSharedPointer ToolModel::createCall(const QString &sipAddress, if (core->getDefaultAccount()) params->setAccount(core->getDefaultAccount()); auto call = core->inviteAddressWithParams(address, params); + call->enableCamera(withVideo); return call ? CallCore::create(call) : nullptr; /* TODO transfer diff --git a/Linphone/model/tool/ToolModel.hpp b/Linphone/model/tool/ToolModel.hpp index c1d61c138..217cafc81 100644 --- a/Linphone/model/tool/ToolModel.hpp +++ b/Linphone/model/tool/ToolModel.hpp @@ -41,6 +41,7 @@ public: static QString getDisplayName(QString address); static QSharedPointer createCall(const QString &sipAddress, + bool withVideo = false, const QString &prepareTransfertAddress = "", const QHash &headers = {}, linphone::MediaEncryption = linphone::MediaEncryption::None); diff --git a/Linphone/tool/Utils.cpp b/Linphone/tool/Utils.cpp index 44983b7bd..92a9ee371 100644 --- a/Linphone/tool/Utils.cpp +++ b/Linphone/tool/Utils.cpp @@ -93,12 +93,13 @@ QString Utils::getInitials(const QString &username) { } VariantObject *Utils::createCall(const QString &sipAddress, + bool withVideo, const QString &prepareTransfertAddress, const QHash &headers) { VariantObject *data = new VariantObject(QVariant()); // Scope : GUI if (!data) return nullptr; - data->makeRequest([sipAddress, prepareTransfertAddress, headers]() { - auto call = ToolModel::createCall(sipAddress, prepareTransfertAddress, headers); + data->makeRequest([sipAddress, withVideo, prepareTransfertAddress, headers]() { + auto call = ToolModel::createCall(sipAddress, withVideo, prepareTransfertAddress, headers); if (call) { auto callGui = QVariant::fromValue(new CallGui(call)); App::postCoreSync([callGui]() { diff --git a/Linphone/tool/Utils.hpp b/Linphone/tool/Utils.hpp index 09ef8686d..354d0503a 100644 --- a/Linphone/tool/Utils.hpp +++ b/Linphone/tool/Utils.hpp @@ -57,6 +57,7 @@ public: Q_INVOKABLE static QString getInitials(const QString &username); // Support UTF32 Q_INVOKABLE static VariantObject *createCall(const QString &sipAddress, + bool withVideo = false, const QString &prepareTransfertAddress = "", const QHash &headers = {}); Q_INVOKABLE static void setFirstLaunch(bool first); diff --git a/Linphone/view/App/CallsWindow.qml b/Linphone/view/App/CallsWindow.qml index 90ea84398..2be73d536 100644 --- a/Linphone/view/App/CallsWindow.qml +++ b/Linphone/view/App/CallsWindow.qml @@ -14,6 +14,7 @@ Window { // modality: Qt.WindowModal property CallGui call + property bool callTerminatedByUser: false Connections { target: call.core @@ -32,7 +33,7 @@ Window { onCallChanged: { waitingTime.seconds = 0 waitingTimer.restart() - console.log("call changed", call) + console.log("call changed", call, waitingTime.seconds) } property var callState: call.core.state @@ -128,13 +129,10 @@ Window { : DefaultStyle.grey_600 radius: 71 * DefaultStyle.dp } - contentItem: EffectImage { - source: disabledIcon && bottomButton.checked ? disabledIcon : enabledIcon - imageWidth: 32 * DefaultStyle.dp - imageHeight: 32 * DefaultStyle.dp - anchors.centerIn: parent - colorizationColor: disabledIcon && bottomButton.checked ? DefaultStyle.main2_0 : DefaultStyle.grey_0 - } + icon.source: disabledIcon && bottomButton.checked ? disabledIcon : enabledIcon + height: 32 * DefaultStyle.dp + width: 32 * DefaultStyle.dp + contentImageColor: DefaultStyle.grey_0 } ZrtpTokenAuthenticationDialog { id: zrtpValidation @@ -214,7 +212,8 @@ Window { source:(mainWindow.call.core.state === LinphoneEnums.CallState.End || mainWindow.call.core.state === LinphoneEnums.CallState.Released) ? AppIcons.endCall - : mainWindow.call.core.paused + : (mainWindow.call.core.state === LinphoneEnums.CallState.Paused + || mainWindow.call.core.state === LinphoneEnums.CallState.PausedByRemote) ? AppIcons.pause : mainWindow.call.core.dir === LinphoneEnums.CallDir.Outgoing ? AppIcons.outgoingCall @@ -227,7 +226,8 @@ Window { id: callStatusText text: (mainWindow.call.core.state === LinphoneEnums.CallState.End || mainWindow.call.core.state === LinphoneEnums.CallState.Released) ? qsTr("End of the call") - : (mainWindow.call.core.paused) + : (mainWindow.call.core.state === LinphoneEnums.CallState.Paused + || mainWindow.call.core.state === LinphoneEnums.CallState.PausedByRemote) ? qsTr("Appel mis en pause") : EnumsToStringCpp.dirToString(mainWindow.call.core.dir) + qsTr(" call") color: DefaultStyle.grey_0 @@ -277,15 +277,11 @@ Window { bottomPadding: 8 * DefaultStyle.dp leftPadding: 10 * DefaultStyle.dp rightPadding: 10 * DefaultStyle.dp - width: 269 * DefaultStyle.dp - visible: mainWindow.call.core.peerSecured - onVisibleChanged: console.log("peer secured", mainWindow.call.core.peerSecured) + visible: mainWindow.call.core.isSecured background: Rectangle { anchors.fill: parent - color: DefaultStyle.main2_0 border.color: DefaultStyle.info_500_main - border.width: 1 * DefaultStyle.dp - radius: 50 * DefaultStyle.dp + radius: 15 * DefaultStyle.dp } contentItem: RowLayout { Image { @@ -301,6 +297,7 @@ Window { color: DefaultStyle.info_500_main font { pixelSize: 14 * DefaultStyle.dp + weight: 400 * DefaultStyle.dp } } } @@ -322,6 +319,28 @@ Window { contentItem: Item { id: centerItem anchors.fill: parent + Text { + id: callTerminatedText + Connections { + target: mainWindow + onCallStateChanged: { + if (mainWindow.call.core.state === LinphoneEnums.CallState.End) { + callTerminatedText.visible = true + } + } + } + visible: false + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: 25 * DefaultStyle.dp + text: mainWindow.callTerminatedByUser ? qsTr("Vous avez terminé l'appel") : qsTr("Votre correspondant a terminé l'appel") + color: DefaultStyle.grey_0 + z: 1 + font { + pixelSize: 22 * DefaultStyle.dp + weight: 300 * DefaultStyle.dp + } + } StackLayout { id: centerLayout currentIndex: 0 @@ -335,10 +354,10 @@ Window { } } Sticker { - visible: false call: mainWindow.call Layout.fillWidth: true Layout.fillHeight: true + // visible: mainWindow.call.core.state != LinphoneEnums.CallState.End Timer { id: waitingTimer @@ -391,6 +410,8 @@ Window { } Sticker { id: preview + visible: mainWindow.call.core.state != LinphoneEnums.CallState.End + && mainWindow.call.core.state != LinphoneEnums.CallState.Released height: 180 * DefaultStyle.dp width: 300 * DefaultStyle.dp anchors.right: centerItem.right @@ -492,7 +513,7 @@ Window { visible: parent.visible closeButtonVisible: false onLaunchCall: { - callObj = UtilsCpp.createCall(dialerTextInput.text + "@sip.linphone.org") + callObj = UtilsCpp.createCall(dialerTextInput.text) } } } @@ -558,8 +579,8 @@ Window { } Text { id: callStateText - text: modelData.core.state === LinphoneEnums.CallState.Paused - || modelData.core.state === LinphoneEnums.CallState.PausedByRemote + text: mainWindow.call.core.state === LinphoneEnums.CallState.Paused + || mainWindow.call.core.state === LinphoneEnums.CallState.PausedByRemote ? qsTr("Appel en pause") : qsTr("Appel en cours") } PopupButton { @@ -570,12 +591,14 @@ Window { popup.contentItem: ColumnLayout { spacing: 0 - Control.Button { + Button { + leftPadding: 0 + topPadding: 5 * DefaultStyle.dp + bottomPadding: 5 * DefaultStyle.dp background: Item {} contentItem: RowLayout { Image { - source: modelData.core.state === LinphoneEnums.CallState.Paused - || modelData.core.state === LinphoneEnums.CallState.PausedByRemote + source: modelData.core.paused ? AppIcons.phone : AppIcons.pause sourceSize.width: 32 * DefaultStyle.dp sourceSize.height: 32 * DefaultStyle.dp @@ -584,8 +607,7 @@ Window { fillMode: Image.PreserveAspectFit } Text { - text: modelData.core.state === LinphoneEnums.CallState.Paused - || modelData.core.state === LinphoneEnums.CallState.PausedByRemote + text: modelData.core.paused ? qsTr("Reprendre l'appel") : qsTr("Mettre en pause") color: DefaultStyle.main2_500main Layout.preferredWidth: metrics.width @@ -600,7 +622,10 @@ Window { } onClicked: modelData.core.lSetPaused(!modelData.core.paused) } - Control.Button { + Button { + leftPadding: 0 + topPadding: 5 * DefaultStyle.dp + bottomPadding: 5 * DefaultStyle.dp background: Item {} contentItem: RowLayout { EffectImage { @@ -617,7 +642,10 @@ Window { Layout.fillWidth: true } } - onClicked: mainWindow.endCall(modelData) + onClicked: { + mainWindow.endCall(modelData) + mainWindow.callTerminatedByUser = true + } } } } @@ -647,9 +675,14 @@ Window { if (mainWindow.call.core.state === LinphoneEnums.CallState.Connected || mainWindow.call.core.state === LinphoneEnums.CallState.StreamsRunning) { bottomButtonsLayout.layoutDirection = Qt.RightToLeft connectedCallButtons.visible = true - } else if (mainWindow.callState === LinphoneEnums.CallState.OutgoingInit || mainWindow.callState === LinphoneEnums.CallState.End) { + videoCameraButton.enabled = true + moreOptionsButton.visible = true + } + else if (mainWindow.callState === LinphoneEnums.CallState.OutgoingInit) { connectedCallButtons.visible = false bottomButtonsLayout.layoutDirection = Qt.LeftToRight + videoCameraButton.enabled = false + moreOptionsButton.visible = false } } @@ -680,7 +713,10 @@ Window { color: DefaultStyle.danger_500main radius: 71 * DefaultStyle.dp } - onClicked: mainWindow.endCall(mainWindow.call) + onClicked: { + mainWindow.endCall(mainWindow.call) + mainWindow.callTerminatedByUser = true + } } RowLayout { id: connectedCallButtons @@ -688,6 +724,7 @@ Window { Layout.row: 0 Layout.column: 1 BottomButton { + id: pauseButton Layout.preferredWidth: 55 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp background: Rectangle { @@ -708,18 +745,6 @@ Window { mainWindow.call.core.lSetPaused(!callsModel.currentCall.core.paused) } } - BottomButton { - id: newCallButton - checkable: false - enabledIcon: AppIcons.newCall - Layout.preferredWidth: 55 * DefaultStyle.dp - Layout.preferredHeight: 55 * DefaultStyle.dp - onClicked: { - var mainWin = UtilsCpp.getMainWindow() - UtilsCpp.smartShowWindow(mainWin) - mainWin.goToNewCall() - } - } BottomButton { id: transferCallButton enabledIcon: AppIcons.transferCall @@ -738,6 +763,18 @@ Window { onVisibleChanged: if(!rightPanel.visible) transferCallButton.checked = false } } + BottomButton { + id: newCallButton + checkable: false + enabledIcon: AppIcons.newCall + Layout.preferredWidth: 55 * DefaultStyle.dp + Layout.preferredHeight: 55 * DefaultStyle.dp + onClicked: { + var mainWin = UtilsCpp.getMainWindow() + UtilsCpp.smartShowWindow(mainWin) + mainWin.goToNewCall() + } + } } RowLayout { Layout.row: 0 @@ -748,6 +785,7 @@ Window { || mainWindow.call.core.state == LinphoneEnums.CallState.IncomingReceived ? bottomButtonsLayout.columns - 1 : 0 BottomButton { + id: videoCameraButton enabledIcon: AppIcons.videoCamera disabledIcon: AppIcons.videoCameraSlash checked: !mainWindow.call.core.cameraEnabled @@ -787,7 +825,7 @@ Window { id: optionsList spacing: 10 * DefaultStyle.dp - Control.Button { + Button { id: callListButton Layout.fillWidth: true background: Item { @@ -810,7 +848,7 @@ Window { moreOptionsMenu.close() } } - Control.Button { + Button { id: dialerButton Layout.fillWidth: true background: Item { @@ -833,32 +871,7 @@ Window { moreOptionsMenu.close() } } - Control.Button { - id: speakerButton - Layout.fillWidth: true - checkable: true - background: Item { - visible: false - } - contentItem: RowLayout { - EffectImage { - Layout.preferredWidth: 24 * DefaultStyle.dp - Layout.preferredHeight: 24 * DefaultStyle.dp - fillMode: Image.PreserveAspectFit - source: mainWindow.call.core.speakerMuted ? AppIcons.speakerSlash : AppIcons.speaker - colorizationColor: mainWindow.call.core.speakerMuted ? DefaultStyle.danger_500main : undefined - } - Text { - text: mainWindow.call.core.speakerMuted ? qsTr("Activer le son") : qsTr("Désactiver le son") - color: mainWindow.call.core.speakerMuted ? DefaultStyle.danger_500main : DefaultStyle.main2_600 - } - - } - onClicked: { - mainWindow.call.core.lSetSpeakerMuted(!mainWindow.call.core.speakerMuted) - } - } - Control.Button { + Button { id: recordButton Layout.fillWidth: true enabled: mainWindow.call.core.recordable @@ -884,6 +897,31 @@ Window { mainWindow.call.core.recording ? mainWindow.call.core.lStopRecording() : mainWindow.call.core.lStartRecording() } } + Button { + id: speakerButton + Layout.fillWidth: true + checkable: true + background: Item { + visible: false + } + contentItem: RowLayout { + EffectImage { + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp + fillMode: Image.PreserveAspectFit + source: mainWindow.call.core.speakerMuted ? AppIcons.speakerSlash : AppIcons.speaker + colorizationColor: mainWindow.call.core.speakerMuted ? DefaultStyle.danger_500main : undefined + } + Text { + text: mainWindow.call.core.speakerMuted ? qsTr("Activer le son") : qsTr("Désactiver le son") + color: mainWindow.call.core.speakerMuted ? DefaultStyle.danger_500main : DefaultStyle.main2_600 + } + + } + onClicked: { + mainWindow.call.core.lSetSpeakerMuted(!mainWindow.call.core.speakerMuted) + } + } } } } diff --git a/Linphone/view/App/Layout/ContactLayout.qml b/Linphone/view/App/Layout/ContactLayout.qml index 76d38c9ea..a1cd99fc9 100644 --- a/Linphone/view/App/Layout/ContactLayout.qml +++ b/Linphone/view/App/Layout/ContactLayout.qml @@ -20,7 +20,7 @@ ColumnLayout { component LabelButton: ColumnLayout { id: labelButton - property alias image: buttonImg + // property alias image: buttonImg property alias button: button property string label spacing: 8 * DefaultStyle.dp @@ -38,15 +38,6 @@ ColumnLayout { radius: 40 * DefaultStyle.dp color: DefaultStyle.main2_200 } - contentItem: Image { - id: buttonImg - source: labelButton.source - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp - fillMode: Image.PreserveAspectFit - sourceSize.width: 24 * DefaultStyle.dp - sourceSize.height: 24 * DefaultStyle.dp - } } Text { Layout.alignment: Qt.AlignHCenter @@ -108,16 +99,16 @@ ColumnLayout { } } Item { - // spacing: 10 * DefaultStyle.dp Layout.alignment: Qt.AlignHCenter Layout.preferredWidth: mainItem.implicitWidth Layout.preferredHeight: childrenRect.height - // Layout.fillHeight: true LabelButton { anchors.left: parent.left - // width: 24 * DefaultStyle.dp//image.width - // height: image.height - image.source: AppIcons.phone + width: 56 * DefaultStyle.dp + height: 56 * DefaultStyle.dp + button.icon.width: 24 * DefaultStyle.dp + button.icon.height: 24 * DefaultStyle.dp + button.icon.source: AppIcons.phone label: qsTr("Appel") property var callObj button.onClicked: { @@ -127,18 +118,22 @@ ColumnLayout { } LabelButton { anchors.horizontalCenter: parent.horizontalCenter - // Layout.preferredWidth: image.width - // Layout.preferredHeight: image.height - image.source: AppIcons.chatTeardropText + width: 56 * DefaultStyle.dp + height: 56 * DefaultStyle.dp + button.icon.width: 24 * DefaultStyle.dp + button.icon.height: 24 * DefaultStyle.dp + button.icon.source: AppIcons.chatTeardropText label: qsTr("Message") button.onClicked: console.debug("[CallPage.qml] TODO : open conversation") } LabelButton { id: videoCall anchors.right: parent.right - // Layout.preferredWidth: image.width - // Layout.preferredHeight: image.height - image.source: AppIcons.videoCamera + width: 56 * DefaultStyle.dp + height: 56 * DefaultStyle.dp + button.icon.width: 24 * DefaultStyle.dp + button.icon.height: 24 * DefaultStyle.dp + button.icon.source: AppIcons.videoCamera label: qsTr("Appel Video") property var callObj button.onClicked: { @@ -147,8 +142,6 @@ ColumnLayout { console.log("[CallPage.qml] TODO : enable video") } } - // Item {Layout.fillWidth: true} - } ColumnLayout { id: detailControl diff --git a/Linphone/view/App/Layout/LoginLayout.qml b/Linphone/view/App/Layout/LoginLayout.qml index 43e7fa295..15f0c907a 100644 --- a/Linphone/view/App/Layout/LoginLayout.qml +++ b/Linphone/view/App/Layout/LoginLayout.qml @@ -28,7 +28,7 @@ Item { Item { Layout.fillWidth: true } - Control.Button { + Button { Layout.alignment: Qt.AlignRight | Qt.AlignVCenter // Layout.bottomMargin: 20 background: Rectangle { @@ -53,7 +53,6 @@ Item { } onClicked: console.debug("[LoginLayout]User: open about popup") } - } RowLayout { diff --git a/Linphone/view/App/Layout/MainLayout.qml b/Linphone/view/App/Layout/MainLayout.qml index 8ab13d5b5..7fdaebb45 100644 --- a/Linphone/view/App/Layout/MainLayout.qml +++ b/Linphone/view/App/Layout/MainLayout.qml @@ -238,34 +238,25 @@ Item { } } } - Control.Button { + PopupButton { id: avatarButton AccountProxy{ id: accountProxy //property bool haveAvatar: defaultAccount && defaultAccount.core.pictureUri || false } - + background.visible: false Layout.preferredWidth: 54 * DefaultStyle.dp Layout.preferredHeight: width - background: Item { - visible: false - } contentItem: Avatar { id: avatar height: avatarButton.height width: avatarButton.width account: accountProxy.defaultAccount } - onClicked: { - accountList.open() - } - Popup{ - id: accountList - x: -width + parent.width - y: settingsButton.height + (10 * DefaultStyle.dp) - contentWidth: accounts.width - contentHeight: accounts.height - Accounts{ + popup.x: width - popup.width + popup.padding: 0 + popup.contentItem: ColumnLayout { + Accounts { id: accounts onAddAccountRequest: mainItem.addAccountRequest() } diff --git a/Linphone/view/Item/Button.qml b/Linphone/view/Item/Button.qml index 017fd6f49..53c866b9c 100644 --- a/Linphone/view/Item/Button.qml +++ b/Linphone/view/Item/Button.qml @@ -1,6 +1,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.2 as Control import QtQuick.Effects +import QtQuick.Layouts import Linphone Control.Button { @@ -13,12 +14,15 @@ Control.Button { property int textWeight: 600 * DefaultStyle.dp property bool underline: false property bool shadowEnabled: false + property var contentImageColor hoverEnabled: true + icon.width: width + icon.height: height - leftPadding: 20 * DefaultStyle.dp - rightPadding: 20 * DefaultStyle.dp - topPadding: 11 * DefaultStyle.dp - bottomPadding: 11 * DefaultStyle.dp + // leftPadding: 20 * DefaultStyle.dp + // rightPadding: 20 * DefaultStyle.dp + // topPadding: 11 * DefaultStyle.dp + // bottomPadding: 11 * DefaultStyle.dp MouseArea { anchors.fill: parent @@ -58,19 +62,46 @@ Control.Button { } } - contentItem: Text { - id: contentText - horizontalAlignment: Text.AlignHCenter - anchors.centerIn: parent - wrapMode: Text.WordWrap - text: mainItem.text - color: inversedColors ? mainItem.color : DefaultStyle.grey_0 - font { - pixelSize: mainItem.textSize - weight: mainItem.textWeight - family: DefaultStyle.defaultFont - capitalization: mainItem.capitalization - underline: mainItem.underline + contentItem: StackLayout { + currentIndex: mainItem.text.length != 0 + ? 0 + : mainItem.icon.source != undefined + ? 1 + : 2 + + Text { + id: contentText + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + Layout.alignment: Qt.AlignCenter + Layout.fillWidth: true + Layout.fillHeight: true + width: implicitWidth + height: implicitHeight + wrapMode: Text.WordWrap + text: mainItem.text + color: inversedColors ? mainItem.color : DefaultStyle.grey_0 + font { + pixelSize: mainItem.textSize + weight: mainItem.textWeight + family: DefaultStyle.defaultFont + capitalization: mainItem.capitalization + underline: mainItem.underline + } + } + EffectImage { + id: image + Layout.alignment: Qt.AlignCenter + Layout.fillWidth: true + Layout.fillHeight: true + source: mainItem.icon.source + imageWidth: mainItem.icon.width + imageHeight: mainItem.icon.height + colorizationColor: mainItem.contentImageColor + } + Item { + Layout.fillWidth: true + Layout.fillHeight: true } } } diff --git a/Linphone/view/Item/Call/CallContactsLists.qml b/Linphone/view/Item/Call/CallContactsLists.qml index 3ff38d461..f04e785f5 100644 --- a/Linphone/view/Item/Call/CallContactsLists.qml +++ b/Linphone/view/Item/Call/CallContactsLists.qml @@ -47,6 +47,9 @@ Item { Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp background: Item{} + icon.source:AppIcons.closeX + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp contentItem: Image { anchors.fill: parent source: AppIcons.closeX @@ -158,10 +161,6 @@ Item { Button { visible: mainItem.groupCallVisible Layout.fillWidth: true - leftPadding: 0 - topPadding: 0 - rightPadding: 0 - bottomPadding: 0 background: Rectangle { color: DefaultStyle.groupCallButtonColor anchors.fill: parent @@ -190,35 +189,33 @@ Item { } } - RowLayout { - visible: searchBar.text.length > 0 - Layout.maximumWidth: parent.width - Layout.fillWidth: true - Text { - text: searchBar.text - maximumLineCount: 1 - elide: Text.ElideRight - } - Item { - Layout.fillWidth: true - } - Control.Button { - implicitWidth: 30 * DefaultStyle.dp - implicitHeight: 30 * DefaultStyle.dp - background: Item { - visible: false - } - contentItem: Image { - source: AppIcons.phone - width: 20 * DefaultStyle.dp - sourceSize.width: 20 * DefaultStyle.dp - fillMode: Image.PreserveAspectFit - } - onClicked: { - mainItem.callButtonPressed(searchBar.text) - } - } - } + // RowLayout { + // //DEBUG + // visible: searchBar.text.length > 0 + // Layout.maximumWidth: parent.width + // Layout.fillWidth: true + // Text { + // text: searchBar.text + // maximumLineCount: 1 + // elide: Text.ElideRight + // } + // Item { + // Layout.fillWidth: true + // } + // Button { + // implicitWidth: 30 * DefaultStyle.dp + // implicitHeight: 30 * DefaultStyle.dp + // background: Item { + // visible: false + // } + // icon.source: AppIcons.phone + // width: 20 * DefaultStyle.dp + // height: 20 * DefaultStyle.dp + // onClicked: { + // mainItem.callButtonPressed(searchBar.text) + // } + // } + // } ColumnLayout { Text { text: qsTr("All contacts") diff --git a/Linphone/view/Item/Call/OngoingCallRightPanel.qml b/Linphone/view/Item/Call/OngoingCallRightPanel.qml index 7b2563bd3..9bd6037e1 100644 --- a/Linphone/view/Item/Call/OngoingCallRightPanel.qml +++ b/Linphone/view/Item/Call/OngoingCallRightPanel.qml @@ -47,13 +47,11 @@ Control.Page { background: Item { visible: false } - contentItem: Image { - anchors.centerIn: closeButton - source: AppIcons.closeX - width: 10 * DefaultStyle.dp - sourceSize.width: 10 * DefaultStyle.dp - fillMode: Image.PreserveAspectFit - } + icon.source: AppIcons.closeX + Layout.preferredWidth: 10 * DefaultStyle.dp + Layout.preferredHeight: 10 * DefaultStyle.dp + width: 10 * DefaultStyle.dp + height: 10 * DefaultStyle.dp onClicked: mainItem.visible = false } } diff --git a/Linphone/view/Item/Carousel.qml b/Linphone/view/Item/Carousel.qml index 97de4a2fc..7acf8da4c 100644 --- a/Linphone/view/Item/Carousel.qml +++ b/Linphone/view/Item/Carousel.qml @@ -20,25 +20,11 @@ ColumnLayout { id: carouselStackLayout children: mainItem.itemsList property int previousIndex: currentIndex + currentIndex: 0 function goToSlideAtIndex(index) { - carouselStackLayout.previousIndex = carouselStackLayout.currentIndex; - carouselStackLayout.currentIndex = index; - } - - Component.onCompleted: { - // The animation is not working until the slide - // has been displayed once - for (var i = 0; i < mainItem.itemsCount; ++i) { - // const newObject = Qt.createQmlObject(mainItem.itemsList[i], carouselStackLayout); - // mainItem.itemsList[i].createObject(carouselStackLayout) - // carouselStackLayout.append(itemsList[i]) - var button = carouselButton.createObject(carouselButtonsLayout, {slideIndex: i, stackLayout: carouselStackLayout}) - button.buttonClicked.connect(goToSlideAtIndex) - currentIndex = i - } - currentIndex = 0 - previousIndex = currentIndex + carouselStackLayout.previousIndex = carouselStackLayout.currentIndex + carouselStackLayout.currentIndex = index } onCurrentIndexChanged: { @@ -75,25 +61,37 @@ ColumnLayout { } } } - RowLayout { - id: carouselButtonsLayout - Component { - id: carouselButton - Control.Button { - property int slideIndex - property var stackLayout - signal buttonClicked(int index) - - background: Rectangle { - color: stackLayout.currentIndex == slideIndex ? DefaultStyle.main1_500_main : DefaultStyle.main2_200 - radius: 15 * DefaultStyle.dp - width: stackLayout.currentIndex == slideIndex ? 11 * DefaultStyle.dp : 8 * DefaultStyle.dp + Item { + Rectangle { + id: currentIndicator + width: 13 * DefaultStyle.dp + height: 8 * DefaultStyle.dp + radius: 30 * DefaultStyle.dp + color: DefaultStyle.main1_500_main + z: 1 + x: carouselButton.itemAt(mainItem.currentIndex).x + Behavior on x { NumberAnimation {duration: 100}} + } + RowLayout { + id: carouselButtonsLayout + spacing: 10 * DefaultStyle.dp + Repeater { + id: carouselButton + model: mainItem.itemsCount + delegate: Button { + width: 8 * DefaultStyle.dp height: 8 * DefaultStyle.dp - Behavior on width { NumberAnimation {duration: 100}} - } - onClicked: { - buttonClicked(slideIndex) + padding: 0 + background: Rectangle { + color: DefaultStyle.main2_200 + radius: 30 * DefaultStyle.dp + width: 8 * DefaultStyle.dp + height: 8 * DefaultStyle.dp + } + onClicked: { + mainItem.goToSlide(modelData) + } } } } diff --git a/Linphone/view/Item/ComboBox.qml b/Linphone/view/Item/ComboBox.qml index 7a3b94c78..6522f9120 100644 --- a/Linphone/view/Item/ComboBox.qml +++ b/Linphone/view/Item/ComboBox.qml @@ -9,7 +9,7 @@ ColumnLayout { property string label: "" // Usage : each item of the model list must be {text: ..., img: ...} // If string list, only text part of the delegate will be filled - property var modelList: [] + property var model: [] readonly property string currentText: selectedItemText.text property bool enableBackgroundColors: true readonly property bool hasActiveFocus: combobox.activeFocus @@ -27,7 +27,7 @@ ColumnLayout { Control.ComboBox { id: combobox - model: mainItem.modelList + model: mainItem.model Layout.preferredWidth: mainItem.width background: Rectangle { implicitWidth: mainItem.width @@ -67,13 +67,13 @@ ColumnLayout { Component.onCompleted: { var index = combobox.currentIndex < 0 ? 0 : combobox.currentIndex - if (mainItem.modelList[index].img) { - selectedItemImg.source = mainItem.modelList[0].img + if (mainItem.model[index].img) { + selectedItemImg.source = mainItem.model[0].img } - if (mainItem.modelList[index].text) - selectedItemText.text = mainItem.modelList[0].text - else if (mainItem.modelList[index]) - selectedItemText.text = mainItem.modelList[0] + if (mainItem.model[index].text) + selectedItemText.text = mainItem.model[0].text + else if (mainItem.model[index]) + selectedItemText.text = mainItem.model[0] } } diff --git a/Linphone/view/Item/Contact/ContactEdition.qml b/Linphone/view/Item/Contact/ContactEdition.qml index f0a4b8715..f59e5bb09 100644 --- a/Linphone/view/Item/Contact/ContactEdition.qml +++ b/Linphone/view/Item/Contact/ContactEdition.qml @@ -35,10 +35,7 @@ ColumnLayout { anchors.rightMargin: 10 * DefaultStyle.dp width: 24 * DefaultStyle.dp height: 24 * DefaultStyle.dp - contentItem: Image { - anchors.fill: parent - source: AppIcons.closeX - } + icon.source: AppIcons.closeX onClicked: { // contact.core.pictureUri = mainItem.oldPictureUri mainItem.contact.core.undo() @@ -156,10 +153,9 @@ ColumnLayout { Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp background: Item{} - contentItem: Image { - anchors.fill: parent - source: AppIcons.closeX - } + icon.source: AppIcons.closeX + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp onClicked: mainItem.contact.core.removeAddress(index) } } @@ -196,10 +192,9 @@ ColumnLayout { Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp background: Item{} - contentItem: Image { - anchors.fill: parent - source: AppIcons.closeX - } + icon.source: AppIcons.closeX + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp onClicked: mainItem.contact.core.removePhoneNumber(index) } } @@ -242,6 +237,10 @@ ColumnLayout { Layout.alignment: Qt.AlignHCenter enabled: mainItem.contact && mainItem.contact.core.givenName.length > 0 text: mainItem.saveButtonText + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp onClicked: { mainItem.contact.core.save() mainItem.closeEdition() diff --git a/Linphone/view/Item/Contact/ContactsList.qml b/Linphone/view/Item/Contact/ContactsList.qml index bb17cedfa..1870db26a 100644 --- a/Linphone/view/Item/Contact/ContactsList.qml +++ b/Linphone/view/Item/Contact/ContactsList.qml @@ -148,7 +148,7 @@ ListView { colorizationColor: DefaultStyle.danger_500main } Text { - text: qsTr("Supprimmer") + text: qsTr("Supprimer") color: DefaultStyle.danger_500main font { pixelSize: 14 * DefaultStyle.dp diff --git a/Linphone/view/Item/Contact/Sticker.qml b/Linphone/view/Item/Contact/Sticker.qml index 08d1872dc..2c3276748 100644 --- a/Linphone/view/Item/Contact/Sticker.qml +++ b/Linphone/view/Item/Contact/Sticker.qml @@ -70,7 +70,10 @@ Item { interval: 1 onTriggered: {cameraLoader.active=false; cameraLoader.active=true;} } - active: mainItem.visible && call ? call.core.remoteVideoEnabled : mainItem.enablePersonalCamera + active: mainItem.visible && call + ? call.core.remoteVideoEnabled && (mainItem.call.core.state != LinphoneEnums.CallState.End + && mainItem.call.core.state != LinphoneEnums.CallState.Released) + : mainItem.enablePersonalCamera onActiveChanged: console.log("camera active", active) sourceComponent: cameraComponent } @@ -99,7 +102,7 @@ Item { anchors.bottom: parent.bottom anchors.leftMargin: 10 * DefaultStyle.dp anchors.bottomMargin: 10 * DefaultStyle.dp - width: txtMeter.width + width: implicitWidth text: mainItem.peerAddress.length != 0 ? mainItem.peerAddress : mainItem.account && mainItem.identityAddress @@ -111,10 +114,6 @@ Item { weight: 500 * DefaultStyle.dp } } - TextMetrics { - id: txtMeter - text: bottomAddress.text - } } MultiEffect { id: shadow diff --git a/Linphone/view/Item/Dialog.qml b/Linphone/view/Item/Dialog.qml index 76d8db886..48f2048b5 100644 --- a/Linphone/view/Item/Dialog.qml +++ b/Linphone/view/Item/Dialog.qml @@ -83,6 +83,10 @@ Popup { Button { visible: mainItem.buttons.length === 2 text: qsTr("Oui") + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp onClicked: { mainItem.accepted() mainItem.close() @@ -91,6 +95,10 @@ Popup { Button { visible: mainItem.buttons.length === 2 text: qsTr("Non") + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp onClicked: { mainItem.rejected() mainItem.close() diff --git a/Linphone/view/Item/EffectImage.qml b/Linphone/view/Item/EffectImage.qml index 65006902d..325e315de 100644 --- a/Linphone/view/Item/EffectImage.qml +++ b/Linphone/view/Item/EffectImage.qml @@ -39,6 +39,7 @@ Loader { MultiEffect { id: effect2 + visible: mainItem.useColor enabled: mainItem.useColor anchors.fill: effect source: effect diff --git a/Linphone/view/Item/Form/LoginForm.qml b/Linphone/view/Item/Form/LoginForm.qml index 8a506308d..60f8470ff 100644 --- a/Linphone/view/Item/Form/LoginForm.qml +++ b/Linphone/view/Item/Form/LoginForm.qml @@ -64,6 +64,10 @@ ColumnLayout { RowLayout { id: lastFormLineLayout Button { + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp contentItem: StackLayout { id: connectionButton currentIndex: 0 diff --git a/Linphone/view/Item/NumericPad.qml b/Linphone/view/Item/NumericPad.qml index 4b22e1bf2..d29466fbc 100644 --- a/Linphone/view/Item/NumericPad.qml +++ b/Linphone/view/Item/NumericPad.qml @@ -43,19 +43,17 @@ Control.Popup { Button { id: closeButton visible: mainItem.closeButtonVisible - anchors.right: parent.right anchors.top: parent.top + anchors.right: parent.right + anchors.topMargin: 10 * DefaultStyle.dp + anchors.rightMargin: 10 * DefaultStyle.dp background: Item { anchors.fill: parent visible: false } - contentItem: Image { - anchors.centerIn: parent - source: AppIcons.closeX - width: 24 * DefaultStyle.dp - sourceSize.width: 24 * DefaultStyle.dp - fillMode: Image.PreserveAspectFit - } + icon.source: AppIcons.closeX + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp onClicked: mainItem.close() } } @@ -152,15 +150,10 @@ Control.Popup { color: DefaultStyle.success_500main radius: 71 * DefaultStyle.dp } - contentItem: EffectImage { - id: buttonIcon - source: AppIcons.phone - anchors.centerIn: parent - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp - fillMode: Image.PreserveAspectFit - colorizationColor: DefaultStyle.grey_0 - } + icon.source: AppIcons.phone + icon.width: 32 * DefaultStyle.dp + icon.height: 32 * DefaultStyle.dp + contentImageColor: DefaultStyle.grey_0 onClicked: mainItem.launchCall() } Button { @@ -172,12 +165,9 @@ Control.Popup { background: Item { visible: false } - contentItem: Image { - source: AppIcons.backspaceFill - anchors.centerIn: parent - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp - } + icon.source: AppIcons.backspaceFill + icon.width: 38 * DefaultStyle.dp + icon.height: 38 * DefaultStyle.dp onClicked: mainItem.wipe() } } diff --git a/Linphone/view/Item/PopupButton.qml b/Linphone/view/Item/PopupButton.qml index 19d49cc24..d3b61705c 100644 --- a/Linphone/view/Item/PopupButton.qml +++ b/Linphone/view/Item/PopupButton.qml @@ -22,13 +22,9 @@ Button { color: DefaultStyle.main2_300 radius: 40 * DefaultStyle.dp } - contentItem: Image { - source: AppIcons.more - sourceSize.width: 24 * DefaultStyle.dp - sourceSize.height: 24 * DefaultStyle.dp - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp - } + icon.source: AppIcons.more + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp onPressed: { if (popup.visible) popup.close() else popup.open() diff --git a/Linphone/view/Item/RadioButton.qml b/Linphone/view/Item/RadioButton.qml index fba9e7432..250d9e8c0 100644 --- a/Linphone/view/Item/RadioButton.qml +++ b/Linphone/view/Item/RadioButton.qml @@ -5,10 +5,10 @@ import Linphone Control.RadioButton { id: mainItem - property bool inversedColors: false property string title property string contentText property string imgUrl + property color color hoverEnabled: true MouseArea { @@ -20,7 +20,7 @@ Control.RadioButton { background: Rectangle { color: DefaultStyle.grey_100 - border.color: mainItem.checked ? DefaultStyle.info_500_main : "transparent" + border.color: mainItem.checked ? mainItem.color : "transparent" radius: 20 * DefaultStyle.dp } @@ -34,7 +34,7 @@ Control.RadioButton { implicitWidth: 16 * DefaultStyle.dp implicitHeight: 16 * DefaultStyle.dp radius: implicitWidth/2 - border.color: mainItem.checked ? DefaultStyle.info_500_main : DefaultStyle.main1_500_main + border.color: mainItem.color Rectangle { width: parent.width/2 @@ -42,7 +42,7 @@ Control.RadioButton { x: parent.width/4 y: parent.width/4 radius: width/2 - color: DefaultStyle.info_500_main + color: mainItem.color visible: mainItem.checked } } @@ -52,17 +52,16 @@ Control.RadioButton { color: DefaultStyle.grey_900 font.pixelSize: 16 * DefaultStyle.dp } - Control.Button { + Button { padding: 0 background: Item { visible: false } - contentItem: Image { - fillMode: Image.PreserveAspectFit - source: AppIcons.info - width: 2 * DefaultStyle.dp - height: 2 * DefaultStyle.dp - } + icon.source: AppIcons.info + Layout.preferredWidth: 2 * DefaultStyle.dp + Layout.preferredHeight: 2 * DefaultStyle.dp + width: 2 * DefaultStyle.dp + height: 2 * DefaultStyle.dp } } diff --git a/Linphone/view/Item/SearchBar.qml b/Linphone/view/Item/SearchBar.qml index dc21770a2..2df085c49 100644 --- a/Linphone/view/Item/SearchBar.qml +++ b/Linphone/view/Item/SearchBar.qml @@ -71,7 +71,7 @@ Rectangle { width: 1 * DefaultStyle.dp } } - Control.Button { + Button { id: dialerButton visible: numericPad != undefined && textField.text.length === 0 checkable: true @@ -79,33 +79,30 @@ Rectangle { background: Rectangle { color: "transparent" } - contentItem: Image { - fillMode: Image.PreserveAspectFit - source: dialerButton.checked ? AppIcons.dialerSelected : AppIcons.dialer - } - anchors.top: parent.top - anchors.bottom: parent.bottom + icon.source: dialerButton.checked ? AppIcons.dialerSelected : AppIcons.dialer + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp + anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right - anchors.rightMargin: 10 * DefaultStyle.dp + anchors.rightMargin: 15 * DefaultStyle.dp onCheckedChanged: { if (checked) mainItem.numericPad.open() else mainItem.numericPad.close() } } - Control.Button { + Button { id: clearTextButton visible: textField.text.length > 0 background: Rectangle { color: "transparent" } - contentItem: Image { - fillMode: Image.PreserveAspectFit - source: AppIcons.closeX - } + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp + icon.source: AppIcons.closeX anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: parent.right - anchors.rightMargin: 10 * DefaultStyle.dp + anchors.rightMargin: 15 * DefaultStyle.dp onClicked: { textField.clear() } diff --git a/Linphone/view/Item/Test/ItemsTest.qml b/Linphone/view/Item/Test/ItemsTest.qml index 7d3a87d5d..75e8d46ac 100644 --- a/Linphone/view/Item/Test/ItemsTest.qml +++ b/Linphone/view/Item/Test/ItemsTest.qml @@ -15,7 +15,7 @@ Window { text: "Combobox with image" } ComboBox { - modelList: [ + model: [ {text: "item 1", img: AppIcons.info}, {text: "item 2", img: AppIcons.info}, {text: "item 3", img: AppIcons.info} @@ -27,7 +27,7 @@ Window { text: "Combobox without image" } ComboBox { - modelList: [ + model: [ {text: "item 1"}, {text: "item 2"}, {text: "item 3"} diff --git a/Linphone/view/Item/TextInput.qml b/Linphone/view/Item/TextInput.qml index 5d9887a23..ea57e14b1 100644 --- a/Linphone/view/Item/TextInput.qml +++ b/Linphone/view/Item/TextInput.qml @@ -108,23 +108,20 @@ ColumnLayout { } } } - Control.Button { + Button { id: eyeButton visible: mainItem.hidden checkable: true background: Rectangle { color: "transparent" } - contentItem: Image { - fillMode: Image.PreserveAspectFit - source: eyeButton.checked ? AppIcons.eyeShow : AppIcons.eyeHide - width: 20 * DefaultStyle.dp - height: 20 * DefaultStyle.dp - } + icon.source: eyeButton.checked ? AppIcons.eyeShow : AppIcons.eyeHide + width: 20 * DefaultStyle.dp + height: 20 * DefaultStyle.dp anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: parent.right - anchors.rightMargin: 5 * DefaultStyle.dp + anchors.rightMargin: 15 * DefaultStyle.dp } } ErrorText { diff --git a/Linphone/view/Page/Login/LoginPage.qml b/Linphone/view/Page/Login/LoginPage.qml index f71c65615..b1ea309d0 100644 --- a/Linphone/view/Page/Login/LoginPage.qml +++ b/Linphone/view/Page/Login/LoginPage.qml @@ -12,12 +12,11 @@ LoginLayout { signal connectionSucceed() titleContent: RowLayout { - Control.Button { - Layout.preferredHeight: 40 * DefaultStyle.dp - Layout.preferredWidth: height + spacing: 15 * DefaultStyle.dp + Button { visible: mainItem.showBackButton - icon.width: width - icon.height: height + Layout.preferredHeight: 27 * DefaultStyle.dp + Layout.preferredWidth: 27 * DefaultStyle.dp icon.source: AppIcons.returnArrow background: Rectangle { color: "transparent" @@ -30,6 +29,8 @@ LoginLayout { Image { fillMode: Image.PreserveAspectFit source: AppIcons.profile + Layout.preferredHeight: 34 * DefaultStyle.dp + Layout.preferredWidth: 34 * DefaultStyle.dp } Text { text: qsTr("Connexion") @@ -37,7 +38,6 @@ LoginLayout { pixelSize: 36 * DefaultStyle.dp weight: 800 * DefaultStyle.dp } - scaleLettersFactor: 1.1 } Item { Layout.fillWidth: true @@ -50,6 +50,10 @@ LoginLayout { } Button { Layout.alignment: Qt.AlignRight + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp text: qsTr("S'inscrire") onClicked: { console.debug("[LoginPage] User: go to register") @@ -58,7 +62,7 @@ LoginLayout { } } centerContent: ColumnLayout { - + Layout.leftMargin: 45 * DefaultStyle.dp RowLayout { ColumnLayout { @@ -68,6 +72,10 @@ LoginLayout { Button { Layout.topMargin: 40 * DefaultStyle.dp inversedColors: true + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp text: qsTr("Compte SIP tiers") onClicked: {mainItem.useSIPButtonClicked()} } diff --git a/Linphone/view/Page/Login/RegisterCheckingPage.qml b/Linphone/view/Page/Login/RegisterCheckingPage.qml index af7b126be..68d45acb6 100644 --- a/Linphone/view/Page/Login/RegisterCheckingPage.qml +++ b/Linphone/view/Page/Login/RegisterCheckingPage.qml @@ -10,11 +10,9 @@ LoginLayout { property string email titleContent: RowLayout { - Control.Button { - Layout.preferredHeight: 40 * DefaultStyle.dp - Layout.preferredWidth: 40 * DefaultStyle.dp - icon.width: 40 * DefaultStyle.dp - icon.height: 40 * DefaultStyle.dp + Button { + Layout.preferredHeight: 24 * DefaultStyle.dp + Layout.preferredWidth: 24 * DefaultStyle.dp icon.source: AppIcons.returnArrow background: Rectangle { color: "transparent" @@ -104,6 +102,10 @@ LoginLayout { } Button { Layout.alignment: Qt.AlignRight + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp inversedColors: true text: "Resend a code" onClicked: { diff --git a/Linphone/view/Page/Login/RegisterPage.qml b/Linphone/view/Page/Login/RegisterPage.qml index 99de72140..b28b8da70 100644 --- a/Linphone/view/Page/Login/RegisterPage.qml +++ b/Linphone/view/Page/Login/RegisterPage.qml @@ -40,6 +40,10 @@ LoginLayout { } Button { // Layout.alignment: Qt.AlignRight + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp text: qsTr("Connexion") onClicked: { console.debug("[RegisterPage] User: return") @@ -72,7 +76,7 @@ LoginLayout { ComboBox { label: " " enabled: false - modelList: [{text:"@sip.linphone.org"}] + model: [{text:"@sip.linphone.org"}] Layout.preferredWidth: 210 * DefaultStyle.dp } } @@ -131,6 +135,10 @@ LoginLayout { } } Button { + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp text: qsTr("Register") onClicked:{ console.log("[RegisterPage] User: Call register with phone number", phoneNumberInput.phoneNumber) @@ -164,7 +172,7 @@ LoginLayout { // due to the invisibility of the upper label label: " " enabled: false - modelList: [{text:"@sip.linphone.org"}] + model: [{text:"@sip.linphone.org"}] Layout.preferredWidth: 210 * DefaultStyle.dp } } @@ -224,6 +232,10 @@ LoginLayout { } } Button { + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp text: qsTr("Register") onClicked:{ console.log("[RegisterPage] User: Call register with email", emailInput.text) diff --git a/Linphone/view/Page/Login/SIPLoginPage.qml b/Linphone/view/Page/Login/SIPLoginPage.qml index 77b9456a7..5ff87116a 100644 --- a/Linphone/view/Page/Login/SIPLoginPage.qml +++ b/Linphone/view/Page/Login/SIPLoginPage.qml @@ -14,12 +14,9 @@ LoginLayout { Button { Layout.preferredHeight: 24 * DefaultStyle.dp Layout.preferredWidth: 24 * DefaultStyle.dp - contentItem: Image { - anchors.fill: parent - source: AppIcons.returnArrow - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp - } + icon.source: AppIcons.returnArrow + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp background: Item { anchors.fill: parent } @@ -162,7 +159,7 @@ LoginLayout { } ComboBox { label: qsTr("Transport") - modelList:[ "TCP", "UDP", "TLS", "DTLS"] + model:[ "TCP", "UDP", "TLS", "DTLS"] Layout.preferredWidth: 360 * DefaultStyle.dp } diff --git a/Linphone/view/Page/Login/SecurityModePage.qml b/Linphone/view/Page/Login/SecurityModePage.qml index 11604d518..8f54c835b 100644 --- a/Linphone/view/Page/Login/SecurityModePage.qml +++ b/Linphone/view/Page/Login/SecurityModePage.qml @@ -42,14 +42,15 @@ LoginLayout { spacing: 70 * DefaultStyle.dp Repeater { model: [ - {checked: true, title: qsTr("Chiffrement de bout en bout"), text: qsTr("Ce mode vous garanti la confidentialité de tous vos échanges. Notre technologie de chiffrement de bout en bout assure un niveau de sécurité maximal pour tous vos échanges."), imgUrl: AppIcons.chiffrement}, - {checked: false, title: qsTr("Interoperable"), text: qsTr("Ce mode vous permet de profiter de toute les fonctionnalités de Linphone, toute en restant interopérable avec n’importe qu’elle autre service SIP."), imgUrl: AppIcons.interoperable} + {checked: true, title: qsTr("Chiffrement de bout en bout"), text: qsTr("Ce mode vous garanti la confidentialité de tous vos échanges. Notre technologie de chiffrement de bout en bout assure un niveau de sécurité maximal pour tous vos échanges."), imgUrl: AppIcons.chiffrement, color: DefaultStyle.info_500_main}, + {checked: false, title: qsTr("Interoperable"), text: qsTr("Ce mode vous permet de profiter de toute les fonctionnalités de Linphone, toute en restant interopérable avec n’importe qu’elle autre service SIP."), imgUrl: AppIcons.interoperable, color: DefaultStyle.main1_500_main} ] RadioButton { title: modelData.title contentText: modelData.text imgUrl: modelData.imgUrl checked: modelData.checked + color: modelData. color onCheckedChanged: { if (checked) continueButton.selectedIndex = index } @@ -60,6 +61,8 @@ LoginLayout { id: continueButton property int selectedIndex: 0 Layout.alignment: Qt.AlignHCenter + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp leftPadding: 100 * DefaultStyle.dp rightPadding: 100 * DefaultStyle.dp text: qsTr("Continuer") diff --git a/Linphone/view/Page/Login/WelcomePage.qml b/Linphone/view/Page/Login/WelcomePage.qml index 0d02ed25d..8d57239fb 100644 --- a/Linphone/view/Page/Login/WelcomePage.qml +++ b/Linphone/view/Page/Login/WelcomePage.qml @@ -79,7 +79,8 @@ LoginLayout { model: [ {title: qsTr("Linphone"), text: qsTr("Une application de communication sécurisée,
open source et française.")}, {title: qsTr("Sécurisé"), text: qsTr("Vos communications sont en sécurité grâce aux
Chiffrement de bout en bout.")}, - {title: qsTr("Open Source"), text: qsTr("Une application open source et un service gratuit
depuis 2001")}, + {title: qsTr("Open Source"), text: qsTr("Une application open source et un service gratuit
depuis 2001")} + // {title: qsTr("Sécurisé"), text: qsTr("Vos communications sont en sécurité grâce aux
Chiffrement de bout en bout.")} ] ColumnLayout { spacing: 15 * DefaultStyle.dp @@ -111,9 +112,13 @@ LoginLayout { anchors.bottomMargin: 20 * DefaultStyle.dp anchors.leftMargin: (centerLayout.width - width) * DefaultStyle.dp y: centerLayout.implicitWidth - width + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp text: carousel.currentIndex < (carousel.itemsCount - 1) ? qsTr("Suivant") : qsTr("Commencer") onClicked: { - if (carousel.currentIndex < 2) carousel.goToSlide(carousel.currentIndex + 1); + if (carousel.currentIndex < carousel.itemsCount - 1) carousel.goToSlide(carousel.currentIndex + 1); else mainItem.startButtonPressed(); } } diff --git a/Linphone/view/Page/Main/AbstractMainPage.qml b/Linphone/view/Page/Main/AbstractMainPage.qml index 1daa719c7..7899c1a42 100644 --- a/Linphone/view/Page/Main/AbstractMainPage.qml +++ b/Linphone/view/Page/Main/AbstractMainPage.qml @@ -193,7 +193,7 @@ Item { contentItem: RowLayout { Layout.alignment: Qt.AlignVCenter EffectImage { - colorizationColor: DefaultStyle.grey_0 + colorizationColor: "red"// DefaultStyle.grey_0 source: mainItem.newItemIconSource width: 24 * DefaultStyle.dp height: 24 * DefaultStyle.dp diff --git a/Linphone/view/Page/Main/CallPage.qml b/Linphone/view/Page/Main/CallPage.qml index 9384081cc..1870e7268 100644 --- a/Linphone/view/Page/Main/CallPage.qml +++ b/Linphone/view/Page/Main/CallPage.qml @@ -59,6 +59,7 @@ AbstractMainPage { ColumnLayout { property alias listView: historyListView RowLayout { + spacing: 16 * DefaultStyle.dp Layout.fillWidth: true Layout.leftMargin: listStackView.sideMargin Layout.rightMargin: listStackView.sideMargin @@ -73,6 +74,8 @@ AbstractMainPage { } PopupButton { id: removeHistory + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp popup.x: 0 popup.padding: 10 * DefaultStyle.dp popup.contentItem: Button { @@ -108,17 +111,11 @@ AbstractMainPage { } } } - Control.Button { - - background: Item { - visible: false - } - contentItem: Image { - source: AppIcons.newCall - width: 30 * DefaultStyle.dp - sourceSize.width: 30 * DefaultStyle.dp - fillMode: Image.PreserveAspectFit - } + Button { + background: Item {} + icon.source: AppIcons.newCall + Layout.preferredWidth: 28 * DefaultStyle.dp + Layout.preferredHeight: 28 * DefaultStyle.dp onClicked: { console.debug("[CallPage]User: create new call") listStackView.push(newCallItem) @@ -249,21 +246,16 @@ AbstractMainPage { // Item { // Layout.fillWidth: true // } - Control.Button { - implicitWidth: 24 * DefaultStyle.dp - implicitHeight: 24 * DefaultStyle.dp + Button { Layout.rightMargin: 5 * DefaultStyle.dp padding: 0 property var callObj background: Item { visible: false } - contentItem: Image { - source: AppIcons.phone - width: 24 * DefaultStyle.dp - sourceSize.width: 24 * DefaultStyle.dp - fillMode: Image.PreserveAspectFit - } + icon.source: AppIcons.phone + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp onClicked: { var addr = UtilsCpp.generateLinphoneSipAddress(modelData.core.remoteAddress) callObj = UtilsCpp.createCall(addr) @@ -293,6 +285,7 @@ AbstractMainPage { positionViewAtIndex(currentIndex, ListView.Visible) mainItem.selectedRowHistoryGui = model.getAt(currentIndex) } + onCountChanged: mainItem.selectedRowHistoryGui = model.getAt(currentIndex) onVisibleChanged: { if (!visible) currentIndex = -1 } @@ -324,12 +317,12 @@ AbstractMainPage { RowLayout { Layout.leftMargin: listStackView.sideMargin Layout.rightMargin: listStackView.sideMargin - Control.Button { + Button { background: Item { } - contentItem: Image { - source: AppIcons.returnArrow - } + Layout.preferredWidth: 24 * DefaultStyle.dp + Layout.preferredHeight: 24 * DefaultStyle.dp + icon.source: AppIcons.returnArrow onClicked: { console.debug("[CallPage]User: return to call history") listStackView.pop() @@ -539,46 +532,6 @@ AbstractMainPage { } } - component LabelButton: ColumnLayout { - id: labelButton - property alias image: buttonImg - property alias button: button - property string label - spacing: 8 * DefaultStyle.dp - Button { - id: button - Layout.alignment: Qt.AlignHCenter - Layout.preferredWidth: 56 * DefaultStyle.dp - Layout.preferredHeight: 56 * DefaultStyle.dp - topPadding: 16 * DefaultStyle.dp - bottomPadding: 16 * DefaultStyle.dp - leftPadding: 16 * DefaultStyle.dp - rightPadding: 16 * DefaultStyle.dp - background: Rectangle { - anchors.fill: parent - radius: 40 * DefaultStyle.dp - color: DefaultStyle.main2_200 - } - contentItem: Image { - id: buttonImg - source: labelButton.source - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp - fillMode: Image.PreserveAspectFit - sourceSize.width: 24 * DefaultStyle.dp - sourceSize.height: 24 * DefaultStyle.dp - } - } - Text { - Layout.alignment: Qt.AlignHCenter - text: labelButton.label - font { - pixelSize: 14 * DefaultStyle.dp - weight: 400 * DefaultStyle.dp - } - } - } - component IconLabel: RowLayout { id: iconLabel property string text diff --git a/Linphone/view/Page/Main/ContactPage.qml b/Linphone/view/Page/Main/ContactPage.qml index ebdcaf49b..7f4c14a65 100644 --- a/Linphone/view/Page/Main/ContactPage.qml +++ b/Linphone/view/Page/Main/ContactPage.qml @@ -72,17 +72,14 @@ AbstractMainPage { Item { Layout.fillWidth: true } - Control.Button { - + Button { background: Item { - visible: false - } - contentItem: Image { - source: AppIcons.plusCircle - width: 30 * DefaultStyle.dp - sourceSize.width: 30 * DefaultStyle.dp - fillMode: Image.PreserveAspectFit } + icon.source: AppIcons.plusCircle + Layout.preferredWidth: 30 * DefaultStyle.dp + Layout.preferredHeight: 30 * DefaultStyle.dp + width: 30 * DefaultStyle.dp + height: 30 * DefaultStyle.dp onClicked: { mainItem.createContact("", "") } @@ -93,12 +90,6 @@ AbstractMainPage { Layout.topMargin: 30 * DefaultStyle.dp Layout.leftMargin: leftPanel.sideMargin enabled: mainItem.leftPanelEnabled - Button { - onClicked: { - favoriteList.currentIndex = -1 - contactList.currentIndex = -1 - } - } SearchBar { id: searchBar Layout.rightMargin: leftPanel.sideMargin @@ -162,9 +153,9 @@ AbstractMainPage { } Button { background: Item{} - contentItem: Image { - source: favoriteList.visible ? AppIcons.upArrow : AppIcons.downArrow - } + icon.source: favoriteList.visible ? AppIcons.upArrow : AppIcons.downArrow + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp onClicked: favoriteList.visible = !favoriteList.visible } } @@ -211,9 +202,9 @@ AbstractMainPage { } Button { background: Item{} - contentItem: Image { - source: contactList.visible ? AppIcons.upArrow : AppIcons.downArrow - } + icon.source: favoriteList.visible ? AppIcons.upArrow : AppIcons.downArrow + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp onClicked: contactList.visible = !contactList.visible } } @@ -269,11 +260,8 @@ AbstractMainPage { width: 24 * DefaultStyle.dp height: 24 * DefaultStyle.dp background: Item{} - contentItem: Image { - anchors.fill: parent - source: AppIcons.pencil - } onClicked: mainItem.editContact(mainItem.selectedContact) + icon.source: AppIcons.pencil } detailContent: ColumnLayout { Layout.fillWidth: false @@ -319,7 +307,6 @@ AbstractMainPage { Layout.fillWidth: true Text { Layout.fillWidth: true - // TODO change with domain text: modelData.label font { pixelSize: 13 * DefaultStyle.dp @@ -343,12 +330,9 @@ AbstractMainPage { Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp property var callObj - contentItem: Image { - anchors.fill: parent - source: AppIcons.phone - width: 24 * DefaultStyle.dp - height: 24 * DefaultStyle.dp - } + icon.source: AppIcons.phone + width: 24 * DefaultStyle.dp + height: 24 * DefaultStyle.dp onClicked: { callObj = UtilsCpp.createCall(modelData.address) }