BarButton still in progress
This commit is contained in:
87
TeroStyle/BarButton.qml
Normal file
87
TeroStyle/BarButton.qml
Normal file
@@ -0,0 +1,87 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.ToolButton {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
checkable: true
|
||||
icon.color: Colors.foreground
|
||||
icon.height: 36
|
||||
icon.width: 36
|
||||
topPadding: 20
|
||||
// horizontalPadding: padding + 2
|
||||
// spacing: 6
|
||||
// display: AbstractButton.TextUnderIcon
|
||||
|
||||
// icon.color: control.checked || control.highlighted ? control.palette.brightText :
|
||||
// control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText
|
||||
|
||||
contentItem: Column
|
||||
{
|
||||
|
||||
IconLabel
|
||||
{
|
||||
|
||||
|
||||
x: parent.width * .5 - width * .5
|
||||
// height: icon.height
|
||||
// width: icon.width
|
||||
icon: control.icon
|
||||
|
||||
// display: control.display
|
||||
|
||||
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: control.text
|
||||
font: Typography.dash
|
||||
|
||||
color: Colors.foreground
|
||||
x: parent.width * .5 - width * .5
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// spacing: control.spacing
|
||||
// mirrored: control.mirrored
|
||||
// display: control.TextUnderIcon
|
||||
|
||||
// icon: control.icon
|
||||
// text: control.text
|
||||
// font: control.font
|
||||
// color: control.checked || control.highlighted ? control.palette.brightText :
|
||||
// control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText
|
||||
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
id: mainrect
|
||||
implicitWidth: control.width
|
||||
implicitHeight: control.height
|
||||
visible: !control.flat || control.down || control.checked || control.highlighted
|
||||
x: control.left
|
||||
y: control.top
|
||||
color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button,
|
||||
control.palette.mid, control.down ? 0.5 : 0.0)
|
||||
border.color: control.palette.highlight
|
||||
border.width: control.visualFocus ? 2 : 0
|
||||
Rectangle
|
||||
{
|
||||
implicitHeight: control.height
|
||||
implicitWidth: 6
|
||||
x: mainrect.left
|
||||
y: mainrect.top
|
||||
color: "yellow"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user