diff --git a/EditableListView.qml b/EditableListView.qml index c45d4f7..8c4517f 100644 --- a/EditableListView.qml +++ b/EditableListView.qml @@ -51,24 +51,16 @@ ColumnLayout { width: listView.width height: 45 - Rectangle { + ItemDelegate { anchors.fill: parent - - color: isCurrentItem ? - Material.color(Material.Purple) : - Material.background - radius: 0 - - Label { + contentItem: IconChooserDelegateLayout { anchors.fill: parent - //anchors.verticalCenter: parent.verticalCenter - id: text text: model[textRole] - padding: 10 - fontSizeMode: Text.VerticalFit - minimumPixelSize: 10; - font.pixelSize: 72 + // TODO + //iconSource: comboBox.getIconUrl(index) } + onClicked: listView.currentIndex = index + down: listView.currentIndex === index } Rectangle { @@ -79,11 +71,6 @@ ColumnLayout { anchors.bottom: parent.bottom visible: index !== (listView.count - 1) } - - MouseArea { - anchors.fill: parent - onClicked: listView.currentIndex = index - } } focus: true } diff --git a/IconChooserDelegateLayout.qml b/IconChooserDelegateLayout.qml index c839ad0..49da30e 100644 --- a/IconChooserDelegateLayout.qml +++ b/IconChooserDelegateLayout.qml @@ -16,7 +16,11 @@ RowLayout { fillMode: Image.PreserveAspectFit } Label { + Layout.preferredHeight: layout.height text: layout.text + verticalAlignment: Label.AlignVCenter + fontSizeMode: Text.VerticalFit + font.pixelSize: 20 } Item { Layout.fillWidth: true