Shading fixed... unless you really want that animation to work.

svn path=/trunk/kdebase/kwin/; revision=57813
This commit is contained in:
Rik Hemsley 2000-07-18 19:12:13 +00:00
parent 8ab7b1c57f
commit 5573307cfb
3 changed files with 27 additions and 8 deletions

View file

@ -52,6 +52,8 @@ Manager::Manager(
{
setBackgroundMode(NoBackground);
shaded_ = false;
connect(options, SIGNAL(resetClients()), this, SLOT(slotReset()));
titleBar_ = new TitleBar(this);
@ -109,12 +111,6 @@ Manager::_updateDisplay()
resizeBar_->updateDisplay();
}
void
Manager::setShade(bool)
{
// Wait for parent class version to work.
}
void
Manager::paintEvent(QPaintEvent * e)
{
@ -209,13 +205,32 @@ Manager::activateLayout()
void
Manager::fakeMouseEvent(QMouseEvent * e, QWidget * w)
{
qDebug("fakeMouseEvent %d", e->type());
QPoint adjustedPos = w->pos() + e->pos();
if (e->type() == QEvent::MouseButtonDblClick)
toggleShaded();
QMouseEvent fake(e->type(), adjustedPos, e->button(), e->state());
Client::event(&fake);
}
void
Manager::toggleShaded()
{
if (shaded_)
resize(oldSize_);
else {
oldSize_ = size();
resize(width(), Static::instance()->titleHeight() + RESIZE_BAR_HEIGHT);
}
_updateLayout();
shaded_ = !shaded_;
}
} // End namespace
// vim:ts=2:sw=2:tw=78

View file

@ -40,8 +40,6 @@ class Manager : public Client
Manager(Workspace *, WId, QWidget * parent = 0, const char * name = 0);
~Manager();
void setShade(bool);
void fakeMouseEvent(QMouseEvent *, QWidget *);
signals:
@ -64,6 +62,7 @@ class Manager : public Client
void paintEvent(QPaintEvent *);
void resizeEvent(QResizeEvent *);
void activateLayout();
void toggleShaded();
protected slots:
@ -79,6 +78,8 @@ class Manager : public Client
TitleBar * titleBar_;
ResizeBar * resizeBar_;
bool shaded_;
QSize oldSize_;
};
class ToolManager : public Manager

View file

@ -77,18 +77,21 @@ TitleText::updatePixmap()
TitleText::mousePressEvent(QMouseEvent * e)
{
client_->fakeMouseEvent(e, this);
DBWidget::mousePressEvent(e);
}
void
TitleText::mouseReleaseEvent(QMouseEvent * e)
{
client_->fakeMouseEvent(e, this);
DBWidget::mouseReleaseEvent(e);
}
void
TitleText::mouseMoveEvent(QMouseEvent * e)
{
client_->fakeMouseEvent(e, this);
DBWidget::mouseMoveEvent(e);
}
void