diff --git a/touch/PTextField.qml b/touch/PTextField.qml index 4533ebe..d937f02 100644 --- a/touch/PTextField.qml +++ b/touch/PTextField.qml @@ -29,6 +29,10 @@ Item { property string placeholderText: '' signal accepted + function paste() { + textInput.paste(); + } + height: 50 * pgst.scalef TextInput { diff --git a/touch/PodcastsPage.qml b/touch/PodcastsPage.qml index fd3df96..8f1a425 100644 --- a/touch/PodcastsPage.qml +++ b/touch/PodcastsPage.qml @@ -58,6 +58,7 @@ SlidePage { pgst.loadPage('TextInputDialog.qml', { buttonText: 'Subscribe', placeholderText: 'Feed URL', + pasteOnLoad: true, callback: function (url) { ctx.py.call('main.subscribe', [url]); } diff --git a/touch/TextInputDialog.qml b/touch/TextInputDialog.qml index f780b2b..f4bb7a8 100644 --- a/touch/TextInputDialog.qml +++ b/touch/TextInputDialog.qml @@ -28,10 +28,17 @@ Dialog { property string buttonText property string placeholderText property string text + property bool pasteOnLoad: false property var callback contentHeight: contentColumn.height + Component.onCompleted: { + if (pasteOnLoad) { + input.paste(); + } + } + function accept() { textInputDialog.callback(input.text); textInputDialog.closePage();