perty int arrowOffset: 18

    property int marginLeft: border + 8
    property int marginTop: border + arrowHeight + 6
    property int marginRight: border + 8
    property int marginBottom: border + 6

    Column {
        id: messageColumn

        x: bubble.marginLeft
        y: bubble.marginTop
        z: 1

        spacing: 5

        Text {
            id: message
            width: bubble.maxWidth

            wrapMode: Text.WordWrap
            elide: Text.ElideNone
            clip: true

            font.pointSize: subMessage.font.pointSize + 4

            text: bubble.mainText
        }

        Text {
            id: subMessage
            width: bubble.maxWidth

            wrapMode: Text.WordWrap
            elide: Text.ElideNone
            clip: true

            text: bubble.subText
        }
    }

    Canvas {
        id: bubbleCanvas

        property int textWidth: Math.min(bubble.maxWidth, Math.max(message.paintedWidth, subMessage.paintedWidth))
        property int textHeight: message.paintedHeight + (subMessage.paintedWidth > 0 ? (messageColumn.spacing + subMessage.paintedHeight) : 0)

        width: textWidth + bubble.marginLeft + bubble.marginRight
        height: textHeight + bubble.marginTop + bubble.marginBottom

        property int cornerRadius: 7

        property int messageBoxLeft: 0
        property int messageBoxTop: bubble.arrowHeight
        property int messageBoxRight: width - border
        property int messageBoxBottom: height - border

        onPaint: {
            var ctx = getContext("2d")

            ctx.lineWidth = bubble.border
            ctx.strokeStyle = "#555"
            ctx.fillStyle = "#ffffe1"

            ctx.beginPath()

            ctx.moveTo(messageBoxLeft + cornerRadius, messageBoxTop)

            // Arrow
            ctx.lineTo(messageBoxLeft + bubble.arrowOffset, messageBoxTop)
            ctx.lineTo(messageBoxLeft + bubble.arrowOffset, messageBoxTop - bubble.arrowHeight)
    