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) (defun append-debug-output (text color bold)
(qjs |appendOutput| ui:*debug-model* (qjs |appendOutput| ui:*debug-model*
(list :m-text text (list :text text
:m-color color :color color
:m-bold bold))) :bold bold)))
(defun debug-dialog (messages) (defun debug-dialog (messages)
(qrun* (qrun*

View file

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

View file

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

View file

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