header colors derive from base background, light/dark aware

This commit is contained in:
Levi Neely 2026-08-01 10:13:27 +02:00
parent 68e7dfa7c2
commit 207eaf4f9d
1 changed files with 27 additions and 9 deletions

View File

@ -282,15 +282,33 @@ ApplicationWindow {
height: 22
radius: 3
color: {
switch (blockType) {
case "user": return Qt.lighter(theme.highlightColor, 1.8)
case "assistant": return Qt.lighter(theme.linkColor, 1.8)
case "reasoning": return Qt.lighter(theme.midColor, 1.5)
case "call": return Qt.lighter(theme.buttonColor, 1.1)
case "tool": return Qt.lighter(theme.darkColor, 2.0)
case "error": return Qt.lighter("#e53935", 1.6)
case "info": return Qt.lighter(theme.midColor, 1.3)
default: return theme.baseColor
// Derive header colors from base background with subtle tint.
// Always readable because text uses theme.textColor.
var bg = theme.baseColor
if (theme.isDark) {
// Dark theme: lighter tints against dark background
switch (blockType) {
case "user": return Qt.lighter(bg, 1.8)
case "assistant": return Qt.lighter(bg, 1.5)
case "reasoning": return Qt.lighter(bg, 1.3)
case "call": return Qt.lighter(bg, 1.7)
case "tool": return Qt.lighter(bg, 1.2)
case "error": return Qt.rgba(0.6, 0.15, 0.15, 0.7)
case "info": return Qt.lighter(bg, 1.4)
default: return bg
}
} else {
// Light theme: slightly darker tints
switch (blockType) {
case "user": return Qt.darker(bg, 1.12)
case "assistant": return Qt.darker(bg, 1.06)
case "reasoning": return Qt.darker(bg, 1.03)
case "call": return Qt.darker(bg, 1.1)
case "tool": return Qt.darker(bg, 1.04)
case "error": return Qt.rgba(1.0, 0.8, 0.8, 0.7)
case "info": return Qt.darker(bg, 1.02)
default: return bg
}
}
}