2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import QtGraphicalEffects 1.15
|
2022-05-04 09:25:01 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
|
|
|
/*!
|
2024-10-08 20:22:22 +00:00
|
|
|
/brief Image icon and upload text hints for banner and logo
|
2022-05-04 09:25:01 +00:00
|
|
|
*/
|
2023-05-04 10:01:59 +00:00
|
|
|
Control {
|
2022-05-04 09:25:01 +00:00
|
|
|
id: root
|
|
|
|
|
2023-05-04 10:01:59 +00:00
|
|
|
/*!
|
2023-06-29 21:52:16 +00:00
|
|
|
\qmlproperty alias NoImageUploadedPanel::uploadText.
|
2023-05-04 10:01:59 +00:00
|
|
|
This property holds the main image upload text value.
|
|
|
|
*/
|
|
|
|
property alias uploadText: uploadText.text
|
2022-05-04 09:25:01 +00:00
|
|
|
|
2023-05-04 10:01:59 +00:00
|
|
|
/*!
|
2023-06-29 21:52:16 +00:00
|
|
|
\qmlproperty alias NoImageUploadedPanel::additionalText.
|
2023-05-04 10:01:59 +00:00
|
|
|
This property holds an additional text value.
|
|
|
|
*/
|
|
|
|
property alias additionalText: additionalText.text
|
2022-05-04 09:25:01 +00:00
|
|
|
|
2023-05-04 10:01:59 +00:00
|
|
|
/*!
|
2023-06-29 21:52:16 +00:00
|
|
|
\qmlproperty alias NoImageUploadedPanel::showAdditionalInfo.
|
2023-05-04 10:01:59 +00:00
|
|
|
This property holds if the additional text is shown or not.
|
|
|
|
*/
|
|
|
|
property alias showAdditionalInfo: additionalText.visible
|
|
|
|
|
|
|
|
/*!
|
2023-06-29 21:52:16 +00:00
|
|
|
\qmlproperty alias NoImageUploadedPanel::additionalTextPixelSize.
|
2023-05-04 10:01:59 +00:00
|
|
|
This property holds the additional text font pixel size value.
|
|
|
|
*/
|
|
|
|
property alias additionalTextPixelSize: additionalText.font.pixelSize
|
|
|
|
|
2023-05-16 15:07:21 +00:00
|
|
|
/*!
|
2023-06-29 21:52:16 +00:00
|
|
|
\qmlproperty color NoImageUploadedPanel::uploadTextColor.
|
2023-05-16 15:07:21 +00:00
|
|
|
This property sets the upload text color.
|
|
|
|
*/
|
|
|
|
property color uploadTextColor: Theme.palette.baseColor1
|
|
|
|
|
|
|
|
/*!
|
2023-06-29 21:52:16 +00:00
|
|
|
\qmlproperty color NoImageUploadedPanel::imgColor.
|
2023-05-16 15:07:21 +00:00
|
|
|
This property sets the image color.
|
|
|
|
*/
|
|
|
|
property color imgColor: Theme.palette.baseColor1
|
|
|
|
|
2023-06-29 21:52:16 +00:00
|
|
|
/*!
|
|
|
|
\qmlproperty alias NoImageUploadedPanel::contentSpacing.
|
|
|
|
This property sets the content spacing.
|
|
|
|
*/
|
|
|
|
property alias contentSpacing: content.spacing
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\qmlproperty alias NoImageUploadedPanel::iconWidth.
|
|
|
|
This property sets the content icon width.
|
|
|
|
*/
|
|
|
|
property alias iconWidth: imageImg.width
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\qmlproperty alias NoImageUploadedPanel::iconHeight.
|
|
|
|
This property sets the content icon height.
|
|
|
|
*/
|
|
|
|
property alias iconHeight: imageImg.height
|
|
|
|
|
2023-05-04 10:01:59 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
|
|
|
|
readonly property int imageSelectorPadding: 75
|
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
2023-06-29 21:52:16 +00:00
|
|
|
id: content
|
2022-05-04 13:40:45 +00:00
|
|
|
Image {
|
2022-05-04 09:25:01 +00:00
|
|
|
id: imageImg
|
2024-10-15 19:26:12 +00:00
|
|
|
source: Theme.svg("images_icon")
|
2022-05-04 09:25:01 +00:00
|
|
|
width: 20
|
|
|
|
height: 18
|
2022-05-04 13:40:45 +00:00
|
|
|
sourceSize.width: width || undefined
|
|
|
|
sourceSize.height: height || undefined
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2022-05-04 09:25:01 +00:00
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
2023-05-16 15:07:21 +00:00
|
|
|
layer.enabled: !Qt.colorEqual(root.imgColor, Theme.palette.baseColor1)
|
|
|
|
layer.effect: ColorOverlay {
|
|
|
|
color: root.imgColor
|
|
|
|
}
|
2022-05-04 09:25:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
id: uploadText
|
2023-05-04 10:01:59 +00:00
|
|
|
|
2022-05-04 09:25:01 +00:00
|
|
|
text: qsTr("Upload")
|
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
2023-05-04 10:01:59 +00:00
|
|
|
Layout.preferredWidth: root.width - 2 * d.imageSelectorPadding
|
|
|
|
font.pixelSize: Theme.primaryTextFontSize
|
2023-05-16 15:07:21 +00:00
|
|
|
color: root.uploadTextColor
|
2023-05-04 10:01:59 +00:00
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
lineHeight: 1.2
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2023-06-29 21:52:16 +00:00
|
|
|
verticalAlignment: Text.AlignVCenter
|
2022-05-04 09:25:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
2023-05-04 10:01:59 +00:00
|
|
|
id: additionalText
|
|
|
|
|
2022-05-04 09:25:01 +00:00
|
|
|
text: qsTr("Wide aspect ratio is optimal")
|
|
|
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
2023-05-04 10:01:59 +00:00
|
|
|
visible: false
|
|
|
|
font.pixelSize: Theme.primaryTextFontSize
|
2022-05-04 09:25:01 +00:00
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|