diff options
Diffstat (limited to 'Swift/QtUI/QtTabbable.cpp')
-rw-r--r-- | Swift/QtUI/QtTabbable.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Swift/QtUI/QtTabbable.cpp b/Swift/QtUI/QtTabbable.cpp index 227a975..07a17c1 100644 --- a/Swift/QtUI/QtTabbable.cpp +++ b/Swift/QtUI/QtTabbable.cpp @@ -8,6 +8,8 @@ #include <QApplication> +#include "QtChatTabs.h" + namespace Swift { QtTabbable::~QtTabbable() { @@ -16,7 +18,11 @@ QtTabbable::~QtTabbable() { bool QtTabbable::isWidgetSelected() { /*isActiveWindow() shouldn't be necessary, but I don't trust it as far as I can throw it*/ - return isActiveWindow() && isAncestorOf(QApplication::focusWidget()); + if (!isActiveWindow()) { + return false; + } + QtChatTabs* parent = qobject_cast<QtChatTabs*>(window()); + return parent ? parent->getCurrentTab() == this : isAncestorOf(QApplication::focusWidget()); } } |