2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Added initial implementation of masks panel.

This commit is contained in:
23rd
2021-03-25 14:05:33 +03:00
parent d9a29b6f15
commit 1cdb83462e
15 changed files with 394 additions and 102 deletions

View File

@@ -423,7 +423,7 @@ TabbedSelector::Tab TabbedSelector::createTab(SelectorTab type, int index) {
case SelectorTab::Gifs:
return object_ptr<GifsListWidget>(this, _controller);
case SelectorTab::Masks:
return object_ptr<StickersListWidget>(this, _controller);
return object_ptr<StickersListWidget>(this, _controller, true);
}
Unexpected("Type in TabbedSelector::createTab.");
};
@@ -673,12 +673,17 @@ int TabbedSelector::marginBottom() const {
}
void TabbedSelector::refreshStickers() {
if (!hasStickersTab()) {
return;
if (hasStickersTab()) {
stickers()->refreshStickers();
if (isHidden() || _currentTabType != SelectorTab::Stickers) {
stickers()->preloadImages();
}
}
stickers()->refreshStickers();
if (isHidden() || _currentTabType != SelectorTab::Stickers) {
stickers()->preloadImages();
if (hasMasksTab()) {
masks()->refreshStickers();
if (isHidden() || _currentTabType != SelectorTab::Masks) {
masks()->preloadImages();
}
}
}
@@ -738,6 +743,9 @@ void TabbedSelector::showStarted() {
if (hasStickersTab()) {
session().api().updateStickers();
}
if (hasMasksTab()) {
session().api().updateMasks();
}
currentTab()->widget()->refreshRecent();
currentTab()->widget()->preloadImages();
_a_slide.stop();