remove a bunch of dead code and some dptr member vars thanks to reliance on the kwin effects
svn path=/trunk/KDE/kdelibs/; revision=1022539
This commit is contained in:
parent
01f4349a78
commit
b5d5a9a924
118
dialog.cpp
118
dialog.cpp
@ -68,8 +68,7 @@ public:
|
|||||||
graphicsWidget(0),
|
graphicsWidget(0),
|
||||||
resizeCorners(Dialog::NoCorner),
|
resizeCorners(Dialog::NoCorner),
|
||||||
resizeStartCorner(Dialog::NoCorner),
|
resizeStartCorner(Dialog::NoCorner),
|
||||||
moveTimer(0),
|
moveTimer(0)
|
||||||
hideAnimId(0)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,8 +79,6 @@ public:
|
|||||||
void themeChanged();
|
void themeChanged();
|
||||||
void adjustView();
|
void adjustView();
|
||||||
void updateResizeCorners();
|
void updateResizeCorners();
|
||||||
void progressHide(qreal amount);
|
|
||||||
void progressShow(qreal amount);
|
|
||||||
|
|
||||||
Plasma::Dialog *q;
|
Plasma::Dialog *q;
|
||||||
|
|
||||||
@ -96,8 +93,6 @@ public:
|
|||||||
QMap<Dialog::ResizeCorner, QRect> resizeAreas;
|
QMap<Dialog::ResizeCorner, QRect> resizeAreas;
|
||||||
Dialog::ResizeCorner resizeStartCorner;
|
Dialog::ResizeCorner resizeStartCorner;
|
||||||
QTimer *moveTimer;
|
QTimer *moveTimer;
|
||||||
Direction hideDirection;
|
|
||||||
int hideAnimId;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void DialogPrivate::themeChanged()
|
void DialogPrivate::themeChanged()
|
||||||
@ -261,38 +256,9 @@ Dialog::~Dialog()
|
|||||||
|
|
||||||
void Dialog::paintEvent(QPaintEvent *e)
|
void Dialog::paintEvent(QPaintEvent *e)
|
||||||
{
|
{
|
||||||
QRect target = e->rect();
|
|
||||||
QRect source = target;
|
|
||||||
|
|
||||||
if (d->hideAnimId) {
|
|
||||||
target = rect();
|
|
||||||
source = target;
|
|
||||||
switch (d->hideDirection) {
|
|
||||||
case Plasma::Up:
|
|
||||||
case Plasma::Down: {
|
|
||||||
int bottomMargin = height() - d->view->geometry().bottom();
|
|
||||||
target.setBottom(d->view->viewport()->geometry().bottom() - bottomMargin);
|
|
||||||
source.setTop(-d->view->viewport()->y() + bottomMargin);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Plasma::Right: {
|
|
||||||
target.setLeft(d->view->viewport()->x());
|
|
||||||
source.setRight(target.width() - 1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Plasma::Left: {
|
|
||||||
target.setWidth(d->view->viewport()->geometry().right() - 1);
|
|
||||||
source.setLeft(width() - target.width());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
p.setCompositionMode(QPainter::CompositionMode_Source);
|
p.setCompositionMode(QPainter::CompositionMode_Source);
|
||||||
d->background->paintFrame(&p, target, source);
|
d->background->paintFrame(&p, e->rect(), e->rect());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialog::mouseMoveEvent(QMouseEvent *event)
|
void Dialog::mouseMoveEvent(QMouseEvent *event)
|
||||||
@ -574,7 +540,6 @@ void Dialog::animatedHide(Plasma::Direction direction)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Location location = Desktop;
|
Location location = Desktop;
|
||||||
|
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case Down:
|
case Down:
|
||||||
location = BottomEdge;
|
location = BottomEdge;
|
||||||
@ -593,7 +558,6 @@ void Dialog::animatedHide(Plasma::Direction direction)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Plasma::WindowEffects::slideWindow(this, location);
|
Plasma::WindowEffects::slideWindow(this, location);
|
||||||
|
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,7 +570,6 @@ void Dialog::animatedShow(Plasma::Direction direction)
|
|||||||
|
|
||||||
//copied to not add new api
|
//copied to not add new api
|
||||||
Location location = Desktop;
|
Location location = Desktop;
|
||||||
|
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case Up:
|
case Up:
|
||||||
location = BottomEdge;
|
location = BottomEdge;
|
||||||
@ -624,82 +587,11 @@ void Dialog::animatedShow(Plasma::Direction direction)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Plasma::WindowEffects::slideWindow(this, location);
|
if (KWindowSystem::compositingActive()) {
|
||||||
|
Plasma::WindowEffects::slideWindow(this, location);
|
||||||
|
}
|
||||||
|
|
||||||
show();
|
show();
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void DialogPrivate::progressShow(qreal amount)
|
|
||||||
{
|
|
||||||
//kDebug() << amount;
|
|
||||||
if (qFuzzyCompare(amount, qreal(1.0))) {
|
|
||||||
view->viewport()->move(0, 0);
|
|
||||||
hideAnimId = 0;
|
|
||||||
q->update();
|
|
||||||
q->show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int xtrans = 0;
|
|
||||||
int ytrans = 0;
|
|
||||||
|
|
||||||
switch (hideDirection) {
|
|
||||||
case Plasma::Up:
|
|
||||||
ytrans = (1.0 - amount) * view->height();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Plasma::Down:
|
|
||||||
ytrans = (amount * view->height()) - view->height();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Plasma::Right:
|
|
||||||
xtrans = (amount * view->width()) - view->width();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Plasma::Left:
|
|
||||||
xtrans = (1.0 - amount) * view->width();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
view->viewport()->move(xtrans, ytrans);
|
|
||||||
q->update();
|
|
||||||
q->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DialogPrivate::progressHide(qreal amount)
|
|
||||||
{
|
|
||||||
//kDebug() << amount;
|
|
||||||
if (qFuzzyCompare(amount, qreal(1.0))) {
|
|
||||||
q->hide();
|
|
||||||
view->viewport()->move(0, 0);
|
|
||||||
hideAnimId = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int xtrans = 0;
|
|
||||||
int ytrans = 0;
|
|
||||||
|
|
||||||
switch (hideDirection) {
|
|
||||||
case Plasma::Up:
|
|
||||||
ytrans = -(amount * view->height());
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Plasma::Down:
|
|
||||||
ytrans = amount * view->height();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Plasma::Right:
|
|
||||||
xtrans = amount * view->width();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Plasma::Left:
|
|
||||||
xtrans = -(amount * view->width());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
view->viewport()->move(xtrans, ytrans);
|
|
||||||
q->update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Dialog::inControlArea(const QPoint &point)
|
bool Dialog::inControlArea(const QPoint &point)
|
||||||
|
4
dialog.h
4
dialog.h
@ -90,12 +90,14 @@ class PLASMA_EXPORT Dialog : public QWidget
|
|||||||
/**
|
/**
|
||||||
* Causes an animated hide; requires compositing to work, otherwise
|
* Causes an animated hide; requires compositing to work, otherwise
|
||||||
* the dialog will simply hide.
|
* the dialog will simply hide.
|
||||||
|
* @since 4.3
|
||||||
*/
|
*/
|
||||||
void animatedHide(Plasma::Direction direction);
|
void animatedHide(Plasma::Direction direction);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Causes an animated hide; requires compositing to work, otherwise
|
* Causes an animated hide; requires compositing to work, otherwise
|
||||||
* the dialog will simply hide.
|
* the dialog will simply hide.
|
||||||
|
* @since 4.3
|
||||||
*/
|
*/
|
||||||
void animatedShow(Plasma::Direction direction);
|
void animatedShow(Plasma::Direction direction);
|
||||||
|
|
||||||
@ -142,8 +144,6 @@ class PLASMA_EXPORT Dialog : public QWidget
|
|||||||
* React to theme changes
|
* React to theme changes
|
||||||
*/
|
*/
|
||||||
Q_PRIVATE_SLOT(d, void themeChanged())
|
Q_PRIVATE_SLOT(d, void themeChanged())
|
||||||
Q_PRIVATE_SLOT(d, void progressHide(qreal))
|
|
||||||
Q_PRIVATE_SLOT(d, void progressShow(qreal))
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Plasma namespace
|
} // Plasma namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user