Various changes have been made as a result of the discussion of the first version
This commit is contained in:
27
qml/Controls/ImageButton.qml
Normal file
27
qml/Controls/ImageButton.qml
Normal file
@@ -0,0 +1,27 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 44
|
||||
implicitHeight: 44
|
||||
opacity: enabled ? 1 : 0.3
|
||||
color: control.pressed ? Palette.pressedButtonColor :
|
||||
control.hovered ? Palette.hoveredButtonColor : Palette.buttonColor
|
||||
radius: 5
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user