Verified Commit cb4d53bd authored by Fushan Wen's avatar Fushan Wen
Browse files

applets/clipboard: Focus on text area when transition is done

parent 94a8edcb
Pipeline #141071 passed with stage
in 10 minutes and 56 seconds
......@@ -5,6 +5,7 @@
*/
import QtQuick 2.0
import QtQuick.Controls 2.15 as QQC2 // For StackView
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
......@@ -31,16 +32,18 @@ ColumnLayout {
done();
}
Component.onCompleted: {
textArea.forceActiveFocus();
textArea.cursorPosition = textArea.text.length;
}
function done() {
// The modified item will be pushed to the top, and we would like to highlight the real first item
Qt.callLater(() => {stack.initialItem.view.currentIndex = 0;});
}
QQC2.StackView.onStatusChanged: {
if (QQC2.StackView.status === QQC2.StackView.Active) {
textArea.forceActiveFocus();
textArea.cursorPosition = textArea.text.length;
}
}
PlasmaComponents3.ScrollView {
Layout.fillWidth: true
Layout.fillHeight: true
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment