From 2f0aab055af301ab0f4fa435bef9e9cf05fe12ef Mon Sep 17 00:00:00 2001 From: hydrogen Date: Fri, 4 Dec 2020 18:01:38 +0200 Subject: [PATCH] fix: use ModalPopup instead --- .../Chat/components/ProfilePopup.qml | 5 +- ui/shared/ModalPopup.qml | 1 + ui/shared/QrPopup.qml | 62 ------------------- 3 files changed, 4 insertions(+), 64 deletions(-) delete mode 100644 ui/shared/QrPopup.qml diff --git a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml index 55b2b89d11..9683cb2e65 100644 --- a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml +++ b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml @@ -125,13 +125,14 @@ ModalPopup { } } - QrPopup { + ModalPopup { id: qrCodePopup + width: 320 + height: 320 Image { asynchronous: true fillMode: Image.PreserveAspectFit source: profileModel.qrCode(fromAuthor) - anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter height: 212 width: 212 diff --git a/ui/shared/ModalPopup.qml b/ui/shared/ModalPopup.qml index 75b5018702..44845832cf 100644 --- a/ui/shared/ModalPopup.qml +++ b/ui/shared/ModalPopup.qml @@ -103,6 +103,7 @@ Popup { Separator { id: separator anchors.top: headerContent.bottom + visible: title.length > 0 } Item { diff --git a/ui/shared/QrPopup.qml b/ui/shared/QrPopup.qml deleted file mode 100644 index 8f1377159c..0000000000 --- a/ui/shared/QrPopup.qml +++ /dev/null @@ -1,62 +0,0 @@ -import QtQuick 2.13 -import QtQuick.Controls 2.13 -import QtQuick.Layouts 1.13 -import QtGraphicalEffects 1.13 -import "../imports" - -Popup { - id: qrCodePopup - Overlay.modal: Rectangle { - color: "#60000000" - } - parent: Overlay.overlay - x: Math.round(((parent ? parent.width : 0) - width) / 2) - y: Math.round(((parent ? parent.height : 0) - height) / 2) - width: 320 - height: 320 - modal: true - closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside - background: Rectangle { - color: Style.current.background - radius: 8 - } - Rectangle { - id: closeButton - height: 32 - width: 32 - anchors.top: parent.top - anchors.right: parent.right - property bool hovered: false - color: hovered ? Style.current.backgroundHover : Style.current.transparent - radius: 8 - SVGImage { - id: closeModalImg - source: "./img/close.svg" - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - width: 11 - height: 11 - } - ColorOverlay { - anchors.fill: closeModalImg - source: closeModalImg - color: Style.current.textColor - } - MouseArea { - id: closeModalMouseArea - cursorShape: Qt.PointingHandCursor - anchors.fill: parent - hoverEnabled: true - onExited: { - closeButton.hovered = false - } - onEntered: { - closeButton.hovered = true - } - onClicked: { - qrCodePopup.close() - } - } - } - -}