QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VideoStatusLabel.qml
Go to the documentation of this file.
1import QtQuick
2
3import QGroundControl
4import QGroundControl.Controls
5
6// A bold status line over a video view, on a translucent backing.
7Rectangle {
8 id: root
9
10 property alias text: label.text
11 /// Small text, for a picture-in-picture view.
12 property bool useSmallFont: true
13 /// The widest the line gets, for a view narrower than its text, which then wraps.
14 property real maximumWidth: Number.POSITIVE_INFINITY
15
16 width: label.width + ScreenTools.defaultFontPixelHeight
17 height: label.contentHeight + ScreenTools.defaultFontPixelHeight
18 radius: ScreenTools.defaultFontPixelWidth / 2
19 color: Qt.rgba(0, 0, 0, 0.5)
20
21 QGCLabel {
22 id: label
23 anchors.centerIn: parent
24 width: Math.min(implicitWidth,
25 Math.max(0, root.maximumWidth - ScreenTools.defaultFontPixelHeight))
26 font.bold: true
27 color: "white"
28 font.pointSize: root.useSmallFont ? ScreenTools.smallFontPointSize : ScreenTools.largeFontPointSize
29 horizontalAlignment: Text.AlignHCenter
30 wrapMode: Text.Wrap
31 }
32}