Debian Codegraph @

src/GUI/qml/HistoryPopup.qml

raw
1 import QtQuick 2.4
2 import FlightGear.Launcher 1.0
3 import FlightGear 1.0
4
5 Item {
6 id: root
7
8 property var model: undefined
9 property string displayRole: "display"
10 property bool enabled: true
11
12 implicitHeight: button.height
13 implicitWidth: button.width
14
15 signal selected(var index);
16
17 Rectangle {
18 id: button
19
20 width: icon.width
21 height: icon.height
22 radius: Style.roundRadius
23
24 color: enabled ? (mouse.containsMouse ? Style.activeColor : Style.themeColor) : Style.disabledThemeColor
25
26 Image {
27 id: icon
28 source: "image://colored-icon/history?themeContrast"
29 anchors.centerIn: parent
30 }
31
32 MouseArea {
33 anchors.fill: parent
34 id: mouse
35 hoverEnabled: root.enabled
36 enabled: root.enabled
37 onClicked: {
38 OverlayShared.globalOverlay.showOverlayAtItemOffset(menu, root,
39 Qt.point(root.width, root.height))
40 }
41 }
42 }
43
44 Component {
45 id: menu
46 OverlayMenu {
47 model: root.model
48 onSelect: root.selected(index)
49 alignRightEdge: true
50 }
51 }
52 }