restore isactivewindow
This commit is contained in:
parent
7ce2d0f7d6
commit
a1507092a0
@ -36,8 +36,6 @@
|
||||
//#include <Plasma/WindowEffects>
|
||||
#include <QDebug>
|
||||
|
||||
int DialogProxy::offscreenX = 0;
|
||||
int DialogProxy::offscreenY = 0;
|
||||
|
||||
DialogMargins::DialogMargins(QQuickWindow *dialog, QObject *parent)
|
||||
: QObject(parent),
|
||||
@ -175,10 +173,9 @@ bool DialogProxy::isVisible() const
|
||||
|
||||
void DialogProxy::setVisible(const bool visible)
|
||||
{
|
||||
if (isVisible() != visible) {
|
||||
if (visible) {
|
||||
syncToMainItemSize();
|
||||
|
||||
|
||||
const QRect workArea(KWindowSystem::workArea());
|
||||
if (!workArea.contains(geometry())) {
|
||||
setPosition(qBound(workArea.left(), x(), workArea.right() - width()),
|
||||
@ -186,11 +183,9 @@ void DialogProxy::setVisible(const bool visible)
|
||||
);
|
||||
}
|
||||
|
||||
QQuickWindow::setVisible(visible);
|
||||
if (visible) {
|
||||
raise();
|
||||
}
|
||||
}
|
||||
QQuickWindow::setVisible(visible);
|
||||
}
|
||||
|
||||
QPoint DialogProxy::popupPosition(QQuickItem *item, int alignment)
|
||||
@ -424,5 +419,19 @@ void DialogProxy::setAttribute(int attribute, bool on)
|
||||
}
|
||||
}
|
||||
|
||||
void DialogProxy::focusInEvent(QFocusEvent *ev)
|
||||
{
|
||||
Q_UNUSED(ev)
|
||||
m_activeWindow = true;
|
||||
emit activeWindowChanged();
|
||||
}
|
||||
|
||||
void DialogProxy::focusOutEvent(QFocusEvent *ev)
|
||||
{
|
||||
Q_UNUSED(ev)
|
||||
m_activeWindow = false;
|
||||
emit activeWindowChanged();
|
||||
}
|
||||
|
||||
#include "moc_dialog.cpp"
|
||||
|
||||
|
@ -190,10 +190,6 @@ public:
|
||||
Q_SIGNALS:
|
||||
void mainItemChanged();
|
||||
void visibleChanged();
|
||||
// void xChanged();
|
||||
// void yChanged();
|
||||
// void widthChanged();
|
||||
// void heightChanged();
|
||||
void activeWindowChanged();
|
||||
void locationChanged();
|
||||
|
||||
@ -203,17 +199,16 @@ private Q_SLOTS:
|
||||
protected:
|
||||
// bool eventFilter(QObject *watched, QEvent *event);
|
||||
void resizeEvent(QResizeEvent *re);
|
||||
void focusInEvent(QFocusEvent *ev);
|
||||
void focusOutEvent(QFocusEvent *ev);
|
||||
|
||||
private:
|
||||
Qt::WindowFlags m_flags;
|
||||
QQuickItem *m_declarativeItemContainer;
|
||||
QTimer *m_syncTimer;
|
||||
QWeakPointer<QQuickItem> m_mainItem;
|
||||
DialogMargins *m_margins;
|
||||
bool m_activeWindow;
|
||||
Plasma::Location m_location;
|
||||
static int offscreenX;
|
||||
static int offscreenY;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user