2024-02-07 14:37:59 +00:00
|
|
|
import QtCore
|
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Controls.Basic
|
|
|
|
import Qt5Compat.GraphicalEffects
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: myButton
|
|
|
|
padding: 0
|
|
|
|
property color backgroundColor: theme.iconBackgroundDark
|
|
|
|
property color backgroundColorHovered: theme.iconBackgroundHovered
|
|
|
|
property alias source: image.source
|
|
|
|
property alias fillMode: image.fillMode
|
2024-03-05 16:31:31 +00:00
|
|
|
implicitWidth: 30
|
|
|
|
implicitHeight: 30
|
2024-02-07 14:37:59 +00:00
|
|
|
contentItem: Text {
|
|
|
|
text: myButton.text
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
color: myButton.enabled ? theme.textColor : theme.mutedTextColor
|
|
|
|
font.pixelSize: theme.fontSizeLarge
|
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
|
|
|
}
|
|
|
|
|
|
|
|
background: Item {
|
|
|
|
anchors.fill: parent
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
color: "transparent"
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
id: image
|
|
|
|
anchors.centerIn: parent
|
2024-06-24 22:49:23 +00:00
|
|
|
visible: false
|
2024-02-07 14:37:59 +00:00
|
|
|
mipmap: true
|
2024-06-29 22:00:52 +00:00
|
|
|
sourceSize.width: 16
|
|
|
|
sourceSize.height: 16
|
2024-02-07 14:37:59 +00:00
|
|
|
}
|
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: image
|
|
|
|
source: image
|
|
|
|
color: myButton.hovered ? backgroundColorHovered : backgroundColor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Accessible.role: Accessible.Button
|
|
|
|
Accessible.name: text
|
|
|
|
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
|
|
|
|
}
|