Summary:
Plasma's OSDs for volume/screens etc use PlasmaExtras.Heading, this
should to.
Also correct centering text to constrain the text element and align the
text within that bounding box. Previous code could have overflown in the
event of a really really long desktop name if we're resizing to the
grid.
BUG: 356600
Test Plan:
Switched desktop with OSD on
Tried with and without "show desktop layout indicators"
Reviewers: #kwin, graesslin
Reviewed By: #kwin, graesslin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D16420
A declarative KWin script needs to register the QQuickWindows it is
using in the KWin object. This method ensures that the QQuickWindow
will destroy the platfrom window once it gets hidden. So the next
time the QQuickWindow is shown a new platform window is created.
As can be seen in the OSD this is not really nice, therefore a
KWin.Dialog should be created which takes care of these steps.
The complete dialog is moved into a Loader item and it gets loaded on
first change of virtual desktop. This change should result in less
parsing on startup and moving the cost of the loading to the time when
its really needed.
REVIEW: 109639
* no more binding loops - yeah for anchoring
* properly update sizes when switching screens
* properly handle case layout indicator enabled/disabled
* connect to desktop changed and reset desktop model
* set a maximum width/height of 0.8 of screen
Most interesting change is the moving of
visible = true;
to the beginning of the block which updates the layout. Without that
all the changes are ignored resulting in the incorrect size on screen
change.
The disadvantage of that is that the OSD is shown before the layout is
adjusted. But it's considerable minor given that it should be just one
frame.
BUG: 312728
BUG: 312727
BUG: 305737
FIXED-IN: 4.10.1
REVIEW: 108945
This QML based version of the desktop change OSD is intended to
replace the C++ version of it.
It currently supports all of the features except adjusting to config
options, which is not yet available at all to scripts.