use standard colormap (to support themes better) in classic style

svn path=/trunk/kdebase/kwin/; revision=33383
This commit is contained in:
Matthias Ettrich 1999-11-10 01:18:56 +00:00
parent 8824421c5e
commit ec0c1a1a5c

View file

@ -224,6 +224,7 @@ StdClient::StdClient( Workspace *ws, WId w, QWidget *parent, const char *name )
hb->addWidget( button[5] ); hb->addWidget( button[5] );
for ( int i = 0; i < 6; i++) { for ( int i = 0; i < 6; i++) {
button[i]->setBackgroundMode( PaletteBackground );
button[i]->setMouseTracking( TRUE ); button[i]->setMouseTracking( TRUE );
button[i]->setFixedSize( 20, 20 ); button[i]->setFixedSize( 20, 20 );
} }
@ -262,7 +263,7 @@ void StdClient::resizeEvent( QResizeEvent* e)
QPainter p( this ); QPainter p( this );
r = rr.subtract( t ); r = rr.subtract( t );
p.setClipRegion( r ); p.setClipRegion( r );
p.eraseRect( rect() ); p.fillRect( rect(), colorGroup().brush( QColorGroup::Background ) );
} }
} }
@ -293,20 +294,18 @@ void StdClient::paintEvent( QPaintEvent* )
{ {
QPainter p( this ); QPainter p( this );
QRect t = titlebar->geometry(); QRect t = titlebar->geometry();
t.setTop( 0 );
QRegion r = rect(); QRegion r = rect();
r = r.subtract( t ); r = r.subtract( t );
p.setClipRegion( r ); p.setClipRegion( r );
qDrawWinPanel( &p, rect(), options->colorGroup(Options::Frame, isActive())); qDrawWinPanel( &p, rect(), colorGroup() );
p.setClipping( FALSE ); t.setTop( 1 );
p.setClipRegion( t );
t.setTop( 0 );
p.fillRect( t, options->color(Options::TitleBar, isActive())); p.fillRect( t, options->color(Options::TitleBar, isActive()));
QBrush b( options->color( Options::TitleBar, isActive() ) );
qDrawShadePanel( &p, t.x(), t.y(), t.width(), t.height(), qDrawShadePanel( &p, t.x(), t.y(), t.width(), t.height(),
options->colorGroup(Options::Frame, isActive()), true, 1, &b ); colorGroup(), true, 1 );
t.setLeft( t.left() + 4 ); t.setLeft( t.left() + 4 );
t.setRight( t.right() - 2 ); t.setRight( t.right() - 2 );
p.setPen(options->color(Options::Font, isActive())); p.setPen(options->color(Options::Font, isActive()));
p.setFont(options->font(isActive())); p.setFont(options->font(isActive()));
p.drawText( t, AlignLeft|AlignVCenter, caption() ); p.drawText( t, AlignLeft|AlignVCenter, caption() );