UTPassMirror/qml/styles/CustomBorder.qml

33 lines
886 B
QML
Raw Permalink Normal View History

2019-03-13 18:38:12 +00:00
// Author : Amit Tomar
// @ https://stackoverflow.com/questions/16534489/qml-control-border-width-and-color-on-any-one-side-of-rectangle-element#16562823
import QtQuick 2.4
Rectangle {
property bool commonBorder: true
2019-03-13 18:38:12 +00:00
property int lBorderwidth: 1
property int rBorderwidth: 1
property int tBorderwidth: 1
property int bBorderwidth: 1
2019-03-13 18:38:12 +00:00
property int commonBorderWidth: 1
2019-03-13 18:38:12 +00:00
z: -1
2019-03-13 18:38:12 +00:00
property string borderColor: "white"
2019-03-13 18:38:12 +00:00
color: borderColor
anchors {
2019-03-13 18:38:12 +00:00
left: parent.left
right: parent.right
top: parent.top
bottom: parent.bottom
topMargin: commonBorder ? -commonBorderWidth : -tBorderwidth
bottomMargin: commonBorder ? -commonBorderWidth : -bBorderwidth
leftMargin: commonBorder ? -commonBorderWidth : -lBorderwidth
rightMargin: commonBorder ? -commonBorderWidth : -rBorderwidth
2019-03-13 18:38:12 +00:00
}
}