Fancier EditableListView
This commit is contained in:
@ -38,28 +38,41 @@ ColumnLayout {
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Item {
|
||||||
property variant myData: model
|
property variant myData: model
|
||||||
|
readonly property bool isCurrentItem: ListView.isCurrentItem
|
||||||
|
|
||||||
width: listView.width
|
width: listView.width
|
||||||
height: 40
|
height: 45
|
||||||
|
|
||||||
color: ListView.isCurrentItem ?
|
Rectangle {
|
||||||
Material.color(Material.Purple) :
|
|
||||||
Material.color(Material.Purple, Material.Shade900)
|
|
||||||
radius: 5
|
|
||||||
|
|
||||||
Label {
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
//anchors.verticalCenter: parent.verticalCenter
|
|
||||||
id: text
|
color: isCurrentItem ?
|
||||||
text: model.name
|
Material.color(Material.Purple) :
|
||||||
padding: 5
|
Material.background
|
||||||
fontSizeMode: Text.VerticalFit
|
radius: 0
|
||||||
minimumPixelSize: 10;
|
|
||||||
font.pixelSize: 72
|
Label {
|
||||||
|
anchors.fill: parent
|
||||||
|
//anchors.verticalCenter: parent.verticalCenter
|
||||||
|
id: text
|
||||||
|
text: model.name
|
||||||
|
padding: 10
|
||||||
|
fontSizeMode: Text.VerticalFit
|
||||||
|
minimumPixelSize: 10;
|
||||||
|
font.pixelSize: 72
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
color: Material.dividerColor
|
||||||
|
height: 1
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
visible: index !== (listView.count - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
Reference in New Issue
Block a user