2024-01-22 19:41:47 +00:00
|
|
|
import QtCore
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Controls.Basic
|
|
|
|
import mysettings
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: myButton
|
|
|
|
padding: 10
|
|
|
|
rightPadding: 18
|
|
|
|
leftPadding: 18
|
2024-06-28 21:11:12 +00:00
|
|
|
property color textColor: theme.lightButtonText
|
|
|
|
property color mutedTextColor: theme.lightButtonMutedText
|
|
|
|
property color backgroundColor: theme.lightButtonBackground
|
|
|
|
property color backgroundColorHovered: enabled ? theme.lightButtonBackgroundHovered : backgroundColor
|
|
|
|
property real borderWidth: 0
|
|
|
|
property color borderColor: "transparent"
|
|
|
|
property real fontPixelSize: theme.fontSizeLarge
|
|
|
|
property string toolTip
|
2024-01-22 19:41:47 +00:00
|
|
|
|
|
|
|
contentItem: Text {
|
|
|
|
text: myButton.text
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
color: myButton.enabled ? textColor : mutedTextColor
|
|
|
|
font.pixelSize: fontPixelSize
|
|
|
|
font.bold: true
|
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
|
|
|
}
|
|
|
|
background: Rectangle {
|
|
|
|
radius: 10
|
|
|
|
border.width: borderWidth
|
|
|
|
border.color: borderColor
|
|
|
|
color: myButton.hovered ? backgroundColorHovered : backgroundColor
|
|
|
|
}
|
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
2024-06-28 21:11:12 +00:00
|
|
|
ToolTip.text: toolTip
|
|
|
|
ToolTip.visible: toolTip !== "" && myButton.hovered
|
2024-01-22 19:41:47 +00:00
|
|
|
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
|
|
|
|
}
|