fix: use ModalPopup instead

This commit is contained in:
hydrogen 2020-12-04 18:01:38 +02:00 committed by Iuri Matias
parent 323ba10a0e
commit 2f0aab055a
3 changed files with 4 additions and 64 deletions

View File

@ -125,13 +125,14 @@ ModalPopup {
} }
} }
QrPopup { ModalPopup {
id: qrCodePopup id: qrCodePopup
width: 320
height: 320
Image { Image {
asynchronous: true asynchronous: true
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: profileModel.qrCode(fromAuthor) source: profileModel.qrCode(fromAuthor)
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
height: 212 height: 212
width: 212 width: 212

View File

@ -103,6 +103,7 @@ Popup {
Separator { Separator {
id: separator id: separator
anchors.top: headerContent.bottom anchors.top: headerContent.bottom
visible: title.length > 0
} }
Item { Item {

View File

@ -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()
}
}
}
}