feat(StatusBanner): Added component documentation (#628)
Added component documentation. Part of #620
This commit is contained in:
parent
a4eaba3de4
commit
64bb0c35a0
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue