From f5a873f42be43d065dc315d9236aed5668359bca Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 26 Jul 2017 14:45:01 -0600 Subject: Use ListDelegate in AccountsView --- components/kube/contents/ui/AccountsView.qml | 40 +++++++--------------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/components/kube/contents/ui/AccountsView.qml b/components/kube/contents/ui/AccountsView.qml index 407aad0d..66fef9f7 100644 --- a/components/kube/contents/ui/AccountsView.qml +++ b/components/kube/contents/ui/AccountsView.qml @@ -64,41 +64,21 @@ Rectangle { model: Kube.AccountsModel {} - delegate: T.ItemDelegate { + delegate: Kube.ListDelegate { id: delegateRoot - height: Kube.Units.gridUnit * 3 - width: listView.width + onClicked: edit.accountId = model.accountId - onClicked: { - edit.accountId = model.accountId - } - - contentItem: Item { - Kube.Label { - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - leftMargin: Kube.Units.largeSpacing - } - width: parent.width - Kube.Units.largeSpacing * 2 - - text: model.name - color: edit.accountId == model.accountId ? Kube.Colors.highlightedTextColor : Kube.Colors.textColor + Kube.Label { + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + leftMargin: Kube.Units.largeSpacing } - } + width: parent.width - Kube.Units.largeSpacing * 2 - background: Rectangle { - border.color: Kube.Colors.buttonColor - border.width: 1 - color: Kube.Colors.viewBackgroundColor - - Rectangle { - width: parent.width - height: parent.height - visible: edit.accountId == model.accountId - color: Kube.Colors.highlightColor - } + text: model.name + color: delegateRoot.textColor } } } -- cgit v1.2.3