From 72da3cdf636a5344160615933367ec39e7974177 Mon Sep 17 00:00:00 2001 From: Noelia Date: Mon, 6 Mar 2023 13:20:28 +0100 Subject: [PATCH] feat(SQ/StatusImageSelector): Added new properties `preview` and `file` properties added. --- .../StatusQ/Controls/StatusImageSelector.qml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Controls/StatusImageSelector.qml b/ui/StatusQ/src/StatusQ/Controls/StatusImageSelector.qml index 8fd248085f..53d96316b0 100644 --- a/ui/StatusQ/src/StatusQ/Controls/StatusImageSelector.qml +++ b/ui/StatusQ/src/StatusQ/Controls/StatusImageSelector.qml @@ -58,17 +58,29 @@ Control { property var acceptedImageExtensions: [".png", ".jpg", ".jpeg", ".heif", ".tif", ".tiff"] /*! - \qmlproperty var StatusImageSelector::headerHeight. + \qmlproperty bool StatusImageSelector::preview. + This property holds if the component's behavior is just preview (true) the image or load (false). + */ + property bool preview: false + + /*! + \qmlproperty int StatusImageSelector::headerHeight. This property holds the header height value including label heigh + spacing between label and image rectangle. */ readonly property int headerHeight: label.implicitHeight + rootImageSelector.spacing /*! - \qmlproperty var StatusImageSelector::buttonsInsideOffset. + \qmlproperty int StatusImageSelector::buttonsInsideOffset. This property holds the plus button inside offset value. */ readonly property int buttonsInsideOffset: 10 + /*! + \qmlproperty alias StatusImageSelector::file. + This property holds the image file source. + */ + property alias file: image.source + /*! \qmlsignal StatusImageSelector::fileSelected(url file) This signal is emitted when a new file is selected. @@ -140,6 +152,7 @@ Control { id: dropArea anchors.fill: parent + enabled: !root.preview onDropped: d.loadFile(drop.urls) } @@ -147,6 +160,7 @@ Control { id: addButton z: 1 + visible: !preview icon.name: "add" type: StatusRoundButton.Type.Secondary anchors {