Debian Codegraph @

src/GUI/qml/GettingStartedTipLayer.qml

raw
1 import QtQuick 2.4
2 import QtQml 2.4
3
4 import FlightGear 1.0
5
6 Item {
7 id: root
8
9 property GettingStartedController controller: ctl
10
11 property alias scopeId: ctl.scopeId
12 property alias active: ctl.active
13
14 function showOneShot(tip) {
15 ctl.showOneShotTip(tip);
16 }
17
18 GettingStartedController {
19 id: ctl
20 visualArea: root
21 }
22
23 // ensure active-ness is updated, if the 'reset all tips' function is used
24 Connections {
25 target: _launcher
26 function onDidResetGettingStartedTips() {
27 ctl.tipsWereReset();
28 }
29 }
30
31 // use a Loader to handle tip display, so we're not creating visual items
32 // for the tip, in the common case that no tip is displayed.
33 Loader {
34 id: load
35 source: (ctl.active && ctl.tipPositionValid) ? "qrc:///qml/GettingStartedTipDisplay.qml" : ""
36 x: ctl.tipPositionInVisualArea.x
37 y: ctl.tipPositionInVisualArea.y
38 }
39
40 // pass the controller into our loaded item
41 Binding {
42 target: load.item
43 property: "controller"
44 value: ctl
45 }
46 }