Remove windowFlags property
This is a needless duplication of the property, and it causes bugs. Removing it, and porting all users to the flags property from QWindow magically makes layering and resizability bugs vanish. One problem is left: the dialog dismisses too easily, it should not dismiss when being resized, moved or when a child dialog or QMenu opens from it.
This commit is contained in:
parent
4c17887657
commit
2edebc57c3
@ -52,8 +52,6 @@ DialogProxy::DialogProxy(QQuickItem *parent)
|
|||||||
setColor(QColor(Qt::transparent));
|
setColor(QColor(Qt::transparent));
|
||||||
setFlags(Qt::FramelessWindowHint);
|
setFlags(Qt::FramelessWindowHint);
|
||||||
|
|
||||||
m_flags = flags();
|
|
||||||
|
|
||||||
m_syncTimer = new QTimer(this);
|
m_syncTimer = new QTimer(this);
|
||||||
m_syncTimer->setSingleShot(true);
|
m_syncTimer->setSingleShot(true);
|
||||||
m_syncTimer->setInterval(250);
|
m_syncTimer->setInterval(250);
|
||||||
@ -173,7 +171,7 @@ void DialogProxy::onVisibleChanged()
|
|||||||
} else {
|
} else {
|
||||||
KWindowSystem::setOnAllDesktops(winId(), false);
|
KWindowSystem::setOnAllDesktops(winId(), false);
|
||||||
}
|
}
|
||||||
setFlags(Qt::FramelessWindowHint|m_flags);
|
setFlags(Qt::FramelessWindowHint|flags());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,17 +300,6 @@ void DialogProxy::activateWindow()
|
|||||||
setWindowState(Qt::WindowActive);
|
setWindowState(Qt::WindowActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DialogProxy::windowFlags() const
|
|
||||||
{
|
|
||||||
return (int)m_flags;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DialogProxy::setWindowFlags(const int flags)
|
|
||||||
{
|
|
||||||
m_flags = (Qt::WindowFlags)flags;
|
|
||||||
setFlags(Qt::FramelessWindowHint|m_flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
Plasma::Types::Location DialogProxy::location() const
|
Plasma::Types::Location DialogProxy::location() const
|
||||||
{
|
{
|
||||||
return m_location;
|
return m_location;
|
||||||
|
@ -56,11 +56,6 @@ class DialogProxy : public QQuickWindow
|
|||||||
*/
|
*/
|
||||||
Q_PROPERTY(QQuickItem *visualParent READ visualParent WRITE setVisualParent NOTIFY visualParentChanged)
|
Q_PROPERTY(QQuickItem *visualParent READ visualParent WRITE setVisualParent NOTIFY visualParentChanged)
|
||||||
|
|
||||||
/**
|
|
||||||
* Window flags of the Dialog window
|
|
||||||
*/
|
|
||||||
Q_PROPERTY(int windowFlags READ windowFlags WRITE setWindowFlags)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Margins of the dialog around the mainItem.
|
* Margins of the dialog around the mainItem.
|
||||||
* @see DialogMargins
|
* @see DialogMargins
|
||||||
@ -118,10 +113,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
Q_INVOKABLE void activateWindow();
|
Q_INVOKABLE void activateWindow();
|
||||||
|
|
||||||
//FIXME: passing an int is ugly
|
|
||||||
int windowFlags() const;
|
|
||||||
void setWindowFlags(const int);
|
|
||||||
|
|
||||||
Plasma::Types::Location location() const;
|
Plasma::Types::Location location() const;
|
||||||
void setLocation(Plasma::Types::Location location);
|
void setLocation(Plasma::Types::Location location);
|
||||||
|
|
||||||
@ -170,7 +161,6 @@ private Q_SLOTS:
|
|||||||
void onVisibleChanged();
|
void onVisibleChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Qt::WindowFlags m_flags;
|
|
||||||
bool m_activeWindow;
|
bool m_activeWindow;
|
||||||
QRect m_cachedGeometry;
|
QRect m_cachedGeometry;
|
||||||
WindowType m_type;
|
WindowType m_type;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user