moved the tooltip close logic to basewidget

This commit is contained in:
fourtf
2017-12-24 16:01:01 +01:00
parent 72ed52c35c
commit 91099c028e
5 changed files with 29 additions and 17 deletions
+9
View File
@@ -1,6 +1,7 @@
#include "widgets/basewidget.hpp"
#include "colorscheme.hpp"
#include "settingsmanager.hpp"
#include "widgets/tooltipwidget.hpp"
#include <QDebug>
#include <QLayout>
@@ -61,6 +62,8 @@ void BaseWidget::init()
void BaseWidget::initAsWindow()
{
this->isWindow = true;
#ifdef USEWINSDK
auto dpi = util::getWindowDpi(this->winId());
@@ -101,5 +104,11 @@ bool BaseWidget::nativeEvent(const QByteArray &eventType, void *message, long *r
}
#endif
void BaseWidget::focusOutEvent(QFocusEvent *)
{
if (this->isWindow) {
TooltipWidget::getInstance()->hide();
}
}
} // namespace widgets
} // namespace chatterino