64 lines
1.6 KiB
QML
64 lines
1.6 KiB
QML
import QtQuick 2.12
|
|
import QtQuick.Controls 2.12
|
|
import QtQuick.Layouts 1.12
|
|
import QtGraphicalEffects 1.0
|
|
|
|
import Utils 1.0
|
|
|
|
ItemDelegate {
|
|
id: control
|
|
implicitHeight: 52
|
|
padding: 0
|
|
leftPadding: control.minimized ? 0 : 40
|
|
font.pixelSize: 18
|
|
font.weight: Font.Bold
|
|
icon.color: "transparent"
|
|
icon.width: 24
|
|
icon.height: 24
|
|
|
|
property bool minimized: false
|
|
property bool mirroredIcon: false
|
|
|
|
contentItem: RowLayout {
|
|
spacing: control.minimized ? 0 : 25
|
|
|
|
Item {
|
|
visible: control.minimized
|
|
Layout.fillWidth: true
|
|
}
|
|
|
|
Image {
|
|
source: control.icon.source
|
|
sourceSize.width: control.icon.width
|
|
sourceSize.height: control.icon.height
|
|
mirror: control.mirroredIcon
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
ColorOverlay {
|
|
anchors.fill: parent
|
|
source: parent
|
|
color: icon.color
|
|
visible: icon.color !== "transparent"
|
|
}
|
|
}
|
|
|
|
Label {
|
|
text: control.text
|
|
font: control.font
|
|
color: Palette.alternativeTextColor
|
|
visible: !control.minimized
|
|
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
|
|
}
|
|
|
|
Item {
|
|
Layout.fillWidth: true
|
|
}
|
|
}
|
|
|
|
background: Rectangle {
|
|
color: control.pressed || control.highlighted ?
|
|
Palette.pressedButtonColor : control.hovered ?
|
|
Palette.hoveredButtonColor : Palette.buttonColor
|
|
}
|
|
}
|