DebugConsole: improve text & border coloring

This commit is contained in:
miruka 2020-09-28 19:11:51 -04:00
parent d6062a8320
commit e3fcb39556

View File

@ -181,20 +181,28 @@ HDrawer {
width: outputList.width - width: outputList.width -
outputList.leftMargin - outputList.rightMargin outputList.leftMargin - outputList.rightMargin
readonly property color inputColor:
model.error ? theme.colors.errorText :
model.output ? theme.colors.accentText :
theme.colors.positiveText
text: text:
`<div style="white-space: pre-wrap">` + `<div style="white-space: pre-wrap">` +
`<font color="${theme.colors.accentText}">` + `<font color="${inputColor}">` +
utils.plain2Html(model.input) + utils.plain2Html(model.input) +
"</font>" + "</font>" +
(model.input && model.output ? "<br>" : "") + (model.input && model.output ? "<br>" : "") +
(model.output ? utils.plain2Html(model.output) : "") + (model.output ? utils.plain2Html(model.output) : "") +
"</div>" "</div>"
leftPadding: theme.spacing
textFormat: HSelectableLabel.RichText textFormat: HSelectableLabel.RichText
wrapMode: HLabel.Wrap wrapMode: HLabel.Wrap
color: model.error ? theme.colors.errorText : theme.colors.text
font.family: theme.fontFamily.mono font.family: theme.fontFamily.mono
leftPadding: theme.spacing color:
model.error ?
Qt.darker(inputColor, 1.4) :
theme.colors.halfDimText
Layout.fillWidth: true Layout.fillWidth: true
@ -256,7 +264,9 @@ HDrawer {
color: color:
model.error ? model.error ?
theme.colors.negativeBackground : theme.colors.negativeBackground :
theme.colors.accentElement model.output ?
theme.colors.accentElement :
theme.colors.positiveBackground
} }
} }