Debian Codegraph @

src/GUI/qml/IconButton.qml

raw
1 import QtQuick 2.0
2 import FlightGear 1.0
3
4 Rectangle {
5 id: root
6 radius: Style.roundRadius
7 border.width: 1
8 border.color: Style.themeColor
9 width: height
10 height: Style.baseFontPixelSize + Style.margin * 2
11 color: mouse.containsMouse ? Style.minorFrameColor : Style.backgroundColor
12
13 property alias icon: icon.source
14
15 signal clicked();
16
17 Image {
18 id: icon
19 width: parent.width - Style.margin
20 height: parent.height - Style.margin
21 anchors.centerIn: parent
22 }
23
24 MouseArea {
25 id: mouse
26 hoverEnabled: true
27 onClicked: root.clicked();
28 anchors.fill: parent
29 }
30 }