This is needed to easier implement a drop animation that smoothly animates a dropped plasmoid
from its drag position to its position on the desktop grid.
Plasma had an entire text editor for the script engine in process.
The method for loading this was very convoluted, it loaded a QML file
(in plasma-desktop!) which contained an Item(!) which then loaded a QML
component that showed a widget dialog.
It also means loading a very heavy lib KTextEditor in ShellComponents
which is very heavy. This will get loaded in things like the logout
greeter, which is super slow on the pinephone.
We already had the concept of evalating a script remotely, we can just
hook up the print statement and move the whole executable out.
Technically this is an API break on the plasmashell DBus API, but
pragmatically going from void -> something on the return type isn't
going to break anything.
The current code tries to load any KTextEditor/Document part using KServiceTypeTrader.
At least on my machine katepart is the only available one.
By loading that one directly and falling back to the existing KTextEdit fallback we can avoid using the deprecated KServiceTypeTrader
It's mostly useful to be able to hide the virtual keyboard like we do in
Plasma Mobile from the bottom panel, should probably replace the SNI
from KWin.
If the widget background provides a mask, put behind the background a blurred version of the wallpaper, cutted into shape by the opacity mask provided by the theme.
Use the system's virtual keyboard instead of relying on
QtVirtualKeyboard specifically for the lock screen.
It means less code (when we can remove the virtual keyboard part),
better integration and one dependency less.
The containment property is assigned from qml so it can be bull. Also, if this component is used in a plasmoid that can run also in normal applet mode (i.e. folderview) it will be null in that case.
if we don't have a containment assigned yet, just do nothing in the signal handlers as they are supposed to read and write from the containment config
BUG:436041
Use a single timer instead of two and use flags for events that can
lead to a relayout. the flags at the moment are size change and config
key for serialization change.
if they happen in the same moment (for instance when the serialization
config key is dependent from the size) if the new key already is saved
consider it correct and don't try to keep the distance to screen edges
from the old layout, ruining the saved one
CCBUG:360478
as disabling editmode will stop dragging, sometimes a drag gets interruped
mid way due to lost of focus.
On Plasma Mobile applets are reparented when dragged, which resets
focus, breaking dragging immediately
When the component is completed the corona startup may not be complete
yet.
This causes a race condition when most of the times when a layout
is created from a lajout.js file, applets geometries don't get correctly
saved.
so reinvoke the save timer when the startup completed signal is emitted
from corona
BUG:433799
The context property version is slower to access and won't be supported
in Qt6. Let's port away from it and use the singleton version instead.
Here was my full process for making this change:
1. Made the change with `find . -name '*.qml' | xargs perl -pi -e 's/units\./PlasmaCore\.Units\./g'`
2. Verified no more occurrences with `grep -r " units."`
3. Made sure this didn't change any comments in a silly way by inspecting the output of `git diff | grep "+ " | grep "//"`
4. Manually inspected the full git diff to make sure there were no other unintentional or silly changes (there were none)
5. verified that all changed files have the PlasmaCore import with the correct name with `for FILE in `git status | grep modified | cut -d ":" -f 3`; do grep -q "as PlasmaCore" $FILE || echo "$FILE needs the PlasmaCore import"; done`