# HG changeset patch # User unc0rr # Date 1417638978 -10800 # Node ID eadf2cea55e072907df3691b08d5f914633bc4e4 # Parent b85759f2ba185cc99bc07ec478a2dd7b76f8b447 Finish combobox implementation (except for visual part) diff -r b85759f2ba18 -r eadf2cea55e0 qmlFrontend/qml/qmlFrontend/GameConfig.qml --- a/qmlFrontend/qml/qmlFrontend/GameConfig.qml Wed Dec 03 00:20:21 2014 +0300 +++ b/qmlFrontend/qml/qmlFrontend/GameConfig.qml Wed Dec 03 23:36:18 2014 +0300 @@ -39,20 +39,25 @@ HWComboBox { id: cbTheme - x: 320 - y: 16 - width: 100 - height: 256 + x: 50 + y: 160 + width: 256 + height: 64 model: themesModel delegate: Rectangle { height: 25 width: 100 color: "transparent" + + property alias itemIconSource: themeIcon.source + property alias itemText: themeName.text + Row { - Image {width: height; height: parent.height; source: "image://theme/" + modelData} + Image {id: themeIcon; width: height; height: parent.height; source: "image://theme/" + modelData} Text {id: themeName; text: modelData } } + MouseArea { z: 1 anchors.fill: parent diff -r b85759f2ba18 -r eadf2cea55e0 qmlFrontend/qml/qmlFrontend/HWComboBox.qml --- a/qmlFrontend/qml/qmlFrontend/HWComboBox.qml Wed Dec 03 00:20:21 2014 +0300 +++ b/qmlFrontend/qml/qmlFrontend/HWComboBox.qml Wed Dec 03 23:36:18 2014 +0300 @@ -9,14 +9,47 @@ Window { id: selection visibility: Window.Hidden + modality: Qt.WindowModal + flags: Qt.Dialog ListView { id: itemsList x: 0 y: 64 anchors.fill: parent + anchors.bottomMargin: 32 highlight: Rectangle { color: "#eaea00"; radius: 4 } focus: true + + onCurrentItemChanged: { + cbIcon.source = currentItem.itemIconSource + cbText.text = currentItem.itemText + } + } + + HWButton { + x: parent.width - 32 + y: parent.height - 32 + width: 32 + height: 32 + + onClicked: selection.visibility = Window.Hidden; + } + } + + Row { + anchors.fill: parent + anchors.margins: 4 + + Image { + id: cbIcon + width: height + height: parent.height + } + + Text { + id: cbText + height: parent.height } }