Fixed some silliness.
Removed more layout code. svn path=/trunk/kdebase/kwin/; revision=49145icc-effect-5.14.5
parent
baa151afb3
commit
0d91340735
|
@ -183,6 +183,16 @@ Manager::activateLayout()
|
||||||
_updateLayout();
|
_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
|
} // End namespace
|
||||||
|
|
||||||
// vim:ts=2:sw=2:tw=78
|
// vim:ts=2:sw=2:tw=78
|
||||||
|
|
|
@ -35,8 +35,6 @@ class Manager : public Client
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
friend class TitleText;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Manager(Workspace *, WId, QWidget * parent = 0, const char * name = 0);
|
Manager(Workspace *, WId, QWidget * parent = 0, const char * name = 0);
|
||||||
|
@ -44,6 +42,8 @@ class Manager : public Client
|
||||||
|
|
||||||
void setShade(bool);
|
void setShade(bool);
|
||||||
|
|
||||||
|
void fakeMouseEvent(QMouseEvent *, QWidget *);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void maximiseChanged(bool);
|
void maximiseChanged(bool);
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
Boston, MA 02111-1307, USA.
|
Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <qlayout.h>
|
|
||||||
|
|
||||||
#include "ResizeBar.h"
|
#include "ResizeBar.h"
|
||||||
#include "ResizeMid.h"
|
#include "ResizeMid.h"
|
||||||
#include "ResizeSide.h"
|
#include "ResizeSide.h"
|
||||||
|
@ -41,11 +39,7 @@ ResizeBar::ResizeBar(QWidget * parent, Manager * client)
|
||||||
mid_ = new ResizeMid(this, client_);
|
mid_ = new ResizeMid(this, client_);
|
||||||
right_ = new ResizeSide(this, client_, ResizeSide::Right);
|
right_ = new ResizeSide(this, client_, ResizeSide::Right);
|
||||||
|
|
||||||
QHBoxLayout * layout = new QHBoxLayout(this);
|
mid_->move(30, 0);
|
||||||
|
|
||||||
layout->addWidget(left_);
|
|
||||||
layout->addWidget(mid_, 1);
|
|
||||||
layout->addWidget(right_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -56,6 +50,13 @@ ResizeBar::updateDisplay()
|
||||||
right_->updateDisplay();
|
right_->updateDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ResizeBar::resizeEvent(QResizeEvent *)
|
||||||
|
{
|
||||||
|
mid_->resize(width() - 60, 10);
|
||||||
|
right_->move(width() - 30, 0);
|
||||||
|
}
|
||||||
|
|
||||||
} // End namespace
|
} // End namespace
|
||||||
|
|
||||||
// vim:ts=2:sw=2:tw=78
|
// vim:ts=2:sw=2:tw=78
|
||||||
|
|
|
@ -42,6 +42,10 @@ class ResizeBar : public QWidget
|
||||||
ResizeBar(QWidget * parent, Manager * client);
|
ResizeBar(QWidget * parent, Manager * client);
|
||||||
void updateDisplay();
|
void updateDisplay();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
void resizeEvent(QResizeEvent *);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Manager * client_;
|
Manager * client_;
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include <qpainter.h>
|
#include <qpainter.h>
|
||||||
|
|
||||||
#include "../../options.h"
|
#include "../../options.h"
|
||||||
#include "../../workspace.h"
|
|
||||||
|
|
||||||
#include "TitleText.h"
|
#include "TitleText.h"
|
||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
|
@ -68,25 +67,25 @@ TitleText::updatePixmap()
|
||||||
void
|
void
|
||||||
TitleText::mousePressEvent(QMouseEvent * e)
|
TitleText::mousePressEvent(QMouseEvent * e)
|
||||||
{
|
{
|
||||||
client_->mousePressEvent(e);
|
client_->fakeMouseEvent(e, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TitleText::mouseReleaseEvent(QMouseEvent * e)
|
TitleText::mouseReleaseEvent(QMouseEvent * e)
|
||||||
{
|
{
|
||||||
client_->mouseReleaseEvent(e);
|
client_->fakeMouseEvent(e, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TitleText::mouseMoveEvent(QMouseEvent * e)
|
TitleText::mouseMoveEvent(QMouseEvent * e)
|
||||||
{
|
{
|
||||||
client_->mouseMoveEvent(e);
|
client_->fakeMouseEvent(e, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TitleText::mouseDoubleClickEvent(QMouseEvent * e)
|
TitleText::mouseDoubleClickEvent(QMouseEvent * e)
|
||||||
{
|
{
|
||||||
client_->mouseDoubleClickEvent(e);
|
client_->fakeMouseEvent(e, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End namespace
|
} // End namespace
|
||||||
|
|
Loading…
Reference in New Issue