2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +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

@@ -279,14 +279,13 @@ EditCaptionBox::EditCaptionBox(
}, _wayWrap->lifetime());
}
bool EditCaptionBox::emojiFilter(not_null<QEvent*> event) {
void EditCaptionBox::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 EditCaptionBox::updateEmojiPanelGeometry() {
@@ -718,9 +717,11 @@ void EditCaptionBox::setupEmojiPanel() {
Ui::InsertEmojiAtCursor(_field->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->installEventFilter(_emojiPanel);