opaque/Label.qml

26 lines
803 B
QML
Raw Permalink Normal View History

2020-05-19 19:49:52 +00:00
import QtGraphicalEffects 1.0
import QtQuick 2.7
import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
import QtQuick.Window 2.11
2020-05-20 02:26:58 +00:00
import "theme"
import "fonts"
2020-05-19 19:49:52 +00:00
2020-12-15 01:16:49 +00:00
// Defaults to normal size text. doesn't do its own padding!
// Setting header:true switches to header sized and bolded text
2020-05-19 19:49:52 +00:00
Label {
2020-12-15 01:16:49 +00:00
font.pointSize: size
wrapMode: multiline ? Text.WordWrap : Text.NoWrap
elide: Text.ElideRight
2020-05-20 02:26:58 +00:00
color: Theme.mainTextColor
2020-05-19 19:49:52 +00:00
textFormat: Text.PlainText
2020-12-15 01:16:49 +00:00
property bool header: false
property real size: header ? Theme.textHeaderPt : Theme.textMediumPt
property bool bold: header
property bool multiline: true
font.family: bold ? Fonts.applicationFontRegular.name : Fonts.applicationFontBold.name
font.styleName: bold ? "Bold" : ""
2020-05-19 19:49:52 +00:00
}