62 lines
1.3 KiB
QML
62 lines
1.3 KiB
QML
import QtQuick 2.0
|
|
import QtQuick.Controls 2.2
|
|
|
|
ItemDelegate {
|
|
id: control
|
|
text: ""
|
|
property color textColor: appTheme.theme.colors.text
|
|
property alias backgroundRect: backgroundRect
|
|
property color color: appTheme.theme.colors.delegateBackground
|
|
|
|
font.pixelSize: height * 0.4
|
|
|
|
opacity: enabled ? 1 : 0.2
|
|
|
|
contentItem: Text {
|
|
visible: false
|
|
}
|
|
|
|
Text {
|
|
|
|
anchors {
|
|
verticalCenter: parent.verticalCenter
|
|
left: parent.left
|
|
leftMargin: control.width * 0.02
|
|
right: parent.right
|
|
rightMargin: control.rightPadding
|
|
}
|
|
|
|
text: control.text
|
|
color: appTheme.theme.colors.text
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
horizontalAlignment: Text.AlignLeft
|
|
|
|
fontSizeMode: Text.Fit
|
|
|
|
font.pixelSize: control.font.pixelSize
|
|
|
|
minimumPixelSize: 1
|
|
}
|
|
|
|
width: parent.width
|
|
|
|
background: Rectangle {
|
|
id: backgroundRect
|
|
color: control.down ? Qt.darker(control.color, 1.3) : control.color
|
|
|
|
radius: height * 0.3
|
|
|
|
Behavior on color {
|
|
ColorAnimation {
|
|
duration: 200
|
|
}
|
|
}
|
|
}
|
|
|
|
Behavior on opacity {
|
|
NumberAnimation {
|
|
duration: 200
|
|
}
|
|
}
|
|
}
|