39 lines
1.1 KiB
QML
39 lines
1.1 KiB
QML
import QtQuick 2.12
|
|
import QtQuick.Controls 2.12
|
|
import QtGraphicalEffects 1.0
|
|
|
|
import Utils 1.0
|
|
|
|
Button {
|
|
id: control
|
|
|
|
icon.width: 24
|
|
icon.height: 24
|
|
|
|
contentItem: Image {
|
|
source: control.icon.source
|
|
sourceSize.width: control.icon.width
|
|
sourceSize.height: control.icon.height
|
|
fillMode: Image.PreserveAspectFit
|
|
|
|
ColorOverlay {
|
|
anchors.fill: parent
|
|
source: parent
|
|
color: "#FFFFFF"
|
|
visible: control.hovered
|
|
}
|
|
}
|
|
|
|
background: Rectangle {
|
|
implicitWidth: 44
|
|
implicitHeight: 44
|
|
color: control.enabled ? (control.pressed ? Palette.pressedButtonColor :
|
|
control.hovered ? Palette.hoveredButtonColor : Palette.backgroundColor) :
|
|
Palette.hoveredBackgroundColor
|
|
border.color: control.pressed ? Palette.pressedButtonColor :
|
|
control.hovered ? Palette.hoveredButtonColor : Palette.borderColor
|
|
border.width: 1
|
|
radius: 5
|
|
}
|
|
}
|