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);
|
||||
QColor color = palette.window().color();
|
||||
|
||||
// translate buttons up if window maximized
|
||||
if(
|
||||
client_.compositingActive() &&
|
||||
!( client_.isMaximized() || type_ == ButtonItemClose || type_ == ButtonItemMenu ) )
|
||||
{ painter.translate( 0, -1 ); }
|
||||
|
||||
// translate buttons down if window maximized
|
||||
if( client_.isMaximized() ) painter.translate( 0, 1 );
|
||||
|
||||
// base button 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 );
|
||||
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() )
|
||||
{
|
||||
painter->setPen( contrast );
|
||||
|
@ -862,6 +865,9 @@ namespace Oxygen
|
|||
painter->setPen( color );
|
||||
painter->drawText( rect, alignment, local );
|
||||
|
||||
// translate back
|
||||
if( isMaximized() ) painter->translate( 0, -2 );
|
||||
|
||||
}
|
||||
|
||||
//_______________________________________________________________________
|
||||
|
|
Loading…
Reference in a new issue