50 lines
1.5 KiB
QML
50 lines
1.5 KiB
QML
import QtQuick
|
|
import QtQuick.Controls.impl
|
|
import QtQuick.Controls
|
|
import QtQuick.Templates as T
|
|
|
|
T.ToolButton {
|
|
id: control
|
|
|
|
checkable: true
|
|
icon.color: Colors.foreground
|
|
icon.height: 36
|
|
icon.width: 36
|
|
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding)
|
|
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding)
|
|
topPadding: 20
|
|
|
|
background: Rectangle {
|
|
id: mainrect
|
|
|
|
border.color: control.palette.highlight
|
|
border.width: control.visualFocus ? 2 : 0
|
|
color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button, control.palette.mid, control.down ? 0.5 : 0.0)
|
|
implicitHeight: control.height
|
|
implicitWidth: control.width
|
|
visible: !control.flat || control.down || control.checked || control.highlighted
|
|
x: control.left
|
|
y: control.top
|
|
|
|
Rectangle {
|
|
color: "yellow"
|
|
implicitHeight: control.height
|
|
implicitWidth: 6
|
|
x: mainrect.left
|
|
y: mainrect.top
|
|
}
|
|
}
|
|
contentItem: Column {
|
|
IconLabel {
|
|
icon: control.icon
|
|
x: parent.width * .5 - width * .5
|
|
}
|
|
Label {
|
|
color: Colors.foreground
|
|
font: Typography.dash
|
|
text: control.text
|
|
x: parent.width * .5 - width * .5
|
|
}
|
|
}
|
|
}
|