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`
consider an applet acceptable for the formfactor if at least one
of its formfactors are contained in KDeclarative::runtimePlatform
or if either KDeclarative::runtimePlatform or applet formfactors
are empty.
(before informFactor failed if even one of the applet supported
formfactors was not in runtimePlatform
BUG:433983
ToolButton should not be used in shared component since it's clints
might have different representation.
Instead, make the component have no visual representation at all,
delegating it to clients themselves.
New error:
/usr/share/plasma/plasmoids/org.kde.plasma.keyboardlayout/contents/ui/
main.qml:17:5: Unable to assign [undefined] to QString
This is because just string is returned and not an object.
The expression should always return struct with proper fields instead.
it was technically possible for geometries to not be integer, but
a string to int parse was done, so teoretically string.toInt() can
fail and reset position/size of the plasmoid.
It may be the cause of some of the positions lost bugs.
This was particularly evident and triggerable in plasma mobile.
on palsma mobile side was also fixed by making suire the grid size is
always int, however technically the bug is here too as well
handles have to pop up on any background, as they will be on top of the wallpaper
adding a super light gradient which reminds breeze buttons, contrast pixel and
a shadow makes it easier for it to not get lost
onWheel is a bit messy with trackpads. It we just compare > 0 our scroll
rate is effectively determined by the refresh rate of the device. Use of
120 "wheels" is a common pattern used elsewhere.
Code is effectively copied from plasma-pa
The switch to previous/next direction I copied what was existing.
Return "layout" and "layoutsList" Properties where all layouts names are
now stored.
getLayoutLongName() DBus method is not used any more so it was also
deleted from DBus API in KWin and P-D, see corresponding commits there.
The Properties interface allows QML code be more declarative.
There is a trade-off though as now we have to:
- store all layout names on client side, even if it's not needed for
base QML layout component here
- duplicate layouts in layoutsList Property as they are also stored in
Action objects of the plasmoid in P-D.
Rework DBus API - getLayoutsList() now provides full details about the
layouts.
Remove Q_PROPERTY's as they are not make much sense here.
Port to a fully event-driven interface towards QML.
When rotated most applets, especially text look garbage.
If we render into an offscreen buffer we can smooth things out and it
looks good again. There is a performance penalty to this, but most
people do no not rotate plasmoids.
A new instance WidgetExplorer is created everytime we open get new
applets window. Each and every instance of WidgetExplorer has its own
newStuffDialog. This means that downloadWidgets method will always
create new instance of QtQuickDialogWrapper due to the default value of
newStuffDialog is null.
Change newStuffDialog to static so that it will be shared to every
instances of WidgetExplorer. This prevents another get new applets
window to be opened.
BUG: 412765
The QWidgets components are about to be deprecated
and the QtQuick dialog has a bunch of visual improvements.
Considering that most KCMs already use the QtQuick components
this MR improves the consistency.
See https://invent.kde.org/frameworks/knewstuff/-/merge_requests/80
for the MR which introduced the non-deprecated dialog class.