Save/load composer text
This commit is contained in:
@@ -25,7 +25,7 @@ Drawer {
|
||||
|
||||
|
||||
property string saveName: ""
|
||||
property string saveId: ""
|
||||
property var saveId: "ALL"
|
||||
property var saveProperties: ["preferredSize"]
|
||||
|
||||
//
|
||||
|
@@ -6,9 +6,21 @@ ScrollView {
|
||||
clip: true
|
||||
ScrollBar.vertical.visible: contentHeight > height
|
||||
|
||||
// Set it only on component creation to avoid binding loops
|
||||
Component.onCompleted: if (! text) {
|
||||
text = window.getState(this, "text", "")
|
||||
textArea.cursorPosition = text.length
|
||||
}
|
||||
|
||||
onTextChanged: window.saveState(this)
|
||||
|
||||
|
||||
default property alias textAreaData: textArea.data
|
||||
|
||||
property string saveName: ""
|
||||
property var saveId: "ALL"
|
||||
property var saveProperties: ["text"]
|
||||
|
||||
property alias backgroundColor: textAreaBackground.color
|
||||
property alias placeholderText: textArea.placeholderText
|
||||
property alias text: textArea.text
|
||||
|
@@ -30,8 +30,10 @@ TextField {
|
||||
}
|
||||
|
||||
// Set it only on component creation to avoid binding loops
|
||||
Component.onCompleted:
|
||||
if (! text) text = window.getState(this, "text", "")
|
||||
Component.onCompleted: if (! text) {
|
||||
text = window.getState(this, "text", "")
|
||||
cursorPosition = text.length
|
||||
}
|
||||
|
||||
onTextChanged: window.saveState(this)
|
||||
|
||||
@@ -42,7 +44,7 @@ TextField {
|
||||
|
||||
|
||||
property string saveName: ""
|
||||
property string saveId: ""
|
||||
property var saveId: "ALL"
|
||||
property var saveProperties: ["text"]
|
||||
|
||||
property bool error: false
|
||||
|
Reference in New Issue
Block a user