diff --git a/doc/src/images/status_banner.png b/doc/src/images/status_banner.png new file mode 100644 index 00000000..d2dd1194 Binary files /dev/null and b/doc/src/images/status_banner.png differ diff --git a/src/StatusQ/Controls/StatusBanner.qml b/src/StatusQ/Controls/StatusBanner.qml index 8c1f7914..169e927d 100644 --- a/src/StatusQ/Controls/StatusBanner.qml +++ b/src/StatusQ/Controls/StatusBanner.qml @@ -3,13 +3,61 @@ import QtQuick 2.14 import StatusQ.Core 0.1 import StatusQ.Core.Theme 0.1 +/*! + \qmltype StatusBanner + \inherits Column + \inqmlmodule StatusQ.Controls + \since StatusQ.Controls 0.1 + \brief It displays a banner with a custom text, size and type. Inherits \l{https://doc.qt.io/qt-5/qml-qtquick-column.html}{Column}. + + The \c StatusBanner displays a banner with a custom text, size and type (Info, Danger, Success or Warning). + + Example of how the control looks like: + \image status_banner.png + + Example of how to use it: + + \qml + StatusBanner { + width: parent.width + visible: popup.userIsBlocked + type: StatusBanner.Type.Danger + statusText: qsTr("Blocked") + } + \endqml + + For a list of components available see StatusQ. +*/ Column { id: statusBanner - width: parent.width + /*! + \qmlproperty string StatusBanner::statusText + This property holds the text the banner will display. + */ property string statusText + /*! + \qmlproperty string StatusBanner::type + This property holds type of banner. Possible values are: + \qml + enum Type { + Info, // 0 + Danger, // 1 + Success, // 2 + Warning // 3 + } + \endqml + */ property int type: StatusBanner.Type.Info + /*! + \qmlproperty string StatusBanner::textPixels + This property holds the pixels size of the text inside the banner. + */ property int textPixels: 15 + /*! + \qmlproperty string StatusBanner::statusBannerHeight + This property holds the height of the banner rectangle. + */ property int statusBannerHeight: 38 // "private" properties @@ -27,6 +75,8 @@ Column { Warning // 3 } + width: parent.width + // Component definition Rectangle { id: topDiv