monero-gui/components/WarningBox.qml

63 lines
1.7 KiB
QML
Raw Normal View History

2019-04-11 01:17:29 +00:00
import QtQuick 2.9
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
import "." as MoneroComponents
Rectangle {
id: root
property alias text: content.text
property alias textColor: content.color
2019-04-25 19:09:23 +00:00
property int fontSize: 15
Layout.fillWidth: true
Layout.preferredHeight: warningLayout.height
2019-04-11 01:17:29 +00:00
color: MoneroComponents.Style.titleBarButtonHoverColor
radius: 4
border.color: MoneroComponents.Style.inputBorderColorInActive
border.width: 1
signal linkActivated;
RowLayout {
id: warningLayout
spacing: 0
anchors.left: parent.left
anchors.right: parent.right
Image {
Layout.alignment: Qt.AlignVCenter
2019-04-25 19:09:23 +00:00
Layout.preferredHeight: 33
Layout.preferredWidth: 33
Layout.rightMargin: 12
Layout.leftMargin: 18
Layout.topMargin: 12
Layout.bottomMargin: 12
2019-04-11 01:17:29 +00:00
source: "qrc:///images/warning.png"
}
Text {
id: content
Layout.fillWidth: true
color: MoneroComponents.Style.defaultFontColor
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: root.fontSize
horizontalAlignment: TextInput.AlignLeft
textFormat: Text.RichText
wrapMode: Text.WordWrap
2019-04-25 19:09:23 +00:00
leftPadding: 4
rightPadding: 18
topPadding: 10
bottomPadding: 10
onLinkActivated: root.linkActivated();
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
}
}