From 7e2157bfe4fd256adb25cbc88a28a13ad87fc7f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 6 Dec 2013 16:08:46 +0100 Subject: [PATCH] [kwin] Use QIconItem in the desktop tabbox Unfortunately not tested, I didn't get it activated. --- .../desktops/informative/contents/ui/main.qml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/tabbox/qml/desktops/informative/contents/ui/main.qml b/tabbox/qml/desktops/informative/contents/ui/main.qml index 4104fbd8a3..fb1cbe4c8d 100644 --- a/tabbox/qml/desktops/informative/contents/ui/main.qml +++ b/tabbox/qml/desktops/informative/contents/ui/main.qml @@ -48,13 +48,11 @@ Item { function setModel(model) { listView.model = model; desktopClientModel.model = model; - desktopClientModel.imageId++; listView.maxRowWidth = listView.calculateMaxRowWidth(); } function modelChanged() { listView.currentIndex = -1; - desktopClientModel.imageId++; } // just to get the margin sizes @@ -153,8 +151,6 @@ Item { // the maximum text width + icon item width (32 + 4 margin) + margins for hover item + margins for background property int maxRowWidth: calculateMaxRowWidth() property int rowHeight: calcRowHeight() - // used for image provider URL to trick Qt into reloading icons when the model changes - property int imageId: 0 anchors { top: parent.top left: parent.left @@ -178,29 +174,20 @@ Item { } Component { id: clientIconDelegate - Image { - sourceSize { - width: 16 - height: 16 - } + QIconItem { + icon: model.icon width: 16 height: 16 - Component.onCompleted: { - source = "image://client/" + index + "/" + listView.currentIndex + "/" + desktopClientModel.imagePathPrefix + "-" + desktopClientModel.imageId; - } } } Item { id: clientArea VisualDataModel { property alias desktopIndex: listView.currentIndex - property int imagePathPrefix: (new Date()).getTime() - property int imageId: 0 id: desktopClientModel model: clientModel delegate: clientIconDelegate onDesktopIndexChanged: { - desktopClientModel.imageId++; desktopClientModel.rootIndex = desktopClientModel.parentModelIndex(); desktopClientModel.rootIndex = desktopClientModel.modelIndex(desktopClientModel.desktopIndex); }