dismiss dialog close if we are over the dialog at button release
This commit is contained in:
parent
3f73928cf9
commit
4dca0e4d12
|
@ -71,12 +71,16 @@ public:
|
||||||
void mousePressEvent(QMouseEvent *event)
|
void mousePressEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
event->accept();
|
event->accept();
|
||||||
|
m_dialog->view()->winId();
|
||||||
|
KWindowSystem::forceActiveWindow(m_dialog->view()->winId());
|
||||||
}
|
}
|
||||||
|
|
||||||
void mouseReleaseEvent(QMouseEvent *event)
|
void mouseReleaseEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
if (!m_dialog->view()->geometry().contains(event->globalPos())) {
|
||||||
m_dialog->close();
|
m_dialog->close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FullScreenDialog *m_dialog;
|
FullScreenDialog *m_dialog;
|
||||||
|
@ -260,6 +264,11 @@ void FullScreenDialog::setVisible(const bool visible)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QGraphicsView *FullScreenDialog::view() const
|
||||||
|
{
|
||||||
|
return m_view;
|
||||||
|
}
|
||||||
|
|
||||||
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::title()
|
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::title()
|
||||||
{
|
{
|
||||||
if (m_rootObject) {
|
if (m_rootObject) {
|
||||||
|
|
|
@ -54,6 +54,7 @@ public:
|
||||||
bool isVisible() const;
|
bool isVisible() const;
|
||||||
void setVisible(const bool visible);
|
void setVisible(const bool visible);
|
||||||
|
|
||||||
|
QGraphicsView *view() const;
|
||||||
|
|
||||||
//QML properties
|
//QML properties
|
||||||
QDeclarativeListProperty<QGraphicsObject> title();
|
QDeclarativeListProperty<QGraphicsObject> title();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user