From 0860bc415183b4a259f899d947896cca98bdc9d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 6 Dec 2013 15:41:56 +0100 Subject: [PATCH] [kwin] Use QIconItem in compact tabbox for the icon --- tabbox/qml/clients/compact/contents/ui/main.qml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tabbox/qml/clients/compact/contents/ui/main.qml b/tabbox/qml/clients/compact/contents/ui/main.qml index 430279c1b2..c0be74f8b8 100644 --- a/tabbox/qml/clients/compact/contents/ui/main.qml +++ b/tabbox/qml/clients/compact/contents/ui/main.qml @@ -26,7 +26,6 @@ Item { property int screenWidth : 0 property int screenHeight : 0 property string longestCaption: "" - property int imagePathPrefix: (new Date()).getTime() property int optimalWidth: compactListView.maxRowWidth property int optimalHeight: compactListView.rowHeight * compactListView.count + background.topMargin + background.bottomMargin property bool canStretchX: true @@ -49,11 +48,6 @@ Item { function setModel(model) { compactListView.model = model; compactListView.maxRowWidth = compactListView.calculateMaxRowWidth(); - compactListView.imageId++; - } - - function modelChanged() { - compactListView.imageId++; } /** @@ -91,15 +85,11 @@ Item { width: compactListView.width height: compactListView.rowHeight opacity: minimized ? 0.6 : 1.0 - Image { + QIconItem { id: iconItem - source: "image://client/" + index + "/" + compactTabBox.imagePathPrefix + "-" + compactListView.imageId + "/selected" + icon: model.icon width: 16 height: 16 - sourceSize { - width: 16 - height: 16 - } anchors { verticalCenter: parent.verticalCenter left: parent.left @@ -173,8 +163,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 { fill: parent topMargin: background.topMargin