Cleaned up a bit.

svn path=/trunk/kdebase/kwin/; revision=357339
This commit is contained in:
Luciano Montanaro 2004-10-24 14:49:26 +00:00
parent 05e9a39a60
commit 6dc8a25ebe

View file

@ -353,9 +353,9 @@ void B2Client::init()
// Left and right border width // Left and right border width
leftSpacer = new QSpacerItem(thickness, 16, leftSpacer = new QSpacerItem(thickness, 16,
QSizePolicy::Minimum, QSizePolicy::Expanding); QSizePolicy::Fixed, QSizePolicy::Expanding);
rightSpacer = new QSpacerItem(thickness, 16, rightSpacer = new QSpacerItem(thickness, 16,
QSizePolicy::Minimum, QSizePolicy::Expanding); QSizePolicy::Fixed, QSizePolicy::Expanding);
g->addItem(leftSpacer, 1, 0); g->addItem(leftSpacer, 1, 0);
g->addColSpacing(1, 16); g->addColSpacing(1, 16);
@ -365,7 +365,7 @@ void B2Client::init()
// Bottom border height // Bottom border height
spacer = new QSpacerItem(10, thickness + (mustDrawHandle() ? 4 : 0), spacer = new QSpacerItem(10, thickness + (mustDrawHandle() ? 4 : 0),
QSizePolicy::Expanding, QSizePolicy::Minimum); QSizePolicy::Expanding, QSizePolicy::Fixed);
g->addItem(spacer, 3, 1); g->addItem(spacer, 3, 1);
// titlebar // titlebar
@ -557,8 +557,8 @@ void B2Client::resizeEvent(QResizeEvent * /*e*/)
/* may be the resize cut off some space occupied by titlebar, which /* may be the resize cut off some space occupied by titlebar, which
was moved, so instead of reducing it, we first try to move it */ was moved, so instead of reducing it, we first try to move it */
titleMoveAbs(bar_x_ofs); titleMoveAbs(bar_x_ofs);
doShape();
doShape();
widget()->repaint(); // the frame is misrendered without this widget()->repaint(); // the frame is misrendered without this
} }
@ -670,8 +670,6 @@ void B2Client::paintEvent(QPaintEvent* e)
} }
} }
#define QCOORDARRLEN(x) sizeof(x) / (sizeof(QCOORD) * 2)
void B2Client::doShape() void B2Client::doShape()
{ {
QRect t = titlebar->geometry(); QRect t = titlebar->geometry();
@ -690,12 +688,10 @@ void B2Client::doShape()
mask -= QRect(width() - 1, height() - 1, 1, 1); //bottom right point mask -= QRect(width() - 1, height() - 1, 1, 1); //bottom right point
if (mustDrawHandle()) { if (mustDrawHandle()) {
mask -= QRect(0, height() - 5, 1, 1); //bottom left point mask -= QRect(0, height() - 5, 1, 1); //bottom left point
mask -= QRect(width() - 1, height() - 1, 1, 1); //bottom right point
mask -= QRect(width() - 40, height() - 1, 1, 1); //handle left point mask -= QRect(width() - 40, height() - 1, 1, 1); //handle left point
mask -= QRect(0, height() - 4, width() - 40, 4); //bottom left mask -= QRect(0, height() - 4, width() - 40, 4); //bottom left
} else { } else {
mask -= QRect(0, height() - 1, 1, 1); // bottom left point mask -= QRect(0, height() - 1, 1, 1); // bottom left point
mask -= QRect(width() - 1, height() - 1, 1, 1); //bottom right point
} }
setMask(mask); setMask(mask);
@ -706,8 +702,6 @@ void B2Client::showEvent(QShowEvent *)
calcHiddenButtons(); calcHiddenButtons();
positionButtons(); positionButtons();
doShape(); doShape();
widget()->repaint();
titlebar->repaint(false);
} }
KDecoration::Position B2Client::mousePosition(const QPoint& p) const KDecoration::Position B2Client::mousePosition(const QPoint& p) const