diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp index f0ac54c3c..af8f722ac 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp @@ -86,26 +86,6 @@ private: }; -#if 0 -class EmojiListWidget::Footer : public TabbedSelector::InnerFooter { -public: - Footer(not_null parent); - - void setCurrentSectionIcon(Section section); - -protected: - void processPanelHideFinished() override; - void resizeEvent(QResizeEvent *e) override; - -private: - void setActiveSection(Section section); - - not_null _pan; - std::array, kEmojiSectionCount> _sections; - -}; -#endif - struct EmojiListWidget::CustomInstance { CustomInstance( std::unique_ptr loader, @@ -130,67 +110,6 @@ EmojiListWidget::CustomInstance::CustomInstance( , object(&emoji, std::move(repaint)) { } -#if 0 -EmojiListWidget::Footer::Footer(not_null parent) -: InnerFooter(parent) -, _pan(parent) -, _sections { { - object_ptr(this, st::emojiCategoryRecent), - object_ptr(this, st::emojiCategoryPeople), - object_ptr(this, st::emojiCategoryNature), - object_ptr(this, st::emojiCategoryFood), - object_ptr(this, st::emojiCategoryActivity), - object_ptr(this, st::emojiCategoryTravel), - object_ptr(this, st::emojiCategoryObjects), - object_ptr(this, st::emojiCategorySymbols), -} } { - for (auto i = 0; i != _sections.size(); ++i) { - auto value = static_cast
(i); - _sections[i]->setClickedCallback([=] { - setActiveSection(value); - }); - } - setCurrentSectionIcon(Section::Recent); -} - -void EmojiListWidget::Footer::resizeEvent(QResizeEvent *e) { - auto availableWidth = (width() - st::emojiCategorySkip * 2); - auto buttonWidth = availableWidth / _sections.size(); - auto buttonsWidth = buttonWidth * _sections.size(); - auto left = (width() - buttonsWidth) / 2; - for (auto &button : _sections) { - button->resizeToWidth(buttonWidth); - button->moveToLeft(left, 0); - left += button->width(); - } -} - -void EmojiListWidget::Footer::processPanelHideFinished() { - // Preserve panel state through visibility toggles. - //setCurrentSectionIcon(Section::Recent); -} - -void EmojiListWidget::Footer::setCurrentSectionIcon(Section section) { - std::array overrides = { { - &st::emojiRecentActive, - &st::emojiPeopleActive, - &st::emojiNatureActive, - &st::emojiFoodActive, - &st::emojiActivityActive, - &st::emojiTravelActive, - &st::emojiObjectsActive, - &st::emojiSymbolsActive, - } }; - for (auto i = 0; i != _sections.size(); ++i) { - _sections[i]->setIconOverride((section == static_cast
(i)) ? overrides[i] : nullptr); - } -} - -void EmojiListWidget::Footer::setActiveSection(Ui::Emoji::Section section) { - _pan->showEmojiSection(section); -} -#endif - EmojiColorPicker::EmojiColorPicker(QWidget *parent) : RpWidget(parent) { setMouseTracking(true);