/*!
 *
 * Copyright (c) 2021-2023 Diality Inc. - All Rights Reserved.
 * \copyright
 * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN
 * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
 *
 * \file    ImageText.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      11-Apr-2021
 * \author  (original)  Behrouz NematiPour
 * \date    (original)  09-Feb-2021
 *
 */

// Qt
import QtQuick 2.12

//  Qml imports
import "qrc:/globals"

/*!
 * \brief   an image with text under it.
 * \details it has been mainly created for the rinseback screen
 */

Image { id: _root
    property int    diameter    : 100
    property string text        : ""
    property int    fontSize    : 26

    signal clicked

    width   : _root.diameter
    height  : _root.diameter
    source  : _root.image
    Text { id: _label
        anchors {
            top: parent.bottom
            topMargin: 15
            horizontalCenter: parent.horizontalCenter
        }
        color   : _root.enabled ? Colors.textButton : Colors.textDisableButton
        text    : _root.text
        font.pixelSize: _root.fontSize
    }

    MouseArea {
        anchors.fill: _root
        onClicked: _root.clicked()
    }
}
