Properly account for window's shaded state, and number of clients in groups when deciding whether or

not the titlebar should be hidden. This is half the job, cause the above does not work (yet) when 
grouping windows among which one has hidden titlebar. Shading works well now, though.

CCBUG: 260815

svn path=/trunk/KDE/kdebase/workspace/; revision=1208187
This commit is contained in:
Hugo Pereira Da Costa 2010-12-20 22:18:52 +00:00
parent f55d275c61
commit 796e7ff92a
3 changed files with 19 additions and 9 deletions

View file

@ -170,7 +170,7 @@ namespace Oxygen
void Button::paintEvent(QPaintEvent *event)
{
if( client_.configuration().hideTitleBar() ) return;
if( client_.hideTitleBar() ) return;
QPainter painter(this);
painter.setClipRect(this->rect().intersected( event->rect() ) );

View file

@ -240,7 +240,7 @@ namespace Oxygen
if( configuration().frameBorder() == Configuration::BorderNone && !isShade() )
{
if( configuration().hideTitleBar() ) mask = QRegion();
if( hideTitleBar() ) mask = QRegion();
else if( compositingActive() ) mask = (configuration().shadowMode() == Configuration::OxygenShadows ) ? QRegion():helper().decoRoundedMask( frame, 1, 1, 1, 0 );
else mask = helper().roundedMask( frame, 1, 1, 1, 0 );
@ -262,7 +262,7 @@ namespace Oxygen
const bool maximized( isMaximized() );
const bool narrowSpacing( configuration().useNarrowButtonSpacing() );
const int frameBorder( configuration().frameBorder() );
const int buttonSize( configuration().hideTitleBar() ? 0 : configuration().buttonSize() );
const int buttonSize( hideTitleBar() ? 0 : configuration().buttonSize() );
switch (lm)
{
@ -302,7 +302,7 @@ namespace Oxygen
case LM_TitleEdgeTop:
{
int border = 0;
if( frameBorder == Configuration::BorderNone && configuration().hideTitleBar() )
if( frameBorder == Configuration::BorderNone && hideTitleBar() )
{
border = 0;
@ -532,7 +532,7 @@ namespace Oxygen
const int offset = layoutMetric( LM_OuterPaddingTop );
int height = 64 - Configuration::ButtonDefault;
if( !configuration().hideTitleBar() ) height += configuration().buttonSize();
if( !hideTitleBar() ) height += configuration().buttonSize();
const QWidget* window( isPreview() ? this->widget() : widget->window() );
helper().renderWindowBackground(painter, rect, widget, window, palette, offset, height );
@ -1389,7 +1389,7 @@ namespace Oxygen
painter.restore();
}
if( !configuration().hideTitleBar() )
if( !hideTitleBar() )
{
// title bounding rect
@ -1469,7 +1469,7 @@ namespace Oxygen
{
// check button and distance to drag point
if( configuration().hideTitleBar() || mouseButton_ == Qt::NoButton || ( event->pos() - dragPoint_ ).manhattanLength() <= QApplication::startDragDistance() )
if( hideTitleBar() || mouseButton_ == Qt::NoButton || ( event->pos() - dragPoint_ ).manhattanLength() <= QApplication::startDragDistance() )
{ return false; }
bool accepted( false );
@ -1552,7 +1552,7 @@ namespace Oxygen
{
// check if drag enter is allowed
if( !event->mimeData()->hasFormat( clientGroupItemDragMimeType() ) || configuration().hideTitleBar() ) return false;
if( !event->mimeData()->hasFormat( clientGroupItemDragMimeType() ) || hideTitleBar() ) return false;
//
event->acceptProposedAction();

View file

@ -38,6 +38,7 @@
#include <kcommondecoration.h>
#include <QtCore/QBasicTimer>
#include <QtCore/QTextStream>
#include <QtCore/QTimerEvent>
@ -109,6 +110,15 @@ namespace Oxygen
}
//! true if titlebar is hidden
bool hideTitleBar( void ) const
{
return
configuration().hideTitleBar() &&
!isShade() &&
clientGroupItems().count() == 1;
}
//@}
//! window shape
@ -333,7 +343,7 @@ namespace Oxygen
useAnimations() &&
configuration().animateTitleChange() &&
!configuration().drawTitleOutline() &&
!configuration().hideTitleBar() &&
!hideTitleBar() &&
!isPreview();
}