Download images when clicking on them

This commit is contained in:
2026-05-24 13:53:30 +02:00
parent 7d75e010c7
commit fc721ba817
9 changed files with 118 additions and 35 deletions

View File

@@ -17,7 +17,8 @@ component ImagePreview inherits Rectangle {
touch := TouchArea {
clicked => {
Global.previewed-image = root.preview;
Global.viewed-image = root.preview;
Global.view-image(root.preview.asset-id);
}
}
}
@@ -75,26 +76,26 @@ component TimelineBlock inherits VerticalLayout {
}
export component Timeline inherits ScrollView {
mouse-drag-pan-enabled: true;
viewport-height: rect.height;
mouse-drag-pan-enabled: true;
viewport-height: rect.height;
changed viewport-y => {
Global.timeline-scrolled(-self.viewport-y);
}
rect := Rectangle {
y: 0;
x: 0;
changed viewport-y => {
Global.timeline-scrolled(-self.viewport-y);
}
rect := Rectangle {
y: 0;
x: 0;
width: root.width;
height: Global.timeline-height;
preferred-width: self.width;
preferred-height: self.height;
for bucket[i] in Global.image-buckets : Rectangle {
if bucket.visibility == Visibility.InView : TimelineBlock {
width: root.width;
height: Global.timeline-height;
preferred-width: self.width;
preferred-height: self.height;
for bucket[i] in Global.image-buckets : Rectangle {
if bucket.visibility == Visibility.InView : TimelineBlock {
width: root.width;
index: i;
bucket: bucket;
}
}
index: i;
bucket: bucket;
}
}
}
}