From 6256e5bd36168b88ac8b5ee319cf7d8043579b80 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 8 Jul 2009 13:48:23 +0900 Subject: [PATCH] mark inacitve and suspended in different colours --- ankiqt/ui/cardlist.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ankiqt/ui/cardlist.py b/ankiqt/ui/cardlist.py index 9b8f8dc5a..ec6635a0f 100644 --- a/ankiqt/ui/cardlist.py +++ b/ankiqt/ui/cardlist.py @@ -279,7 +279,7 @@ class StatusDelegate(QItemDelegate): if len(self.model.cards[index.row()]) == 1: self.model.updateCard(index) row = self.model.cards[index.row()] - if row[CARD_PRIORITY] in (-3, 0): + if row[CARD_PRIORITY] == -3: # custom render if index.row() % 2 == 0: brush = QBrush(QColor("#ffffcc")) @@ -288,6 +288,15 @@ class StatusDelegate(QItemDelegate): painter.save() painter.fillRect(option.rect, brush) painter.restore() + if row[CARD_PRIORITY] == 0: + # custom render + if index.row() % 2 == 0: + brush = QBrush(QColor("#ffcccc")) + else: + brush = QBrush(QColor("#ffaaaa")) + painter.save() + painter.fillRect(option.rect, brush) + painter.restore() elif "Marked" in row[CARD_TAGS]: if index.row() % 2 == 0: brush = QBrush(QColor("#ccccff"))