feat(SQ/StatusImageSelector): Added new properties

`preview` and  `file` properties added.
This commit is contained in:
Noelia 2023-03-06 13:20:28 +01:00 committed by Noelia
parent 736f315c49
commit 72da3cdf63
1 changed files with 16 additions and 2 deletions

View File

@ -58,17 +58,29 @@ Control {
property var acceptedImageExtensions: [".png", ".jpg", ".jpeg", ".heif", ".tif", ".tiff"] 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. This property holds the header height value including label heigh + spacing between label and image rectangle.
*/ */
readonly property int headerHeight: label.implicitHeight + rootImageSelector.spacing 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. This property holds the plus button inside offset value.
*/ */
readonly property int buttonsInsideOffset: 10 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) \qmlsignal StatusImageSelector::fileSelected(url file)
This signal is emitted when a new file is selected. This signal is emitted when a new file is selected.
@ -140,6 +152,7 @@ Control {
id: dropArea id: dropArea
anchors.fill: parent anchors.fill: parent
enabled: !root.preview
onDropped: d.loadFile(drop.urls) onDropped: d.loadFile(drop.urls)
} }
@ -147,6 +160,7 @@ Control {
id: addButton id: addButton
z: 1 z: 1
visible: !preview
icon.name: "add" icon.name: "add"
type: StatusRoundButton.Type.Secondary type: StatusRoundButton.Type.Secondary
anchors { anchors {