Make emote popup remember last position (#1580)

* Use existing moveTo to ensure window stay within desktop geometry
This commit is contained in:
mmb L
2020-04-13 19:15:51 +08:00
committed by GitHub
parent 6f926e7d77
commit ebfcb49e8c
4 changed files with 34 additions and 0 deletions
+8
View File
@@ -8,6 +8,7 @@
#include "messages/MessageBuilder.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/WindowManager.hpp"
#include "util/Shortcut.hpp"
#include "widgets/Notebook.hpp"
#include "widgets/helper/ChannelView.hpp"
@@ -113,6 +114,8 @@ namespace {
EmotePopup::EmotePopup(QWidget *parent)
: BasePopup(BaseWindow::EnableCustomFrame, parent)
{
this->moveTo(this, getApp()->windows->emotePopupPos());
auto layout = new QVBoxLayout(this);
this->getLayoutContainer()->setLayout(layout);
@@ -220,4 +223,9 @@ void EmotePopup::loadEmojis()
this->viewEmojis_->setChannel(emojiChannel);
}
void EmotePopup::closeEvent(QCloseEvent *event)
{
getApp()->windows->setEmotePopupPos(this->pos());
QWidget::closeEvent(event);
}
} // namespace chatterino