moment/src/qml/Base/HNoticePage.qml

38 lines
1.1 KiB
QML
Raw Normal View History

2019-07-08 13:52:41 +10:00
// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
import QtQuick.Layouts 1.12
import "../Base"
2019-04-29 01:01:38 +10:00
HRowLayout {
property alias label: noticeLabel
2019-04-29 01:01:38 +10:00
property alias text: noticeLabel.text
property alias color: noticeLabel.color
property alias font: noticeLabel.font
property alias backgroundColor: noticeLabelBackground.color
property alias radius: noticeLabelBackground.radius
HLabel {
2019-04-29 01:01:38 +10:00
id: noticeLabel
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
2019-07-16 19:29:47 +10:00
padding: theme.spacing / 2
leftPadding: theme.spacing
rightPadding: leftPadding
2019-04-29 01:01:38 +10:00
2019-07-16 19:29:47 +10:00
Layout.margins: theme.spacing
2019-04-29 01:01:38 +10:00
Layout.alignment: Qt.AlignCenter
Layout.maximumWidth:
parent.width - Layout.leftMargin - Layout.rightMargin
opacity: width > Layout.leftMargin + Layout.rightMargin ? 1 : 0
2019-04-29 01:01:38 +10:00
background: Rectangle {
id: noticeLabelBackground
color: theme.box.background
radius: theme.box.radius
2019-04-29 01:01:38 +10:00
}
}
}