diff options
author | Weblate <noreply@weblate.org> | 2016-12-14 21:54:31 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2016-12-14 21:54:31 +0000 |
commit | b965af1625a4296f8ff6d3a1663cae23b73d334f (patch) | |
tree | 459685dd1da8c75f67772762aa062d80dfc148f0 /src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp | |
parent | Translated using Weblate (lumina_DESKTOP@fr (generated)) (diff) | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-b965af1625a4296f8ff6d3a1663cae23b73d334f.tar.gz lumina-b965af1625a4296f8ff6d3a1663cae23b73d334f.tar.bz2 lumina-b965af1625a4296f8ff6d3a1663cae23b73d334f.zip |
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp b/src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp index b400ac6e..15cfe047 100644 --- a/src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp +++ b/src-qt5/desktop-utils/lumina-terminal/TermWindow.cpp @@ -36,6 +36,11 @@ TermWindow::TermWindow(QSettings *set) : QWidget(0, Qt::Window | Qt::BypassWindo ANIM = new QPropertyAnimation(this, "geometry", this); ANIM->setDuration(300); //1/3 second animation connect(ANIM, SIGNAL(finished()), this, SLOT(AnimFinished()) ); + activeTimer = new QTimer(this); + activeTimer->setInterval(50); + activeTimer->setSingleShot(true); + connect(activeTimer, SIGNAL(timeout()), this, SLOT(activeStatusChanged()) ); + connect(QApplication::instance(), SIGNAL(applicationStateChanged(Qt::ApplicationState)), activeTimer, SLOT(start()) ); //Create the keyboard shortcuts //hideS = new QShortcut(QKeySequence(Qt::Key_Escape),this); closeS = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q),this); @@ -57,7 +62,6 @@ TermWindow::TermWindow(QSettings *set) : QWidget(0, Qt::Window | Qt::BypassWindo connect(closeS, SIGNAL(activated()), this, SLOT(CloseWindow()) ); connect(prevTabS, SIGNAL(activated()), this, SLOT(Prev_Tab()) ); connect(nextTabS, SIGNAL(activated()), this, SLOT(Next_Tab()) ); - //Now set the defaults screennum = 0; //default value setTopOfScreen(true); //default value @@ -282,6 +286,12 @@ void TermWindow::AnimFinished(){ animRunning = -1; //done } +void TermWindow::activeStatusChanged(){ + if(animRunning>=0){ return; } //ignore this event - already changing + QWidget *active = QApplication::activeWindow(); + if(active==0 && this->isVisible()){ HideWindow(); } +} + // =================== // PROTECTED // =================== |