diff --git a/manuskript/functions.py b/manuskript/functions.py index 24652ba2..cdcd8ca0 100644 --- a/manuskript/functions.py +++ b/manuskript/functions.py @@ -189,7 +189,7 @@ def outlineItemColors(item): if item.compile() in [0, "0"]: colors["Compile"] = mixColors(QColor(S.text), QColor(S.window)) else: - colors["Compile"] = QColor(S.text) + colors["Compile"] = QColor(Qt.transparent) # will use default return colors diff --git a/manuskript/ui/views/outlineDelegates.py b/manuskript/ui/views/outlineDelegates.py index 818718dd..215f99a6 100644 --- a/manuskript/ui/views/outlineDelegates.py +++ b/manuskript/ui/views/outlineDelegates.py @@ -8,7 +8,7 @@ from PyQt5.QtWidgets import qApp from manuskript import settings from manuskript.enums import Character, Outline from manuskript.functions import outlineItemColors, mixColors, colorifyPixmap, toInt, toFloat, drawProgress - +from manuskript.ui import style as S class outlineTitleDelegate(QStyledItemDelegate): def __init__(self, parent=None): @@ -39,7 +39,7 @@ class outlineTitleDelegate(QStyledItemDelegate): col = colors[settings.viewSettings["Outline"]["Background"]] if col != QColor(Qt.transparent): - col2 = QColor(Qt.white) + col2 = QColor(S.base) if opt.state & QStyle.State_Selected: col2 = opt.palette.brush(QPalette.Normal, QPalette.Highlight).color() col = mixColors(col, col2, .2) @@ -76,10 +76,20 @@ class outlineTitleDelegate(QStyledItemDelegate): # Text if opt.text: painter.save() + textColor = QColor(S.text) + if option.state & QStyle.State_Selected: + col = QColor(S.highlightedText) + textColor = col + painter.setPen(col) if settings.viewSettings["Outline"]["Text"] != "Nothing": col = colors[settings.viewSettings["Outline"]["Text"]] if col == Qt.transparent: - col = Qt.black + col = textColor + # If text color is Compile and item is selected, we have + # to change the color + if settings.viewSettings["Outline"]["Text"] == "Compile" and \ + item.compile() in [0, "0"]: + col = mixColors(textColor, QColor(S.window)) painter.setPen(col) f = QFont(opt.font) painter.setFont(f) diff --git a/manuskript/ui/views/treeDelegates.py b/manuskript/ui/views/treeDelegates.py index 4921a7e1..6ed7a3b6 100644 --- a/manuskript/ui/views/treeDelegates.py +++ b/manuskript/ui/views/treeDelegates.py @@ -82,13 +82,20 @@ class treeTitleDelegate(QStyledItemDelegate): # Text if opt.text: painter.save() + textColor = QColor(S.text) if option.state & QStyle.State_Selected: col = QColor(S.highlightedText) + textColor = col painter.setPen(col) if settings.viewSettings["Tree"]["Text"] != "Nothing": col = colors[settings.viewSettings["Tree"]["Text"]] if col == Qt.transparent: - col = QColor(S.text) + col = textColor + # If text color is Compile and item is selected, we have + # to change the color + if settings.viewSettings["Outline"]["Text"] == "Compile" and \ + item.compile() in [0, "0"]: + col = mixColors(textColor, QColor(S.window)) painter.setPen(col) f = QFont(opt.font) painter.setFont(f)