Off-by-one fix for resizebar.
Hide resizebar when window is fixed size. svn path=/trunk/kdebase/kwin/; revision=91783
This commit is contained in:
parent
2cac00359f
commit
352086d08b
1 changed files with 39 additions and 22 deletions
|
@ -128,7 +128,10 @@ Manager::Manager(
|
||||||
midLayout->addWidget(windowWrapper());
|
midLayout->addWidget(windowWrapper());
|
||||||
midLayout->addSpacing(1);
|
midLayout->addSpacing(1);
|
||||||
|
|
||||||
l->addSpacing(Static::instance()->resizeHeight());
|
if (isResizable())
|
||||||
|
l->addSpacing(Static::instance()->resizeHeight());
|
||||||
|
else
|
||||||
|
l->addSpacing(1);
|
||||||
|
|
||||||
connect(options, SIGNAL(resetClients()), this, SLOT(slotReset()));
|
connect(options, SIGNAL(resetClients()), this, SLOT(slotReset()));
|
||||||
}
|
}
|
||||||
|
@ -172,21 +175,28 @@ Manager::paintEvent(QPaintEvent * e)
|
||||||
|
|
||||||
// Resize bar.
|
// Resize bar.
|
||||||
|
|
||||||
int rbt = height() - Static::instance()->resizeHeight(); // Resize bar top.
|
if (isResizable())
|
||||||
|
{
|
||||||
|
int rbt = height() - Static::instance()->resizeHeight(); // Resize bar top.
|
||||||
|
|
||||||
bitBlt(this, 0, rbt, &(s->resize(active)));
|
bitBlt(this, 0, rbt, &(s->resize(active)));
|
||||||
bitBlt(this, 30, rbt, &(s->resizeMidLeft(active)));
|
bitBlt(this, 30, rbt, &(s->resizeMidLeft(active)));
|
||||||
|
|
||||||
p.drawTiledPixmap(
|
p.drawTiledPixmap(
|
||||||
32,
|
32,
|
||||||
rbt,
|
rbt,
|
||||||
width() - 34,
|
width() - 34,
|
||||||
Static::instance()->resizeHeight(),
|
Static::instance()->resizeHeight(),
|
||||||
s->resizeMidMid(active)
|
s->resizeMidMid(active)
|
||||||
);
|
);
|
||||||
|
|
||||||
bitBlt(this, width() - 32, rbt, &(s->resizeMidRight(active)));
|
bitBlt(this, width() - 32, rbt, &(s->resizeMidRight(active)));
|
||||||
bitBlt(this, width() - 30, rbt, &(s->resize(active)));
|
bitBlt(this, width() - 30, rbt, &(s->resize(active)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p.drawLine(1, height() - 1, width() - 2, height() - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -292,19 +302,26 @@ Manager::updateTitleBuffer()
|
||||||
p.drawPixmap(tr.width() - 3, 0, s->titleTextRight(active));
|
p.drawPixmap(tr.width() - 3, 0, s->titleTextRight(active));
|
||||||
}
|
}
|
||||||
|
|
||||||
KWinInternal::Client::MousePosition
|
KWinInternal::Client::MousePosition
|
||||||
Manager::mousePosition(const QPoint & p) const
|
Manager::mousePosition(const QPoint & p) const
|
||||||
{
|
{
|
||||||
MousePosition m = Center;
|
MousePosition m = Center;
|
||||||
|
|
||||||
if (p.y() > (height() - Static::instance()->resizeHeight())) {
|
// Off-by-one here ?
|
||||||
// Keep order !
|
|
||||||
if (p.x() >= (width() - 30))
|
if (isResizable())
|
||||||
m = BottomRight;
|
{
|
||||||
else if (p.x() <= 30)
|
if (p.y() > (height() - (Static::instance()->resizeHeight() + 1)))
|
||||||
m = BottomLeft;
|
{
|
||||||
else
|
// Keep order !
|
||||||
m = Bottom;
|
|
||||||
|
if (p.x() >= (width() - 30))
|
||||||
|
m = BottomRight;
|
||||||
|
else if (p.x() <= 30)
|
||||||
|
m = BottomLeft;
|
||||||
|
else
|
||||||
|
m = Bottom;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
|
|
Loading…
Reference in a new issue