diff options
Diffstat (limited to 'share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml')
-rw-r--r-- | share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml | 62 |
1 files changed, 59 insertions, 3 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml index 6c5e6fde86..777fb0adc4 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml @@ -26,6 +26,8 @@ import QtQuick 2.1 import HelperWidgets 2.0 import QtQuick.Layouts 1.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme Section { anchors.left: parent.left @@ -46,9 +48,29 @@ Section { Label { text: qsTr("Text") } - LineEdit { - backendValue: backendValues.text - Layout.fillWidth: true + + RowLayout { + LineEdit { + backendValue: backendValues.text + Layout.fillWidth: true + } + + StudioControls.AbstractButton { + id: richTextEditorButton + buttonIcon: StudioTheme.Constants.textAlignTop + onClicked: { + richTextDialogLoader.show() + } + } + + RichTextEditor{ + onRejected: { + hideWidget() + } + onAccepted: { + hideWidget() + } + } } Label { @@ -219,4 +241,38 @@ Section { Layout.fillWidth: true } } + + Loader { + id: richTextDialogLoader + + visible: false + active: visible + + function show() { + richTextDialogLoader.visible = true + } + + sourceComponent: Item { + id: richTextEditorParent + + Component.onCompleted: { + richTextEditor.showWidget() + richTextEditor.richText = backendValues.text.value + } + + RichTextEditor { + id: richTextEditor + + onRejected: { + hideWidget() + richTextDialogLoader.visible = false + } + onAccepted: { + backendValues.text.value = richTextEditor.richText + hideWidget() + richTextDialogLoader.visible = false + } + } + } + } } |