/* This file is part of Telegram Desktop, the official desktop version of Telegram messaging app, see https://telegram.org Telegram Desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. In addition, as a special exception, the copyright holders give permission to link the code of portions of this program with the OpenSSL library. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "stickers/gifs_list_widget.h" #include "styles/style_stickers.h" #include "ui/widgets/buttons.h" #include "ui/effects/ripple_animation.h" #include "boxes/stickers_box.h" #include "inline_bots/inline_bot_result.h" #include "stickers/stickers.h" #include "storage/localstorage.h" #include "lang.h" #include "mainwindow.h" namespace ChatHelpers { namespace { constexpr auto kSaveChosenTabTimeout = 1000; constexpr auto kStickersPanelPerRow = Stickers::kPanelPerRow; constexpr auto kInlineItemsMaxPerRow = 5; } // namespace class GifsListWidget::Footer : public EmojiPanel::InnerFooter { public: Footer(gsl::not_null parent); protected: void processPanelHideFinished() override; private: gsl::not_null _pan; }; GifsListWidget::Footer::Footer(gsl::not_null parent) : InnerFooter(parent) , _pan(parent) { } void GifsListWidget::Footer::processPanelHideFinished() { // TODO Clear search } GifsListWidget::GifsListWidget(QWidget *parent) : Inner(parent) , _section(Section::Gifs) { resize(st::emojiPanWidth - st::emojiScroll.width - st::buttonRadius, countHeight()); setMouseTracking(true); setAttribute(Qt::WA_OpaquePaintEvent); _previewTimer.setSingleShot(true); connect(&_previewTimer, SIGNAL(timeout()), this, SLOT(onPreview())); _updateInlineItems.setSingleShot(true); connect(&_updateInlineItems, SIGNAL(timeout()), this, SLOT(onUpdateInlineItems())); subscribe(AuthSession::CurrentDownloaderTaskFinished(), [this] { update(); }); } object_ptr GifsListWidget::createFooter() { Expects(_footer == nullptr); auto result = object_ptr