Make EditableListView more material

This commit is contained in:
Michael Ehrenreich
2023-02-19 04:37:03 +01:00
parent 3c6b2bbe48
commit 43961bf3a3
2 changed files with 10 additions and 19 deletions

View File

@@ -51,24 +51,16 @@ ColumnLayout {
width: listView.width width: listView.width
height: 45 height: 45
Rectangle { ItemDelegate {
anchors.fill: parent anchors.fill: parent
contentItem: IconChooserDelegateLayout {
color: isCurrentItem ?
Material.color(Material.Purple) :
Material.background
radius: 0
Label {
anchors.fill: parent anchors.fill: parent
//anchors.verticalCenter: parent.verticalCenter
id: text
text: model[textRole] text: model[textRole]
padding: 10 // TODO
fontSizeMode: Text.VerticalFit //iconSource: comboBox.getIconUrl(index)
minimumPixelSize: 10;
font.pixelSize: 72
} }
onClicked: listView.currentIndex = index
down: listView.currentIndex === index
} }
Rectangle { Rectangle {
@@ -79,11 +71,6 @@ ColumnLayout {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
visible: index !== (listView.count - 1) visible: index !== (listView.count - 1)
} }
MouseArea {
anchors.fill: parent
onClicked: listView.currentIndex = index
}
} }
focus: true focus: true
} }

View File

@@ -16,7 +16,11 @@ RowLayout {
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
} }
Label { Label {
Layout.preferredHeight: layout.height
text: layout.text text: layout.text
verticalAlignment: Label.AlignVCenter
fontSizeMode: Text.VerticalFit
font.pixelSize: 20
} }
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true