mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Add minimum scale in image viewer
This commit is contained in:
parent
f14f978c48
commit
6d4ff70b48
2 changed files with 33 additions and 2 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window 2.15
|
||||||
|
import Qt.labs.animation 1.0
|
||||||
|
|
||||||
import ".."
|
import ".."
|
||||||
|
|
||||||
|
@ -55,14 +56,46 @@ Window {
|
||||||
eventId: imageOverlay.eventId
|
eventId: imageOverlay.eventId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BoundaryRule on scale {
|
||||||
|
enabled: img.loaded
|
||||||
|
id: sbr
|
||||||
|
minimum: 0.1
|
||||||
|
maximum: 100
|
||||||
|
minimumOvershoot: 0.02; maximumOvershoot: 100
|
||||||
|
}
|
||||||
|
|
||||||
|
//BoundaryRule on x {
|
||||||
|
// enabled: img.loaded
|
||||||
|
// id: xbr
|
||||||
|
// minimum: -100
|
||||||
|
// maximum: imageOverlay.width - img.width + 100
|
||||||
|
// minimumOvershoot: 100; maximumOvershoot: 100
|
||||||
|
// overshootFilter: BoundaryRule.Peak
|
||||||
|
//}
|
||||||
|
|
||||||
|
//BoundaryRule on y {
|
||||||
|
// enabled: img.loaded
|
||||||
|
// id: ybr
|
||||||
|
// minimum: -100
|
||||||
|
// maximum: imageOverlay.height - img.height + 100
|
||||||
|
// minimumOvershoot: 100; maximumOvershoot: 100
|
||||||
|
// overshootFilter: BoundaryRule.Peak
|
||||||
|
//}
|
||||||
|
|
||||||
PinchHandler {
|
PinchHandler {
|
||||||
|
onActiveChanged: if (!active) sbr.returnToBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
WheelHandler {
|
WheelHandler {
|
||||||
property: "scale"
|
property: "scale"
|
||||||
|
onActiveChanged: if (!active) sbr.returnToBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
DragHandler {
|
DragHandler {
|
||||||
|
//onActiveChanged: if (!active) {
|
||||||
|
// xbr.returnToBounds();
|
||||||
|
// ybr.returnToBounds();
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
|
|
|
@ -20,12 +20,10 @@
|
||||||
void
|
void
|
||||||
MxcAnimatedImage::startDownload()
|
MxcAnimatedImage::startDownload()
|
||||||
{
|
{
|
||||||
nhlog::ui()->debug("START DOWNLOAD!!!");
|
|
||||||
if (!room_)
|
if (!room_)
|
||||||
return;
|
return;
|
||||||
if (eventId_.isEmpty())
|
if (eventId_.isEmpty())
|
||||||
return;
|
return;
|
||||||
nhlog::ui()->debug("START DOWNLOAD2!!!");
|
|
||||||
|
|
||||||
auto event = room_->eventById(eventId_);
|
auto event = room_->eventById(eventId_);
|
||||||
if (!event) {
|
if (!event) {
|
||||||
|
|
Loading…
Reference in a new issue