author | unc0rr |
Thu, 19 Nov 2015 23:32:28 +0300 | |
branch | qmlfrontend |
changeset 11416 | 78d6b99ddcb0 |
parent 10610 | eadf2cea55e0 |
child 11426 | ab6a6d9ebfc0 |
permissions | -rw-r--r-- |
10519 | 1 |
import QtQuick 2.0 |
2 |
import QtQuick.Window 2.1 |
|
3 |
||
4 |
HWButton { |
|
5 |
property alias model: itemsList.model |
|
6 |
property alias delegate: itemsList.delegate |
|
10608 | 7 |
property alias currentIndex: itemsList.currentIndex |
10519 | 8 |
|
9 |
Window { |
|
10 |
id: selection |
|
11 |
visibility: Window.Hidden |
|
10610
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
12 |
modality: Qt.WindowModal |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
13 |
flags: Qt.Dialog |
10519 | 14 |
|
15 |
ListView { |
|
16 |
id: itemsList |
|
17 |
x: 0 |
|
18 |
y: 64 |
|
19 |
anchors.fill: parent |
|
10610
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
20 |
anchors.bottomMargin: 32 |
10519 | 21 |
highlight: Rectangle { color: "#eaea00"; radius: 4 } |
22 |
focus: true |
|
10610
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
23 |
|
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
24 |
onCurrentItemChanged: { |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
25 |
cbIcon.source = currentItem.itemIconSource |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
26 |
cbText.text = currentItem.itemText |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
27 |
} |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
28 |
} |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
29 |
|
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
30 |
HWButton { |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
31 |
x: parent.width - 32 |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
32 |
y: parent.height - 32 |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
33 |
width: 32 |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
34 |
height: 32 |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
35 |
|
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
36 |
onClicked: selection.visibility = Window.Hidden; |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
37 |
} |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
38 |
} |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
39 |
|
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
40 |
Row { |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
41 |
anchors.fill: parent |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
42 |
anchors.margins: 4 |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
43 |
|
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
44 |
Image { |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
45 |
id: cbIcon |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
46 |
width: height |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
47 |
height: parent.height |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
48 |
} |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
49 |
|
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
50 |
Text { |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
51 |
id: cbText |
eadf2cea55e0
Finish combobox implementation (except for visual part)
unc0rr
parents:
10608
diff
changeset
|
52 |
height: parent.height |
10519 | 53 |
} |
54 |
} |
|
55 |
||
56 |
onClicked: selection.visibility = Window.Windowed |
|
57 |
} |