From 8e9dcdd70b74e625c6c0b1a7f4b06888de9407b8 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Tue, 13 Dec 2016 22:40:39 +0100 Subject: style folder view black --- components/package/contents/ui/FolderListView.qml | 63 ++++++++++++++++++++++- 1 file changed, 61 insertions(+), 2 deletions(-) (limited to 'components/package') diff --git a/components/package/contents/ui/FolderListView.qml b/components/package/contents/ui/FolderListView.qml index 41f152de..936303be 100644 --- a/components/package/contents/ui/FolderListView.qml +++ b/components/package/contents/ui/FolderListView.qml @@ -25,25 +25,84 @@ import org.kde.kirigami 1.0 as Kirigami import org.kube.framework.domain 1.0 as KubeFramework -Item { +Rectangle { id: root property variant currentFolder property variant accountId + color: Kirigami.Theme.textColor + TreeView { - anchors.fill: parent id: treeView + + anchors { + top: parent.top + left: parent.left + right: parent.right + } + + height: parent.height + TableViewColumn { title: "Name" role: "name" } + model: KubeFramework.FolderListModel { id: folderListModel} //; accountId: wrapper.accountId } + onCurrentIndexChanged: { model.fetchMore(currentIndex) root.currentFolder = model.data(currentIndex, KubeFramework.FolderListModel.DomainObject) } + alternatingRowColors: false headerVisible: false + + style: TreeViewStyle { + + rowDelegate: Rectangle { + color: styleData.selected ? Kirigami.Theme.highlightColor : Kirigami.Theme.textColor + + height: Kirigami.Units.gridUnit * 2 + width: 20 + + } + + branchDelegate: Item { + + width: 16; height: 16 + + Text { + + anchors.centerIn: parent + + color: Kirigami.Theme.viewBackgroundColor + text: styleData.isExpanded ? "-" : "+" + } + + //radius: styleData.isExpanded ? 0 : 100 + } + + itemDelegate: Rectangle { + + color: styleData.selected ? Kirigami.Theme.highlightColor : Kirigami.Theme.textColor + + Text { + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + leftMargin: Kirigami.Units.smallSpacing + } + + text: "#" + styleData.value + + color: Kirigami.Theme.viewBackgroundColor + } + } + + backgroundColor: Kirigami.Theme.textColor + highlightedTextColor: Kirigami.Theme.highlightedTextColor + } } } -- cgit v1.2.3