From 6065b6c1d64e6e141ff56db09003859bf94338eb Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 16 Jul 2020 17:29:49 -0400 Subject: [PATCH] confirm upload popups: limit size of loaded images --- src/gui/Popups/ConfirmClipboardUploadPopup.qml | 1 + src/gui/Popups/ConfirmUploadPopup.qml | 1 + src/gui/Popups/HColumnPopup.qml | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/Popups/ConfirmClipboardUploadPopup.qml b/src/gui/Popups/ConfirmClipboardUploadPopup.qml index 66373aa0..81f03b2f 100644 --- a/src/gui/Popups/ConfirmClipboardUploadPopup.qml +++ b/src/gui/Popups/ConfirmClipboardUploadPopup.qml @@ -53,6 +53,7 @@ HColumnPopup { source: "image://clipboard/" + updateCounter fillMode: Image.PreserveAspectFit + sourceSize.width: popup.contentWidthLimit Layout.fillWidth: true Layout.fillHeight: true diff --git a/src/gui/Popups/ConfirmUploadPopup.qml b/src/gui/Popups/ConfirmUploadPopup.qml index b75e4958..11337ae8 100644 --- a/src/gui/Popups/ConfirmUploadPopup.qml +++ b/src/gui/Popups/ConfirmUploadPopup.qml @@ -49,6 +49,7 @@ HColumnPopup { source: popup.filePath fillMode: Image.PreserveAspectFit visible: status !== Image.Error + sourceSize.width: popup.contentWidthLimit Layout.fillWidth: true Layout.fillHeight: true diff --git a/src/gui/Popups/HColumnPopup.qml b/src/gui/Popups/HColumnPopup.qml index ddfd4f45..63ca0b9c 100644 --- a/src/gui/Popups/HColumnPopup.qml +++ b/src/gui/Popups/HColumnPopup.qml @@ -8,6 +8,8 @@ HPopup { default property alias pageData: page.columnData + property int contentWidthLimit: theme.controls.popup.defaultWidth + readonly property alias page: page signal keyboardAccept() @@ -16,8 +18,7 @@ HPopup { HColumnPage { id: page implicitWidth: Math.min( - popup.maximumPreferredWidth, - theme.controls.popup.defaultWidth, + popup.maximumPreferredWidth, popup.contentWidthLimit, ) implicitHeight: Math.min( popup.maximumPreferredHeight,