diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2020-03-20 15:12:19 +0300 |
---|---|---|
committer | Grigorii Zimin <gzimin@luxoft.com> | 2020-03-30 08:38:23 +0000 |
commit | 51c83757c22f85a762c58bfa0838759bc9805188 (patch) | |
tree | f061987b0b6962edfde16a0cd161503e5682eb38 | |
parent | 7119776b24ff3249c5baad3eecd7ea177ea228cb (diff) |
[phone] show square images if rounded mask is not possible
Fixes: AUTOSUITE-1405
Task-number: AUTOSUITE-1518
Change-Id: I33d04a300106130b8835673d9a22780d1cc27791
Reviewed-by: Aleksei Korkov <akorkov@luxoft.com>
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
9 files changed, 18 insertions, 3 deletions
diff --git a/apps/com.pelagicore.phone/Main.qml b/apps/com.pelagicore.phone/Main.qml index 9e60b504..2fda4a84 100644 --- a/apps/com.pelagicore.phone/Main.qml +++ b/apps/com.pelagicore.phone/Main.qml @@ -88,8 +88,11 @@ ApplicationCCWindow { visible: opacity > 0 anchors.fill: fullscreenTopPartBackground callerHandle: phone.callerHandle + enableOpacityMasks: store.allowOpenGLContent } + PhoneStore { id: store; onRequestRaiseAppReceived: root.riseWindow(); } + PhoneView { id: phone x: root.exposedRect.x @@ -98,6 +101,6 @@ ApplicationCCWindow { height: (root.exposedRect.height + root.exposedRect.y) state: root.neptuneState onActivateApp: root.riseWindow() - store: PhoneStore { onRequestRaiseAppReceived: root.riseWindow(); } + store: store } } diff --git a/apps/com.pelagicore.phone/controls/BlurredImageBackground.qml b/apps/com.pelagicore.phone/controls/BlurredImageBackground.qml index 11afab30..a4b5a3aa 100644 --- a/apps/com.pelagicore.phone/controls/BlurredImageBackground.qml +++ b/apps/com.pelagicore.phone/controls/BlurredImageBackground.qml @@ -39,13 +39,14 @@ Item { id: root property string callerHandle: "" + property bool enableOpacityMasks Image { id: contactImage anchors.fill: parent source: (root.callerHandle !== "") ? "../assets/profile_photos/%1.png".arg(root.callerHandle) : "" fillMode: Image.PreserveAspectCrop - visible: false + visible: !root.enableOpacityMasks } FastBlur { diff --git a/apps/com.pelagicore.phone/controls/RoundImage.qml b/apps/com.pelagicore.phone/controls/RoundImage.qml index 3fc9ae55..f11486a2 100644 --- a/apps/com.pelagicore.phone/controls/RoundImage.qml +++ b/apps/com.pelagicore.phone/controls/RoundImage.qml @@ -41,6 +41,7 @@ ToolButton { implicitWidth: Sizes.dp(img.sourceSize.width) implicitHeight: Sizes.dp(img.sourceSize.height) + property bool enableOpacityMasks property alias source: img.source background: Rectangle { @@ -53,7 +54,7 @@ ToolButton { id: img anchors.fill: mask fillMode: Image.PreserveAspectCrop - layer.enabled: true + layer.enabled: root.enableOpacityMasks layer.effect: OpacityMask { maskSource: mask } diff --git a/apps/com.pelagicore.phone/controls/WidgetContact.qml b/apps/com.pelagicore.phone/controls/WidgetContact.qml index ba21bc9f..9f0a6cf7 100644 --- a/apps/com.pelagicore.phone/controls/WidgetContact.qml +++ b/apps/com.pelagicore.phone/controls/WidgetContact.qml @@ -48,6 +48,7 @@ Control { property alias source: contactImage.source property bool lastItem: false property bool maximized: false + property bool enableOpacityMasks signal callWidgetClicked(var handle) background: Image { @@ -78,6 +79,7 @@ Control { anchors.verticalCenter: parent.verticalCenter opacity: 1 enabled: false + enableOpacityMasks: root.enableOpacityMasks } Column { diff --git a/apps/com.pelagicore.phone/stores/PhoneStore.qml b/apps/com.pelagicore.phone/stores/PhoneStore.qml index 9c3c08e2..da305fe2 100644 --- a/apps/com.pelagicore.phone/stores/PhoneStore.qml +++ b/apps/com.pelagicore.phone/stores/PhoneStore.qml @@ -34,6 +34,7 @@ import QtQuick 2.8 import QtApplicationManager.Application 2.0 import shared.utils 1.0 +import shared.com.pelagicore.systeminfo 1.0 Store { id: root @@ -41,6 +42,8 @@ Store { property bool ongoingCall: false property string callerHandle: "" property alias callDuration: callTimer.duration + readonly property SystemInfo systemInfo: SystemInfo {} + readonly property bool allowOpenGLContent: systemInfo.allowOpenGLContent //! [parking intent handler] readonly property IntentHandler intentHandler: IntentHandler { diff --git a/apps/com.pelagicore.phone/views/CallWidgetView.qml b/apps/com.pelagicore.phone/views/CallWidgetView.qml index a673c648..eeb69b94 100644 --- a/apps/com.pelagicore.phone/views/CallWidgetView.qml +++ b/apps/com.pelagicore.phone/views/CallWidgetView.qml @@ -161,6 +161,7 @@ Item { RoundImage { id: contactImage source: root.callerHandle ? "../assets/profile_photos/%1.png".arg(root.callerHandle) : "" + enableOpacityMasks: store.allowOpenGLContent } ColumnLayout { diff --git a/apps/com.pelagicore.phone/views/ContactsView.qml b/apps/com.pelagicore.phone/views/ContactsView.qml index d78536f5..09a64269 100644 --- a/apps/com.pelagicore.phone/views/ContactsView.qml +++ b/apps/com.pelagicore.phone/views/ContactsView.qml @@ -65,6 +65,7 @@ ListView { Layout.preferredHeight: Sizes.dp(64) Layout.preferredWidth: Sizes.dp(64) source: "../assets/profile_photos/%1.png".arg(model.handle) + enableOpacityMasks: store.allowOpenGLContent leftPadding: Sizes.dp(16) rightPadding: Sizes.dp(16) } diff --git a/apps/com.pelagicore.phone/views/FavoritesWidgetView.qml b/apps/com.pelagicore.phone/views/FavoritesWidgetView.qml index e9dd18d8..d4ab3ee4 100644 --- a/apps/com.pelagicore.phone/views/FavoritesWidgetView.qml +++ b/apps/com.pelagicore.phone/views/FavoritesWidgetView.qml @@ -125,6 +125,7 @@ Item { lastItem: (index === (favorites1Row.model.count - 1)) maximized: (root.state === "Maximized") onCallWidgetClicked: { root.store.startCall(handle); } + enableOpacityMasks: store.allowOpenGLContent } PageIndicator { anchors.verticalCenter: parent.bottom @@ -189,6 +190,7 @@ Item { Layout.preferredWidth: Sizes.dp(64) Layout.alignment: Qt.AlignVCenter source: "../assets/profile_photos/%1.png".arg(model.handle) + enableOpacityMasks: store.allowOpenGLContent } Label { objectName: "shortCallName" diff --git a/apps/com.pelagicore.phone/views/RecentCallsView.qml b/apps/com.pelagicore.phone/views/RecentCallsView.qml index dad9dfe1..72554627 100644 --- a/apps/com.pelagicore.phone/views/RecentCallsView.qml +++ b/apps/com.pelagicore.phone/views/RecentCallsView.qml @@ -75,6 +75,7 @@ ListView { Layout.preferredHeight: Sizes.dp(64) Layout.preferredWidth: Sizes.dp(64) source: "../assets/profile_photos/%1.png".arg(model.peerHandle) + enableOpacityMasks: store.allowOpenGLContent leftPadding: Sizes.dp(16) rightPadding: Sizes.dp(16) } |