effects/overview: Load desktop name editor on demand

It's most likely going to be unused, so don't bother loading it.
This commit is contained in:
Vlad Zahorodnii 2021-11-12 17:53:23 +02:00
parent 3bebd3dce4
commit b7d0f292f3

View file

@ -197,11 +197,10 @@ Item {
} }
} }
PC3.TextField { Loader {
id: editor active: label.state == "editing"
anchors.fill: parent anchors.fill: parent
visible: label.state == "editing" sourceComponent: PC3.TextField {
focus: visible
topPadding: 0 topPadding: 0
bottomPadding: 0 bottomPadding: 0
text: delegate.desktop.name text: delegate.desktop.name
@ -210,6 +209,8 @@ Item {
label.stopEditing(); label.stopEditing();
} }
Keys.onEscapePressed: label.stopEditing(); Keys.onEscapePressed: label.stopEditing();
Component.onCompleted: forceActiveFocus();
}
} }
states: [ states: [
@ -223,7 +224,6 @@ Item {
function startEditing() { function startEditing() {
state = "editing"; state = "editing";
editor.forceActiveFocus();
} }
function stopEditing() { function stopEditing() {
state = "normal"; state = "normal";