summaryrefslogtreecommitdiffstats
path: root/CodeSection.qml
blob: e1da4b3e45ed4d11b672133f7d099ff6b72edbbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import QtQuick 2.0

Rectangle
{
    id: root

    property string text
    property real fontSize: parent.baseFontSize / 2

    gradient: Gradient {
        GradientStop { position: 0; color: Qt.rgba(1, 1, 1, 0.3) }
        GradientStop { position: 1; color: Qt.rgba(0, 0, 0, 0.3) }
    }

    border.color: "lightsteelblue"
    border.width: 2
    radius: 10

    x: parent.width / 2
    width: parent.width / 2
    height: parent.height

    Item {
        anchors.fill: parent
        anchors.margins: 20
        clip: true

        Text {
            id: textItem
            anchors.fill: parent
            text: root.text;
            font.family: "courier"
            font.pixelSize: root.fontSize
            color: "white"
        }
    }
}