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() {
|
function openFullScreenImage() {
|
||||||
const dialog = fullScreenImage.createObject(parent, {
|
fullScreenImageLoader.setSource("qrc:/FullScreenImage.qml", {
|
||||||
"image": headerMetaData.image,
|
"image": headerMetaData.image,
|
||||||
"description": headerMetaData.title
|
"description": headerMetaData.title,
|
||||||
|
"loader": fullScreenImageLoader
|
||||||
});
|
});
|
||||||
dialog.open();
|
fullScreenImageLoader.active = true;
|
||||||
|
fullScreenImageLoader.item.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
@ -15,6 +15,7 @@ Controls.Popup {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property var image
|
required property var image
|
||||||
|
required property QtObject loader
|
||||||
property string description: undefined
|
property string description: undefined
|
||||||
|
|
||||||
property int imageWidth: -1
|
property int imageWidth: -1
|
||||||
|
@ -201,5 +202,6 @@ Controls.Popup {
|
||||||
onClosed: {
|
onClosed: {
|
||||||
imageItem.scaleFactor = 1;
|
imageItem.scaleFactor = 1;
|
||||||
imageItem.rotationAngle = 0;
|
imageItem.rotationAngle = 0;
|
||||||
|
loader.active = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,11 +74,13 @@ Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const dialog = fullScreenImage.createObject(parent, {
|
fullScreenImageLoader.setSource("qrc:/FullScreenImage.qml", {
|
||||||
"image": root.image,
|
"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
|
id: syncPasswordOverlay
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Loader {
|
||||||
id: fullScreenImage
|
id: fullScreenImageLoader
|
||||||
FullScreenImage { }
|
active: false
|
||||||
|
visible: active
|
||||||
}
|
}
|
||||||
|
|
||||||
//Global Shortcuts
|
//Global Shortcuts
|
||||||
|
|
Loading…
Reference in New Issue