showPopup() -> popupPosition()
makes possible to move the popup
This commit is contained in:
parent
b958bf1480
commit
19ad72af78
@ -164,18 +164,14 @@ void DialogProxy::setVisible(const bool visible)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogProxy::showPopup(QGraphicsObject *item)
|
QPoint DialogProxy::popupPosition(QGraphicsObject *item) const
|
||||||
{
|
{
|
||||||
if (m_dialog->isVisible()) {
|
Plasma::Corona *corona = qobject_cast<Plasma::Corona *>(item->scene());
|
||||||
m_dialog->hide();
|
if (corona) {
|
||||||
|
return corona->popupPosition(item, m_dialog->size());
|
||||||
} else {
|
} else {
|
||||||
Plasma::Corona *corona = qobject_cast<Plasma::Corona *>(item->scene());
|
return QPoint();
|
||||||
if (corona) {
|
|
||||||
m_dialog->move(corona->popupPosition(item, m_dialog->size()));
|
|
||||||
}
|
|
||||||
m_dialog->show();
|
|
||||||
}
|
}
|
||||||
emit visibleChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QWeakPointer>
|
#include <QWeakPointer>
|
||||||
|
#include <QPoint>
|
||||||
|
|
||||||
class QGraphicsObject;
|
class QGraphicsObject;
|
||||||
|
|
||||||
@ -60,7 +61,7 @@ public:
|
|||||||
int y() const;
|
int y() const;
|
||||||
void setY(int y);
|
void setY(int y);
|
||||||
|
|
||||||
Q_INVOKABLE void showPopup(QGraphicsObject *item);
|
Q_INVOKABLE QPoint popupPosition(QGraphicsObject *item) const;
|
||||||
//FIXME:: Qt::WidgetAttribute should be already
|
//FIXME:: Qt::WidgetAttribute should be already
|
||||||
Q_INVOKABLE void setAttribute(int attribute, bool on);
|
Q_INVOKABLE void setAttribute(int attribute, bool on);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user