39 lines
1.2 KiB
QML
39 lines
1.2 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
|
|
Button {
|
|
id: root
|
|
|
|
property var theme
|
|
property bool accent: false
|
|
|
|
implicitHeight: 32
|
|
leftPadding: 11
|
|
rightPadding: 11
|
|
topPadding: 5
|
|
bottomPadding: 5
|
|
|
|
contentItem: Label {
|
|
text: root.text
|
|
color: root.enabled
|
|
? (root.accent && root.theme ? root.theme.background : (root.theme ? root.theme.text : "#cdd6f4"))
|
|
: (root.theme ? root.theme.dimText : "#6c7086")
|
|
horizontalAlignment: Text.AlignHCenter
|
|
verticalAlignment: Text.AlignVCenter
|
|
font.pixelSize: 12
|
|
elide: Text.ElideRight
|
|
}
|
|
|
|
background: Rectangle {
|
|
radius: root.theme ? root.theme.controlRadius : 9
|
|
color: !root.enabled
|
|
? (root.theme ? root.theme.surface : "#181825")
|
|
: (root.accent
|
|
? (root.theme ? root.theme.primary : "#89b4fa")
|
|
: (root.hovered ? (root.theme ? root.theme.surfaceRaised : "#24243a")
|
|
: (root.theme ? root.theme.surfaceVariant : "#1e1e2e")))
|
|
border.color: root.theme ? root.theme.border : "#313244"
|
|
border.width: 1
|
|
}
|
|
}
|