example 'cl-repl': simplify QML item model

This commit is contained in:
pls.153 2023-06-06 17:44:12 +02:00
parent 0446628830
commit e10f319e93
4 changed files with 20 additions and 20 deletions

View file

@ -49,9 +49,9 @@
(defun append-debug-output (text color bold)
(qjs |appendOutput| ui:*debug-model*
(list :m-text text
:m-color color
:m-bold bold)))
(list :text text
:color color
:bold bold)))
(defun debug-dialog (messages)
(qrun*

View file

@ -694,11 +694,11 @@
:rich-text (text is subset of html). The ouput is printed immediately
(important for longer running tasks)."
(qjs |appendOutput| ui:*output-model*
(list :m-text (if (stringp x) x (prin1-to-string x))
:m-color color
:m-bold bold
:m-line line
:m-rich-text rich-text)))
(list :text (if (stringp x) x (prin1-to-string x))
:color color
:bold bold
:line line
:rich-text rich-text)))
(qml::alias pr append-output)

View file

@ -65,9 +65,9 @@ Rectangle {
textFormat: Text.PlainText
font.pixelSize: 16
font.family: "Hack"
font.bold: mBold
text: mText
color: mColor
font.bold: model.bold
text: model.text
color: model.color
}
}

View file

@ -287,7 +287,7 @@ StackView {
delegate: Column {
Rectangle {
width: output.contentWidth
height: mLine ? 2 : 0
height: model.line ? 2 : 0
color: "#c0c0ff"
}
@ -297,10 +297,10 @@ StackView {
textFormat: Text.PlainText
font.family: output.fontFamily
font.pixelSize: output.fontSize
text: mRichText ? "" : mText
color: mColor
font.bold: mBold
visible: !mRichText
text: model.richText ? "" : model.text
color: model.color
font.bold: model.bold
visible: !model.richText
}
Text {
@ -309,10 +309,10 @@ StackView {
textFormat: Text.RichText
font.family: output.fontFamily
font.pixelSize: output.fontSize
text: mRichText ? mText : ""
color: mColor
font.bold: mBold
visible: mRichText
text: model.richText ? model.text : ""
color: model.color
font.bold: model.bold
visible: model.richText
MouseArea {
width: parent.paintedWidth