fixed title and button alignment in maximized mode
svn path=/trunk/KDE/kdebase/workspace/; revision=1051237
This commit is contained in:
parent
715cafd660
commit
84e7363aa0
2 changed files with 9 additions and 1 deletions
|
@ -191,12 +191,14 @@ namespace Oxygen
|
||||||
else palette.setCurrentColorGroup(QPalette::Inactive);
|
else palette.setCurrentColorGroup(QPalette::Inactive);
|
||||||
QColor color = palette.window().color();
|
QColor color = palette.window().color();
|
||||||
|
|
||||||
// translate buttons up if window maximized
|
|
||||||
if(
|
if(
|
||||||
client_.compositingActive() &&
|
client_.compositingActive() &&
|
||||||
!( client_.isMaximized() || type_ == ButtonItemClose || type_ == ButtonItemMenu ) )
|
!( client_.isMaximized() || type_ == ButtonItemClose || type_ == ButtonItemMenu ) )
|
||||||
{ painter.translate( 0, -1 ); }
|
{ painter.translate( 0, -1 ); }
|
||||||
|
|
||||||
|
// translate buttons down if window maximized
|
||||||
|
if( client_.isMaximized() ) painter.translate( 0, 1 );
|
||||||
|
|
||||||
// base button color
|
// base button color
|
||||||
QColor bt = ((type_ == ButtonItemClose && forceInactive_ ) ? client_.backgroundPalette( this, palette ):palette).window().color();
|
QColor bt = ((type_ == ButtonItemClose && forceInactive_ ) ? client_.backgroundPalette( this, palette ):palette).window().color();
|
||||||
|
|
||||||
|
|
|
@ -851,6 +851,9 @@ namespace Oxygen
|
||||||
Qt::Alignment alignment( configuration().titleAlignment() | Qt::AlignVCenter );
|
Qt::Alignment alignment( configuration().titleAlignment() | Qt::AlignVCenter );
|
||||||
QString local( QFontMetrics( painter->font() ).elidedText( caption, Qt::ElideRight, rect.width() ) );
|
QString local( QFontMetrics( painter->font() ).elidedText( caption, Qt::ElideRight, rect.width() ) );
|
||||||
|
|
||||||
|
// translate title down in case of maximized window
|
||||||
|
if( isMaximized() ) painter->translate( 0, 2 );
|
||||||
|
|
||||||
if( contrast.isValid() )
|
if( contrast.isValid() )
|
||||||
{
|
{
|
||||||
painter->setPen( contrast );
|
painter->setPen( contrast );
|
||||||
|
@ -862,6 +865,9 @@ namespace Oxygen
|
||||||
painter->setPen( color );
|
painter->setPen( color );
|
||||||
painter->drawText( rect, alignment, local );
|
painter->drawText( rect, alignment, local );
|
||||||
|
|
||||||
|
// translate back
|
||||||
|
if( isMaximized() ) painter->translate( 0, -2 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//_______________________________________________________________________
|
//_______________________________________________________________________
|
||||||
|
|
Loading…
Reference in a new issue