From d9786c31e3fe9ac72476730baf0bb62319f8431c Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Thu, 9 Jan 2025 15:33:11 +0100 Subject: [PATCH] set media encryption according to settings --- Linphone/tool/Utils.cpp | 2 + Linphone/view/CMakeLists.txt | 2 + Linphone/view/Control/Button/Button.qml | 62 +++++++++---------- Linphone/view/Control/Button/MediumButton.qml | 2 - Linphone/view/Control/Button/SmallButton.qml | 2 - 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Linphone/tool/Utils.cpp b/Linphone/tool/Utils.cpp index afea9eb0..10c30699 100644 --- a/Linphone/tool/Utils.cpp +++ b/Linphone/tool/Utils.cpp @@ -135,6 +135,8 @@ void Utils::createCall(const QString &sipAddress, LinphoneEnums::MediaEncryption mediaEncryption, const QString &prepareTransfertAddress, const QHash &headers) { + mediaEncryption = + App::getInstance()->getSettings()->getMediaEncryption()["id"].value(); lDebug() << "[Utils] create call with uri :" << sipAddress << mediaEncryption; App::postModelAsync([sipAddress, options, mediaEncryption, prepareTransfertAddress, headers]() { QString errorMessage; diff --git a/Linphone/view/CMakeLists.txt b/Linphone/view/CMakeLists.txt index 3895230e..232d12b7 100644 --- a/Linphone/view/CMakeLists.txt +++ b/Linphone/view/CMakeLists.txt @@ -8,6 +8,7 @@ list(APPEND _LINPHONEAPP_QML_FILES view/Control/Button/HelpIconLabelButton.qml view/Control/Button/IconLabelButton.qml view/Control/Button/MenuButton.qml + view/Control/Button/BigButton.qml view/Control/Button/MediumButton.qml view/Control/Button/SmallButton.qml view/Control/Button/CountryIndicatorCombobox.qml @@ -144,6 +145,7 @@ list(APPEND _LINPHONEAPP_QML_FILES list(APPEND _LINPHONEAPP_QML_SINGLETONS view/Style/AppIcons.qml + view/Style/ButtonStyle.qml view/Style/DefaultStyle.qml view/Style/Typography.qml ) diff --git a/Linphone/view/Control/Button/Button.qml b/Linphone/view/Control/Button/Button.qml index 25c2ab89..b00393e6 100644 --- a/Linphone/view/Control/Button/Button.qml +++ b/Linphone/view/Control/Button/Button.qml @@ -7,27 +7,25 @@ import Linphone Control.Button { id: mainItem property int capitalization - property color color: DefaultStyle.main1_500_main - property color disabledColor: Qt.darker(color, 1.5) - property color borderColor: DefaultStyle.grey_0 - readonly property color pressedColor: Qt.darker(color, 1.1) + property QtObject style + property color color: style ? style.color.normal : DefaultStyle.main1_500_main + readonly property color pressedColor: style && style.color.pressed || Qt.darker(color, 1.3) + readonly property color hoveredColor: style && style.color.hovered || Qt.darker(color, 1.1) + property color textColor: style && style.text.normal || DefaultStyle.grey_0 + property color pressedTextColor: style && style.text.pressed || textColor + property color borderColor: style && style.borderColor || "transparent" property bool inversedColors: false property int textSize: 18 * DefaultStyle.dp property int textWeight: 600 * DefaultStyle.dp property var textHAlignment: Text.AlignHCenter property int radius: 48 * DefaultStyle.dp - property color textColor: DefaultStyle.grey_0 - property bool underline: activeFocus || containsMouse - property bool shadowEnabled: enabled && (activeFocus || containsMouse) - property var contentImageColor - property alias containsMouse: mouseArea.containsMouse + property bool underline: false + property bool hasNavigationFocus: enabled && (activeFocus || hovered) + property var contentImageColor: style && style.image.normal || DefaultStyle.main2_600 + property var pressedImageColor: style && style.image.pressed || DefaultStyle.main2_600 property bool asynchronous: true hoverEnabled: true activeFocusOnTab: true - // leftPadding: 20 * DefaultStyle.dp - // rightPadding: 20 * DefaultStyle.dp - // topPadding: 11 * DefaultStyle.dp - // bottomPadding: 11 * DefaultStyle.dp MouseArea { id: mouseArea anchors.fill: parent @@ -40,30 +38,31 @@ Control.Button { asynchronous: mainItem.asynchronous anchors.fill: parent - sourceComponent: - Item { + sourceComponent: Item { Rectangle { id: buttonBackground anchors.fill: parent - color: mainItem.enabled - ? inversedColors - ? mainItem.pressed || mainItem.shadowEnabled - ? DefaultStyle.grey_100 - : mainItem.borderColor - : mainItem.pressed || mainItem.shadowEnabled - ? mainItem.pressedColor - : mainItem.color - : mainItem.disabledColor + color: mainItem.pressed + ? mainItem.pressedColor + : mainItem.hovered || mainItem.hasNavigationFocus + ? mainItem.hoveredColor + : mainItem.color radius: mainItem.radius - border.color: inversedColors ? mainItem.color : mainItem.borderColor + border.color: mainItem.borderColor + } + Rectangle { + id: disableShadow + color: "white" + opacity: 0.2 + visible: !mainItem.enabled } MultiEffect { - enabled: mainItem.shadowEnabled + enabled: mainItem.hasNavigationFocus anchors.fill: buttonBackground source: buttonBackground - visible: mainItem.shadowEnabled + visible: mainItem.hasNavigationFocus // Crash : https://bugreports.qt.io/browse/QTBUG-124730 - shadowEnabled: true //mainItem.shadowEnabled + shadowEnabled: mainItem.hasNavigationFocus shadowColor: DefaultStyle.grey_1000 shadowBlur: 0.1 shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0 @@ -79,7 +78,9 @@ Control.Button { wrapMode: Text.WrapAnywhere text: mainItem.text maximumLineCount: 1 - color: inversedColors ? mainItem.color : mainItem.textColor + color: pressed + ? mainItem.pressedTextColor + : mainItem.textColor font { pixelSize: mainItem.textSize weight: mainItem.textWeight @@ -98,8 +99,7 @@ Control.Button { imageSource: mainItem.icon.source imageWidth: mainItem.icon.width imageHeight: mainItem.icon.height - colorizationColor: mainItem.contentImageColor - shadowEnabled: mainItem.shadowEnabled + colorizationColor: mainItem.pressed ? mainItem.pressedImageColor : mainItem.contentImageColor } contentItem: Control.StackView{ diff --git a/Linphone/view/Control/Button/MediumButton.qml b/Linphone/view/Control/Button/MediumButton.qml index f9a568e5..c98cb1bd 100644 --- a/Linphone/view/Control/Button/MediumButton.qml +++ b/Linphone/view/Control/Button/MediumButton.qml @@ -8,8 +8,6 @@ Button { id: mainItem textSize: Typography.b3.pixelSize textWeight: Typography.b3.weight - color: DefaultStyle.main1_100 - textColor: DefaultStyle.main1_500_main leftPadding: 16 * DefaultStyle.dp rightPadding: 16 * DefaultStyle.dp topPadding: 10 * DefaultStyle.dp diff --git a/Linphone/view/Control/Button/SmallButton.qml b/Linphone/view/Control/Button/SmallButton.qml index 09736546..a5b04083 100644 --- a/Linphone/view/Control/Button/SmallButton.qml +++ b/Linphone/view/Control/Button/SmallButton.qml @@ -8,8 +8,6 @@ Button { id: mainItem textSize: Typography.b3.pixelSize textWeight: Typography.b3.weight - color: DefaultStyle.main1_100 - textColor: DefaultStyle.main1_500_main leftPadding: 12 * DefaultStyle.dp rightPadding: 12 * DefaultStyle.dp topPadding: 6 * DefaultStyle.dp