mirror of https://github.com/KDE/kasts.git
Put fullscreen image viewer in Loader
This commit is contained in:
parent
58b519c939
commit
72646f5075
|
@ -56,11 +56,13 @@ FocusScope {
|
|||
}
|
||||
|
||||
function openFullScreenImage() {
|
||||
const dialog = fullScreenImage.createObject(parent, {
|
||||
fullScreenImageLoader.setSource("qrc:/FullScreenImage.qml", {
|
||||
"image": headerMetaData.image,
|
||||
"description": headerMetaData.title
|
||||
"description": headerMetaData.title,
|
||||
"loader": fullScreenImageLoader
|
||||
});
|
||||
dialog.open();
|
||||
fullScreenImageLoader.active = true;
|
||||
fullScreenImageLoader.item.open();
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
|
@ -15,6 +15,7 @@ Controls.Popup {
|
|||
id: root
|
||||
|
||||
required property var image
|
||||
required property QtObject loader
|
||||
property string description: undefined
|
||||
|
||||
property int imageWidth: -1
|
||||
|
@ -201,5 +202,6 @@ Controls.Popup {
|
|||
onClosed: {
|
||||
imageItem.scaleFactor = 1;
|
||||
imageItem.rotationAngle = 0;
|
||||
loader.active = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,11 +74,13 @@ Item {
|
|||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
const dialog = fullScreenImage.createObject(parent, {
|
||||
fullScreenImageLoader.setSource("qrc:/FullScreenImage.qml", {
|
||||
"image": root.image,
|
||||
"description": root.title
|
||||
"description": root.title,
|
||||
"loader": fullScreenImageLoader
|
||||
});
|
||||
dialog.open();
|
||||
fullScreenImageLoader.active = true;
|
||||
fullScreenImageLoader.item.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -478,9 +478,10 @@ Kirigami.ApplicationWindow {
|
|||
id: syncPasswordOverlay
|
||||
}
|
||||
|
||||
Component {
|
||||
id: fullScreenImage
|
||||
FullScreenImage { }
|
||||
Loader {
|
||||
id: fullScreenImageLoader
|
||||
active: false
|
||||
visible: active
|
||||
}
|
||||
|
||||
//Global Shortcuts
|
||||
|
|
Loading…
Reference in New Issue