Fixed some silliness.

Removed more layout code.

svn path=/trunk/kdebase/kwin/; revision=49145
This commit is contained in:
Rik Hemsley 2000-05-11 04:17:35 +00:00
parent baa151afb3
commit 0d91340735
5 changed files with 28 additions and 14 deletions

View file

@ -183,6 +183,16 @@ Manager::activateLayout()
_updateLayout();
}
void
Manager::fakeMouseEvent(QMouseEvent * e, QWidget * w)
{
QPoint adjustedPos = w->pos() + e->pos();
QMouseEvent fake(e->type(), adjustedPos, e->button(), e->state());
Client::event(&fake);
}
} // End namespace
// vim:ts=2:sw=2:tw=78

View file

@ -35,8 +35,6 @@ class Manager : public Client
{
Q_OBJECT
friend class TitleText;
public:
Manager(Workspace *, WId, QWidget * parent = 0, const char * name = 0);
@ -44,6 +42,8 @@ class Manager : public Client
void setShade(bool);
void fakeMouseEvent(QMouseEvent *, QWidget *);
signals:
void maximiseChanged(bool);

View file

@ -20,8 +20,6 @@
Boston, MA 02111-1307, USA.
*/
#include <qlayout.h>
#include "ResizeBar.h"
#include "ResizeMid.h"
#include "ResizeSide.h"
@ -41,11 +39,7 @@ ResizeBar::ResizeBar(QWidget * parent, Manager * client)
mid_ = new ResizeMid(this, client_);
right_ = new ResizeSide(this, client_, ResizeSide::Right);
QHBoxLayout * layout = new QHBoxLayout(this);
layout->addWidget(left_);
layout->addWidget(mid_, 1);
layout->addWidget(right_);
mid_->move(30, 0);
}
void
@ -56,6 +50,13 @@ ResizeBar::updateDisplay()
right_->updateDisplay();
}
void
ResizeBar::resizeEvent(QResizeEvent *)
{
mid_->resize(width() - 60, 10);
right_->move(width() - 30, 0);
}
} // End namespace
// vim:ts=2:sw=2:tw=78

View file

@ -42,6 +42,10 @@ class ResizeBar : public QWidget
ResizeBar(QWidget * parent, Manager * client);
void updateDisplay();
protected:
void resizeEvent(QResizeEvent *);
private:
Manager * client_;

View file

@ -23,7 +23,6 @@
#include <qpainter.h>
#include "../../options.h"
#include "../../workspace.h"
#include "TitleText.h"
#include "Manager.h"
@ -68,25 +67,25 @@ TitleText::updatePixmap()
void
TitleText::mousePressEvent(QMouseEvent * e)
{
client_->mousePressEvent(e);
client_->fakeMouseEvent(e, this);
}
void
TitleText::mouseReleaseEvent(QMouseEvent * e)
{
client_->mouseReleaseEvent(e);
client_->fakeMouseEvent(e, this);
}
void
TitleText::mouseMoveEvent(QMouseEvent * e)
{
client_->mouseMoveEvent(e);
client_->fakeMouseEvent(e, this);
}
void
TitleText::mouseDoubleClickEvent(QMouseEvent * e)
{
client_->mouseDoubleClickEvent(e);
client_->fakeMouseEvent(e, this);
}
} // End namespace