2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Allow creating desktop part of multi-theme.

This commit is contained in:
John Preston
2019-09-05 13:51:36 +03:00
parent 79106e0c01
commit 4951eeac98
24 changed files with 300 additions and 233 deletions

View File

@@ -1701,9 +1701,11 @@ void SendFilesBox::setupEmojiPanel() {
Ui::InsertEmojiAtCursor(_caption->textCursor(), emoji);
}, lifetime());
_emojiFilter.reset(Core::InstallEventFilter(
container,
[=](not_null<QEvent*> event) { return emojiFilter(event); }));
const auto filterCallback = [=](not_null<QEvent*> event) {
emojiFilterForGeometry(event);
return Core::EventFilter::Result::Continue;
};
_emojiFilter.reset(Core::InstallEventFilter(container, filterCallback));
_emojiToggle.create(this, st::boxAttachEmoji);
_emojiToggle->setVisible(!_caption->isHidden());
@@ -1713,14 +1715,13 @@ void SendFilesBox::setupEmojiPanel() {
});
}
bool SendFilesBox::emojiFilter(not_null<QEvent*> event) {
void SendFilesBox::emojiFilterForGeometry(not_null<QEvent*> event) {
const auto type = event->type();
if (type == QEvent::Move || type == QEvent::Resize) {
// updateEmojiPanelGeometry uses not only container geometry, but
// also container children geometries that will be updated later.
crl::on_main(this, [=] { updateEmojiPanelGeometry(); });
}
return false;
}
void SendFilesBox::updateEmojiPanelGeometry() {