animte emotes in colon emote input

This commit is contained in:
fourtf
2020-08-15 21:34:57 +02:00
parent f0b9f8ca59
commit 88f45a2842
2 changed files with 20 additions and 8 deletions
+15 -7
View File
@@ -47,13 +47,11 @@ EmoteInputPopup::EmoteInputPopup(QWidget *parent)
{
this->initLayout();
// this->connections_.addConnection(
// getApp()->emotes->gifTimer.signal.connect([this] {
// if (this->isVisible())
// {
// // redraw listview somehow
// }
// }));
QObject::connect(&this->redrawTimer_, &QTimer::timeout, this, [this] {
if (this->isVisible())
this->ui_.listView->doItemsLayout();
});
this->redrawTimer_.setInterval(33);
}
void EmoteInputPopup::initLayout()
@@ -123,4 +121,14 @@ void EmoteInputPopup::setInputAction(ActionCallback callback)
this->callback_ = std::move(callback);
}
void EmoteInputPopup::showEvent(QShowEvent *)
{
this->redrawTimer_.start();
}
void EmoteInputPopup::hideEvent(QHideEvent *)
{
this->redrawTimer_.stop();
}
} // namespace chatterino