don't alternate colours on marked/suspended; make colours more subtle

This commit is contained in:
Damien Elmes 2011-12-15 16:52:17 +09:00
parent 2f47dba5e4
commit 33066d538c

View file

@ -17,12 +17,8 @@ from anki.hooks import runHook, addHook, remHook
from aqt.webview import AnkiWebView from aqt.webview import AnkiWebView
from aqt.toolbar import Toolbar from aqt.toolbar import Toolbar
COLOUR_SUSPENDED1 = "#ffffcc" COLOUR_SUSPENDED = "#fffff0"
COLOUR_SUSPENDED2 = "#ffffaa" COLOUR_MARKED = "#eeeeff"
COLOUR_INACTIVE1 = "#ffcccc"
COLOUR_INACTIVE2 = "#ffaaaa"
COLOUR_MARKED1 = "#ccccff"
COLOUR_MARKED2 = "#aaaaff"
# fixme: need to refresh after undo # fixme: need to refresh after undo
@ -279,18 +275,12 @@ class StatusDelegate(QItemDelegate):
return return
if c.queue < 0: if c.queue < 0:
# custom render # custom render
if index.row() % 2 == 0: brush = QBrush(QColor(COLOUR_SUSPENDED))
brush = QBrush(QColor(COLOUR_SUSPENDED1))
else:
brush = QBrush(QColor(COLOUR_SUSPENDED2))
painter.save() painter.save()
painter.fillRect(option.rect, brush) painter.fillRect(option.rect, brush)
painter.restore() painter.restore()
elif c.note().hasTag("Marked"): elif c.note().hasTag("Marked"):
if index.row() % 2 == 0: brush = QBrush(QColor(COLOUR_MARKED))
brush = QBrush(QColor(COLOUR_MARKED1))
else:
brush = QBrush(QColor(COLOUR_MARKED2))
painter.save() painter.save()
painter.fillRect(option.rect, brush) painter.fillRect(option.rect, brush)
painter.restore() painter.restore()