# HG changeset patch # User unc0rr # Date 1416606901 -10800 # Node ID af019fa700801c8db39a529de0ca897913119258 # Parent 844bd43db47a94578cc61b830b9e8003f2734fdf Attempt on a custom combobox diff -r 844bd43db47a -r af019fa70080 qmlFrontend/qml/qmlFrontend/GameConfig.qml --- a/qmlFrontend/qml/qmlFrontend/GameConfig.qml Wed Nov 19 00:38:14 2014 +0300 +++ b/qmlFrontend/qml/qmlFrontend/GameConfig.qml Sat Nov 22 00:55:01 2014 +0300 @@ -37,7 +37,31 @@ onClicked: HWEngine.runLocalGame() } - Rectangle { + HWComboBox { + x: 320 + y: 16 + width: 100 + height: 256 + + model: themesModel + delegate: Rectangle { + height: 25 + width: 100 + color: "transparent" + Text {id: themeName; text: modelData } + MouseArea { + z: 1 + anchors.fill: parent + onClicked: { + themeImage.source = "image://theme/" + themeName.text + model.currentIndex = index + HWEngine.setTheme(themeName.text) + } + } + } + } + +/* Rectangle { x: 320 y: 16 width: 100 @@ -54,34 +78,7 @@ height: 64 fillMode: Image.Pad } - - ListView { - id: themesList - x: 0 - y: 64 - width: 100 - height: 192 - highlight: Rectangle { color: "#eaea00"; radius: 4 } - focus: true - - model: themesModel - delegate: Rectangle { - height: 25 - width: 100 - color: "transparent" - Text {id: themeName; text: modelData } - MouseArea { - z: 1 - anchors.fill: parent - onClicked: { - themeImage.source = "image://theme/" + themeName.text - themesList.currentIndex = index - HWEngine.setTheme(themeName.text) - } - } - } - } - } +*/ ListView { id: playingTeamsList diff -r 844bd43db47a -r af019fa70080 qmlFrontend/qml/qmlFrontend/HWComboBox.qml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qmlFrontend/qml/qmlFrontend/HWComboBox.qml Sat Nov 22 00:55:01 2014 +0300 @@ -0,0 +1,23 @@ +import QtQuick 2.0 +import QtQuick.Window 2.1 + +HWButton { + property alias model: itemsList.model + property alias delegate: itemsList.delegate + + Window { + id: selection + visibility: Window.Hidden + + ListView { + id: itemsList + x: 0 + y: 64 + anchors.fill: parent + highlight: Rectangle { color: "#eaea00"; radius: 4 } + focus: true + } + } + + onClicked: selection.visibility = Window.Windowed +} diff -r 844bd43db47a -r af019fa70080 qmlFrontend/qmlFrontend.pro --- a/qmlFrontend/qmlFrontend.pro Wed Nov 19 00:38:14 2014 +0300 +++ b/qmlFrontend/qmlFrontend.pro Sat Nov 22 00:55:01 2014 +0300 @@ -37,4 +37,5 @@ qml/qmlFrontend/main.qml \ qml/qmlFrontend/LocalGame.qml \ qml/qmlFrontend/GameConfig.qml \ - qml/qmlFrontend/First.qml + qml/qmlFrontend/First.qml \ + qml/qmlFrontend/HWComboBox.qml