Implement TDLibPhoto qml element
This commit is contained in:
parent
290114f3f2
commit
b61bf2a46b
2 changed files with 12 additions and 18 deletions
|
@ -62,6 +62,8 @@ DISTFILES += qml/harbour-fernschreiber.qml \
|
||||||
qml/components/StickerPicker.qml \
|
qml/components/StickerPicker.qml \
|
||||||
qml/components/PhotoTextsListItem.qml \
|
qml/components/PhotoTextsListItem.qml \
|
||||||
qml/components/TDLibImage.qml \
|
qml/components/TDLibImage.qml \
|
||||||
|
qml/components/TDLibMinithumbnail.qml \
|
||||||
|
qml/components/TDLibPhoto.qml \
|
||||||
qml/components/TDLibThumbnail.qml \
|
qml/components/TDLibThumbnail.qml \
|
||||||
qml/components/VoiceNoteOverlay.qml \
|
qml/components/VoiceNoteOverlay.qml \
|
||||||
qml/components/chatInformationPage/ChatInformationEditArea.qml \
|
qml/components/chatInformationPage/ChatInformationEditArea.qml \
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
import QtQuick 2.6
|
import QtQuick 2.6
|
||||||
import WerkWolf.Fernschreiber 1.0
|
import WerkWolf.Fernschreiber 1.0
|
||||||
import Sailfish.Silica 1.0
|
import Sailfish.Silica 1.0
|
||||||
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: tdLibPhoto
|
id: tdLibPhoto
|
||||||
|
@ -31,6 +32,7 @@ Item {
|
||||||
onPhotoChanged: setImageFile()
|
onPhotoChanged: setImageFile()
|
||||||
|
|
||||||
function setImageFile() {
|
function setImageFile() {
|
||||||
|
console.log("TDLibPhoto minithumb?", !!tdLibPhoto.photo.minithumbnail, minithumbnailLoader.active)
|
||||||
if (photo) {
|
if (photo) {
|
||||||
var photoSize;
|
var photoSize;
|
||||||
for (var i = 0; i < photo.sizes.length; i++) {
|
for (var i = 0; i < photo.sizes.length; i++) {
|
||||||
|
@ -45,25 +47,15 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
TDLibMinithumbnail {
|
||||||
anchors.fill: parent
|
id: minithumbnailLoader
|
||||||
active: !!tdLibPhoto.photo.minithumbnail
|
active: !!minithumbnail && tdLibImage.opacity < 1.0
|
||||||
asynchronous: true
|
minithumbnail: tdLibPhoto.photo.minithumbnail
|
||||||
sourceComponent: Component {
|
highlighted: parent.highlighted
|
||||||
Image {
|
}
|
||||||
id: minithumbnail
|
|
||||||
source: "data:image/jpg;base64,"+tdLibPhoto.photo.minithumbnail.data
|
|
||||||
asynchronous: true
|
|
||||||
fillMode: tdLibImage.fillMode
|
|
||||||
smooth: false
|
|
||||||
cache: false
|
|
||||||
|
|
||||||
layer {
|
BackgroundImage {
|
||||||
enabled: tdLibPhoto.highlighted
|
visible: tdLibImage.opacity < 1.0
|
||||||
effect: PressEffect { source: minithumbnail }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TDLibImage {
|
TDLibImage {
|
||||||
|
|
Loading…
Reference in a new issue