From e10f319e937a74b12f4bedd63ed29247eeddfe80 Mon Sep 17 00:00:00 2001 From: "pls.153" Date: Tue, 6 Jun 2023 17:44:12 +0200 Subject: [PATCH] example 'cl-repl': simplify QML item model --- examples/cl-repl/lisp/dialogs.lisp | 6 +++--- examples/cl-repl/lisp/editor.lisp | 10 +++++----- examples/cl-repl/qml/ext/DebugDialog.qml | 6 +++--- examples/cl-repl/qml/main.qml | 18 +++++++++--------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/cl-repl/lisp/dialogs.lisp b/examples/cl-repl/lisp/dialogs.lisp index e47fc5e..af94bfe 100644 --- a/examples/cl-repl/lisp/dialogs.lisp +++ b/examples/cl-repl/lisp/dialogs.lisp @@ -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* diff --git a/examples/cl-repl/lisp/editor.lisp b/examples/cl-repl/lisp/editor.lisp index 9e2f56a..978b93e 100644 --- a/examples/cl-repl/lisp/editor.lisp +++ b/examples/cl-repl/lisp/editor.lisp @@ -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) diff --git a/examples/cl-repl/qml/ext/DebugDialog.qml b/examples/cl-repl/qml/ext/DebugDialog.qml index fe63548..2c579d9 100644 --- a/examples/cl-repl/qml/ext/DebugDialog.qml +++ b/examples/cl-repl/qml/ext/DebugDialog.qml @@ -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 } } diff --git a/examples/cl-repl/qml/main.qml b/examples/cl-repl/qml/main.qml index adf88ac..e2e5e4b 100644 --- a/examples/cl-repl/qml/main.qml +++ b/examples/cl-repl/qml/main.qml @@ -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