| 1 |
import QtQuick 2.4 |
| 2 |
import FlightGear 1.0 |
| 3 |
|
| 4 |
Text { |
| 5 |
id: root |
| 6 |
signal clicked(); |
| 7 |
|
| 8 |
property bool clickable: true |
| 9 |
property bool enabled: true |
| 10 |
property color baseTextColor: Style.baseTextColor |
| 11 |
color: enabled ? (mouse.containsMouse ? Style.themeColor : baseTextColor) : Style.disabledTextColor |
| 12 |
font.pixelSize: Style.baseFontPixelSize |
| 13 |
font.underline: mouse.containsMouse |
| 14 |
|
| 15 |
MouseArea { |
| 16 |
id: mouse |
| 17 |
|
| 18 |
enabled: root.clickable && root.enabled |
| 19 |
hoverEnabled: root.clickable && root.enabled |
| 20 |
anchors.fill: parent |
| 21 |
|
| 22 |
onClicked: parent.clicked(); |
| 23 |
|
| 24 |
cursorShape: root.clickable ? Qt.PointingHandCursor : Qt.ArrowCursor |
| 25 |
} |
| 26 |
} |