This repository has been archived on 2024-06-03. You can view files and clone it, but cannot push or open issues or pull requests.
app/qml/components/SmoothItemDelegate.qml
dorian c990791306 - removed redundant files
- improved the look of switches in dark mode
- added 'What is this for?' button to the BaseStation settings
2019-09-22 16:07:41 +02:00

61 lines
1.2 KiB
QML

import QtQuick 2.0
import QtQuick.Controls 2.2
ItemDelegate {
id: control
text: ""
property color textColor: appTheme.style.textColor
property alias backgroundRect: backgroundRect
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.style.textColor
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 ? appTheme.style.delegatePressedColor : appTheme.style.delegateBackgroundColor
radius: height * 0.3
Behavior on color {
ColorAnimation {
duration: 200
}
}
}
Behavior on opacity {
NumberAnimation {
duration: 200
}
}
}