A decoration can provide the AbilityAnnounceAlphaChannel in addition to
AbilityUsesAlphaChannel. If this ability is provided the decoration can
enable/disable the use of the alpha channel through setAlphaEnabled().
The base idea behind this mechanism is to be able to tell the compositor
that currently alpha is not needed. An example is the maximized state in
which the decoration is fully opaque so that there is no need to use the
translucency code path which would render all windows behind the deco.
In addition also the blur effect honors this setting so that behind a
known opaque decoration no blurring is performed.
Oxygen is adjusted to disable translucency in maximized state and Aurorae
is adjusted to allow themes to enable/disable translucency. For Plastik
translucency and with that also blurring is disabled.
REVIEW: 106810
Disable animations till the decoration is completel loaded. This
ensures that the buttons do not flicker because of the animation from
black to their respective color.
A component has the advantage that the width property can depend from
other properties. This does not work with the previous on the fly
construction as the width does not update when the referenced property
changes.
In the maximized state the enabled borders were still enabled causing
the actual borders to be still shown. In addition the padding is not
adjusted to be 0. This is done in the C++ part is it does not make any
sense to have shadows being thrown to another screen for a maximized
window.
REVIEW: 106576
BUG: 307365
FIXED-IN: 4.9.2
Adding a KConfigXT xml file and an ui file to configure the QML
variant of Plastik.
Currently supported options:
* title alignment
* title shadow
* animation of buttons
Missing option:
* colored borders
For each theme the setting can be enabled individually with the
default being enabled by default. It is completely handled
inside the MenuButton QML component so each QML theme benefits
from the option automatically, too.
BUG: 301327
FIXED-IN: 4.10
REVIEW: 106160
The Plastik decoration buttons are provided by a declarative
extension plugin as the canvas drawing API would be needed to
draw these buttons. This should be changed with Qt 5.
But it's also a nice example to show how a QML based decoration
can have an extension in C++.
When the decoration is reset a signal is emitted that the config
might have changed which the decoration can connect to for
reloading its configuration. For this an invokable method is
added to Aurorae allowing to read a config value which just
returns the QVariant.
Proper support for border sizes are added by providing the enum
in DecorationOptions, so that QML themes can use the enum values
to decide which border size to use.
The kcm is adjusted to also support these config mechanisms and
to properly load and save the border sizes for QML based themes.
On change of theme recreate all decorations and create a new
declarative engine and component which is basically a re-init
of the Factory.
There are too many differences between themes - especially when
switching between an old SVG based Aurorae and a new QML based
Aurorae theme.
The generic QML components from Aurorae are split out into an
own declarative plugin. In addition two new helper classes are
added to this plugin:
* A ColorHelper to map a few function of KColorSheme and making
it possible to actually work with colors in QML. The need
emerged from trying to port Plastik to QML which makes strong
use of color shading.
* A DecorationOptions class which is a wrapper around KWin's
KDecorationOptions but in a more useable way for QML. The
various options are provided as properties and the value of
the properties changes automatically depending on whether the
decoration is active or inactive.
Aurorae itself is not yet adjusted to these changes, but it
should also be adjusted as some of the options are currently
exported in the factory and the factory is injected into the
Aurorae QML decoration.
The result of maximizing a window might be the decoration
going away. Because of that we need to delay the handling of
maximize and title bar double click by one cycle as had been
done for other close operations in 0fea5325
BUG: 304870
FIXED-IN: 4.9.1
REVIEW: 105961
Accepting the mouse events breaks moving the window by dragging
the title bar. The reason is that it eats the mouse event and
by that never reaches KWin core to perform the movement.
Other mouse buttons need to be accepted for handling the window
operations. Also we need to listen in general to left mouse
button for the double click operation.
BUG: 304249
FIXED-IN: 4.9.1
REVIEW: 105784
Unfortunately QtQuick 1 does not provide a way to receive Wheel
events. But the window decoration needs to pass wheel events on
the titlebar to KWin core.
In order to process also Wheel Events in Aurorae an event
filter is installed on the widget and in case the mouse positon
is on the title bar the titlebarMouseWheelOperation is invoked.
BUG: 304248
FIXED-IN: 4.9.1
REVIEW: 105801