Improved titlebar buffering.
Are these commits going into the KDE2.1final, or do I need to do something special? svn path=/trunk/kdebase/kwin/; revision=81613
This commit is contained in:
parent
7a9862f4ee
commit
5f356d8628
2 changed files with 16 additions and 2 deletions
|
@ -290,9 +290,18 @@ KWMThemeClient::KWMThemeClient( Workspace *ws, WId w, QWidget *parent,
|
|||
setBackgroundMode(NoBackground);
|
||||
}
|
||||
|
||||
void KWMThemeClient::drawTitle(QPainter &p)
|
||||
void KWMThemeClient::drawTitle(QPainter &dest)
|
||||
{
|
||||
QRect r = titlebar->geometry();
|
||||
QRect titleRect = titlebar->geometry();
|
||||
QRect r(0, 0, titleRect.width(), titleRect.height());
|
||||
QPixmap buffer;
|
||||
|
||||
if(buffer.width() == r.width())
|
||||
return;
|
||||
|
||||
buffer.resize(r.size());
|
||||
QPainter p;
|
||||
p.begin(&buffer);
|
||||
|
||||
if(titleSunken){
|
||||
qDrawShadeRect(&p, r, options->colorGroup(Options::Frame, isActive()),
|
||||
|
@ -324,8 +333,12 @@ void KWMThemeClient::drawTitle(QPainter &p)
|
|||
r.setLeft(r.left()+5);
|
||||
r.setRight(r.right()-5);
|
||||
p.drawText(r, titleAlign, caption());
|
||||
p.end();
|
||||
|
||||
dest.drawPixmap(titleRect.x(), titleRect.y(), buffer);
|
||||
}
|
||||
|
||||
|
||||
void KWMThemeClient::resizeEvent( QResizeEvent* e)
|
||||
{
|
||||
Client::resizeEvent( e );
|
||||
|
|
|
@ -40,6 +40,7 @@ protected:
|
|||
protected slots:
|
||||
void slotReset();
|
||||
private:
|
||||
QPixmap buffer;
|
||||
KPixmap *aGradient, *iGradient;
|
||||
MyButton *maxBtn, *stickyBtn;
|
||||
QSpacerItem *titlebar;
|
||||
|
|
Loading…
Reference in a new issue