From 1a73ae0d5bfc3173517716d65fa47c0b44615de7 Mon Sep 17 00:00:00 2001 From: "gianluca.montecchi" Date: Tue, 18 Dec 2007 18:50:39 +0100 Subject: [PATCH] fixed the code to color the items by status --- src/ToDoItemList.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ToDoItemList.py b/src/ToDoItemList.py index 7d8f75c..df1dd46 100644 --- a/src/ToDoItemList.py +++ b/src/ToDoItemList.py @@ -35,12 +35,7 @@ class ToDoItemList(QtGui.QListWidget): listItem.setText(recDict["headline"]) listItem.setData(QtCore.Qt.UserRole, QtCore.QVariant(recDict["oid"])) listItem.setData(QtCore.Qt.UserRole+1, QtCore.QVariant("item")) - if recDict["status"] == ST_OVERDUE: - listItem.setBackgroundColor(QtGui.QColor(192,0,0,64)) - if recDict["status"] == ST_ACTIVE: - listItem.setBackgroundColor(QtGui.QColor(0,192,0,64)) - if recDict["status"] == ST_CLOSED: - listItem.setBackgroundColor(QtGui.QColor(192,192,192,64)) + listItem.setBackgroundColor(ST_COLOR[recDict["status"]]) listItem.setFlags(QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsDragEnabled) def dragEnterEvent(self, event): -- 2.11.4.GIT