This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
fanny-app/qml/Components/FancyButton.qml

90 lines
1.7 KiB
QML
Raw Normal View History

2018-12-22 13:43:43 +01:00
import QtQuick 2.9
import QtQuick.Controls 2.4
Button {
id: control
property string image
property real imageScale: 1
background: Rectangle {
id: smorgenBackground
height: control.height
width: height
scale: control.pressed ? 0.8:1
Behavior on scale {
PropertyAnimation {
duration: 100
}
}
Image {
id: smorgenImage
source: control.image
anchors.centerIn: parent
height: parent.height * 0.5
width: height
visible: false
mipmap: true
fillMode: Image.PreserveAspectFit
scale: control.imageScale
Behavior on scale {
PropertyAnimation {
duration: 100
}
}
}
}
/*
background: Image {
id: smorgenBackground
source: "qrc:/circle.png"
height: control.height
width: height
scale: control.pressed ? 0.8:1
Behavior on scale {
PropertyAnimation {
duration: 100
}
}
mipmap: true
smooth: true
fillMode: Image.PreserveAspectFit
Image {
id: smorgenImage
source: control.image
anchors.centerIn: parent
height: parent.height * 0.5
width: height
mipmap: true
smooth: true
fillMode: Image.PreserveAspectFit
scale: control.imageScale
Behavior on scale {
PropertyAnimation {
duration: 100
}
}
}
}
*/
}