Better support for maximized windows in Aurorae. The theme can include explicit elements for the maximzed area.

Furthermore the SVG is only scaled to the region of the maximzed title rect and not to the complete size of the window.
Theme description updated with a complete section on maximized windows. Yeah I know I should move that to techbase.
FEATURE: 224226

svn path=/trunk/KDE/kdebase/workspace/; revision=1100406
This commit is contained in:
Martin Gräßlin 2010-03-07 13:37:47 +00:00
parent 9ce91afca1
commit 75df855adf
2 changed files with 55 additions and 1 deletions

View file

@ -761,6 +761,20 @@ void AuroraeClient::paintEvent(QPaintEvent *event)
frame->setElementPrefix("decoration-opaque-inactive");
}
}
if (maximized) {
if (frame->hasElementPrefix("decoration-maximized")) {
frame->setElementPrefix("decoration-maximized");
}
if (!isActive() && frame->hasElementPrefix("decoration-maximized-inactive")) {
frame->setElementPrefix("decoration-maximized-inactive");
}
if (!compositingActive() && frame->hasElementPrefix("decoration-maximized-opaque")) {
frame->setElementPrefix("decoration-maximized-opaque");
if (!isActive() && frame->hasElementPrefix("decoration-maximized-opaque-inactive")) {
frame->setElementPrefix("decoration-maximized-opaque-inactive");
}
}
}
// restrict painting on the decoration - no need to paint behind the window
int left, right, top, bottom;
@ -797,6 +811,11 @@ void AuroraeClient::paintEvent(QPaintEvent *event)
rect = QRectF(conf.paddingLeft(), conf.paddingTop(),
widget()->width() - conf.paddingRight(),
widget()->height() - conf.paddingBottom());
if (transparentRect().isNull()) {
rect = QRectF(conf.paddingLeft(), conf.paddingTop(),
widget()->width() - conf.paddingRight(),
layoutMetric(LM_TitleEdgeTop) + layoutMetric(LM_TitleHeight) + layoutMetric(LM_TitleEdgeBottom));
}
}
QRectF sourceRect = rect;
if (!compositingActive()) {
@ -826,10 +845,24 @@ void AuroraeClient::paintEvent(QPaintEvent *event)
frame->setElementPrefix("decoration-opaque");
}
}
if (maximized && frame->hasElementPrefix("decoration-maximized-inactive")) {
frame->setElementPrefix("decoration-maximized-inactive");
if (!isActive()) {
frame->setElementPrefix("decoration-maximized");
}
if (!compositingActive() && frame->hasElementPrefix("decoration-maximized-opaque-inactive")) {
frame->setElementPrefix("decoration-maximized-opaque-inactive");
if (!isActive()) {
frame->setElementPrefix("decoration-maximized-opaque");
}
}
} else if (maximized && frame->hasElementPrefix("decoration-maximized")) {
frame->setElementPrefix("decoration-maximized");
}
frame->resizeFrame(rect.size());
QPixmap result = Plasma::PaintUtils::transition(frame->framePixmap(),
target, m_animationProgress);
painter.drawPixmap(rect.toRect(), result);
painter.drawPixmap(rect.toRect(), result, sourceRect);
} else {
frame->paintFrame(&painter, rect, sourceRect);
}

View file

@ -39,6 +39,27 @@ This opaque decoration is used for generating the window mask. The element prefi
"decoration-opaque" for active and "decoration-opaque-inactive" for inactive windows. The mask is
generated from the active window.
Maximized Windows
-----------------
In order to better support maximized windows there exists a special frame svg called
"decoration-maximized". In the same way as for the general decoration you can specify a version for
inactive, opaque and inactive-opaque. This results in the following names:
* decoration-maximized
* decoration-maximized-inactive
* decoration-maximized-opaque
* decoration-maximized-opaque-inactive
In all cases only the center element will be used. There is no need to specify borders. Please note
that in case of a window with translucent widgets the center element will be stretched to the size
of the complete window.
The following fallback strategy is used: if inactive is not present it falls back to the active.
If opaque is not present it falls back to the translucent. If none of the maximized elements are
present the center element of the decoration is used!
In order to support Fitts' Law all TitleEdge Settings are set to 0. So the buttons will be directly
next to the screen edges. You have the possibility to overwrite these settins (see below).
Buttons
=======
You have to provide a svgz file for each button your theme should contain. If you do not provide a