diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 42b249d15..46972e2e3 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -661,10 +661,18 @@ PRIVATE history/view/media/history_view_theme_document.cpp history/view/media/history_view_web_page.h history/view/media/history_view_web_page.cpp - history/view/reactions/message_reactions_list.cpp - history/view/reactions/message_reactions_list.h - history/view/reactions/message_reactions_selector.cpp - history/view/reactions/message_reactions_selector.h + history/view/reactions/history_view_reactions.cpp + history/view/reactions/history_view_reactions.h + history/view/reactions/history_view_reactions_animation.cpp + history/view/reactions/history_view_reactions_animation.h + history/view/reactions/history_view_reactions_button.cpp + history/view/reactions/history_view_reactions_button.h + history/view/reactions/history_view_reactions_list.cpp + history/view/reactions/history_view_reactions_list.h + history/view/reactions/history_view_reactions_selector.cpp + history/view/reactions/history_view_reactions_selector.h + history/view/reactions/history_view_reactions_tabs.cpp + history/view/reactions/history_view_reactions_tabs.h history/view/history_view_bottom_info.cpp history/view/history_view_bottom_info.h history/view/history_view_contact_status.cpp @@ -695,14 +703,6 @@ PRIVATE history/view/history_view_pinned_tracker.h history/view/history_view_quick_action.cpp history/view/history_view_quick_action.h - history/view/history_view_react_animation.cpp - history/view/history_view_react_animation.h - history/view/history_view_react_button.cpp - history/view/history_view_react_button.h - history/view/history_view_react_selector.cpp - history/view/history_view_react_selector.h - history/view/history_view_reactions.cpp - history/view/history_view_reactions.h history/view/history_view_replies_section.cpp history/view/history_view_replies_section.h history/view/history_view_requests_bar.cpp diff --git a/Telegram/SourceFiles/boxes/reactions_settings_box.cpp b/Telegram/SourceFiles/boxes/reactions_settings_box.cpp index 236c8b465..2cf6df13d 100644 --- a/Telegram/SourceFiles/boxes/reactions_settings_box.cpp +++ b/Telegram/SourceFiles/boxes/reactions_settings_box.cpp @@ -17,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/history.h" #include "history/history_message.h" #include "history/view/history_view_element.h" -#include "history/view/history_view_react_button.h" // DefaultIconFactory +#include "history/view/reactions/history_view_reactions_button.h" #include "lang/lang_keys.h" #include "lottie/lottie_icon.h" #include "boxes/premium_preview_box.h" diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index ccc5ceaed..0ae16886d 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -15,14 +15,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/view/media/history_view_media.h" #include "history/view/media/history_view_sticker.h" #include "history/view/media/history_view_web_page.h" -#include "history/view/reactions/message_reactions_list.h" +#include "history/view/reactions/history_view_reactions_button.h" +#include "history/view/reactions/history_view_reactions_selector.h" #include "history/view/history_view_message.h" #include "history/view/history_view_service_message.h" #include "history/view/history_view_cursor_state.h" #include "history/view/history_view_context_menu.h" #include "history/view/history_view_quick_action.h" -#include "history/view/history_view_react_button.h" -#include "history/view/history_view_react_selector.h" #include "history/view/history_view_emoji_interactions.h" #include "history/history_item_components.h" #include "history/history_item_text.h" diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 4659897af..f0ae90011 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -83,8 +83,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/view/controls/history_view_compose_search.h" #include "history/view/controls/history_view_voice_record_bar.h" #include "history/view/controls/history_view_ttl_button.h" +#include "history/view/reactions/history_view_reactions_button.h" #include "history/view/history_view_cursor_state.h" -#include "history/view/history_view_react_button.h" #include "history/view/history_view_service_message.h" #include "history/view/history_view_element.h" #include "history/view/history_view_scheduled_section.h" diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp index b8800a865..76baa4c16 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp @@ -16,9 +16,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/history_item_components.h" #include "history/history_message.h" #include "history/history.h" +#include "history/view/reactions/history_view_reactions_animation.h" #include "history/view/history_view_message.h" #include "history/view/history_view_cursor_state.h" -#include "history/view/history_view_react_animation.h" #include "core/click_handler_types.h" #include "main/main_session.h" #include "lottie/lottie_icon.h" diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index 64f8fc09a..36b4ccc62 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -24,7 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/view/history_view_schedule_box.h" #include "history/view/media/history_view_media.h" #include "history/view/media/history_view_web_page.h" -#include "history/view/reactions/message_reactions_list.h" +#include "history/view/reactions/history_view_reactions_list.h" #include "ui/widgets/popup_menu.h" #include "ui/widgets/menu/menu_item_base.h" #include "ui/image/image.h" @@ -1148,7 +1148,7 @@ void AddWhoReactedAction( strong->hideMenu(); } if (const auto item = controller->session().data().message(itemId)) { - controller->window().show(ReactionsListBox( + controller->window().show(Reactions::FullListBox( controller, item, {}, @@ -1178,7 +1178,7 @@ void ShowWhoReactedMenu( }; const auto showAllChosen = [=, itemId = item->fullId()]{ if (const auto item = controller->session().data().message(itemId)) { - controller->window().show(ReactionsListBox( + controller->window().show(Reactions::FullListBox( controller, item, id)); diff --git a/Telegram/SourceFiles/history/view/history_view_element.cpp b/Telegram/SourceFiles/history/view/history_view_element.cpp index 0d81768b0..eb11e2566 100644 --- a/Telegram/SourceFiles/history/view/history_view_element.cpp +++ b/Telegram/SourceFiles/history/view/history_view_element.cpp @@ -17,8 +17,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/view/media/history_view_sticker.h" #include "history/view/media/history_view_large_emoji.h" #include "history/view/media/history_view_custom_emoji.h" -#include "history/view/history_view_react_animation.h" -#include "history/view/history_view_react_button.h" +#include "history/view/reactions/history_view_reactions_animation.h" +#include "history/view/reactions/history_view_reactions_button.h" #include "history/view/history_view_cursor_state.h" #include "history/history.h" #include "base/unixtime.h" diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index c447b0e37..0cb72a5b6 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -14,13 +14,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/history_item_text.h" #include "history/view/media/history_view_media.h" #include "history/view/media/history_view_sticker.h" +#include "history/view/reactions/history_view_reactions_button.h" #include "history/view/history_view_context_menu.h" #include "history/view/history_view_element.h" #include "history/view/history_view_emoji_interactions.h" #include "history/view/history_view_message.h" #include "history/view/history_view_service_message.h" #include "history/view/history_view_cursor_state.h" -#include "history/view/history_view_react_button.h" #include "history/view/history_view_quick_action.h" #include "chat_helpers/message_field.h" #include "mainwindow.h" diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 206bb0106..1f4b962a5 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -13,9 +13,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/history_message.h" #include "history/view/media/history_view_media.h" #include "history/view/media/history_view_web_page.h" -#include "history/view/history_view_react_animation.h" -#include "history/view/history_view_react_button.h" -#include "history/view/history_view_reactions.h" +#include "history/view/reactions/history_view_reactions.h" +#include "history/view/reactions/history_view_reactions_animation.h" +#include "history/view/reactions/history_view_reactions_button.h" #include "history/view/history_view_group_call_bar.h" // UserpicInRow. #include "history/view/history_view_view_button.h" // ViewButton. #include "history/history.h" diff --git a/Telegram/SourceFiles/history/view/history_view_reactions.cpp b/Telegram/SourceFiles/history/view/reactions/history_view_reactions.cpp similarity index 99% rename from Telegram/SourceFiles/history/view/history_view_reactions.cpp rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions.cpp index 52fb162b7..acb901bf9 100644 --- a/Telegram/SourceFiles/history/view/history_view_reactions.cpp +++ b/Telegram/SourceFiles/history/view/reactions/history_view_reactions.cpp @@ -5,13 +5,13 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "history/view/history_view_reactions.h" +#include "history/view/reactions/history_view_reactions.h" #include "history/history_message.h" #include "history/history.h" +#include "history/view/reactions/history_view_reactions_animation.h" #include "history/view/history_view_message.h" #include "history/view/history_view_cursor_state.h" -#include "history/view/history_view_react_animation.h" #include "history/view/history_view_group_call_bar.h" #include "core/click_handler_types.h" #include "data/data_message_reactions.h" diff --git a/Telegram/SourceFiles/history/view/history_view_reactions.h b/Telegram/SourceFiles/history/view/reactions/history_view_reactions.h similarity index 100% rename from Telegram/SourceFiles/history/view/history_view_reactions.h rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions.h diff --git a/Telegram/SourceFiles/history/view/history_view_react_animation.cpp b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_animation.cpp similarity index 98% rename from Telegram/SourceFiles/history/view/history_view_react_animation.cpp rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions_animation.cpp index f773250dc..526a09ca2 100644 --- a/Telegram/SourceFiles/history/view/history_view_react_animation.cpp +++ b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_animation.cpp @@ -5,7 +5,7 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "history/view/history_view_react_animation.h" +#include "history/view/reactions/history_view_reactions_animation.h" #include "history/view/history_view_element.h" #include "history/view/history_view_bottom_info.h" diff --git a/Telegram/SourceFiles/history/view/history_view_react_animation.h b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_animation.h similarity index 100% rename from Telegram/SourceFiles/history/view/history_view_react_animation.h rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions_animation.h diff --git a/Telegram/SourceFiles/history/view/history_view_react_button.cpp b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_button.cpp similarity index 99% rename from Telegram/SourceFiles/history/view/history_view_react_button.cpp rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions_button.cpp index e4578c7b5..d2e113aeb 100644 --- a/Telegram/SourceFiles/history/view/history_view_react_button.cpp +++ b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_button.cpp @@ -5,7 +5,7 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "history/view/history_view_react_button.h" +#include "history/view/reactions/history_view_reactions_button.h" #include "history/view/history_view_cursor_state.h" #include "history/history_item.h" diff --git a/Telegram/SourceFiles/history/view/history_view_react_button.h b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_button.h similarity index 100% rename from Telegram/SourceFiles/history/view/history_view_react_button.h rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions_button.h diff --git a/Telegram/SourceFiles/history/view/reactions/message_reactions_list.cpp b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_list.cpp similarity index 96% rename from Telegram/SourceFiles/history/view/reactions/message_reactions_list.cpp rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions_list.cpp index 0a5be28d5..11d52b6a9 100644 --- a/Telegram/SourceFiles/history/view/reactions/message_reactions_list.cpp +++ b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_list.cpp @@ -5,9 +5,9 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "history/view/reactions/message_reactions_list.h" +#include "history/view/reactions/history_view_reactions_list.h" -#include "history/view/reactions/message_reactions_selector.h" +#include "history/view/reactions/history_view_reactions_tabs.h" #include "boxes/peer_list_box.h" #include "boxes/peers/prepare_short_info_box.h" #include "window/window_session_controller.h" @@ -21,7 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_peer.h" #include "lang/lang_keys.h" -namespace HistoryView { +namespace HistoryView::Reactions { namespace { constexpr auto kPerPageFirst = 20; @@ -308,7 +308,7 @@ std::unique_ptr Controller::createRow( } // namespace -object_ptr ReactionsListBox( +object_ptr FullListBox( not_null window, not_null item, Data::ReactionId selected, @@ -332,20 +332,20 @@ object_ptr ReactionsListBox( Data::ReactionId{ u"read"_q }, int(whoReadIds->list.size())); } - const auto selector = CreateReactionSelector( + const auto tabs = CreateTabs( box, map, selected, whoReadIds ? whoReadIds->type : Ui::WhoReadType::Reacted); - selector->changes( + tabs->changes( ) | rpl::start_to_stream(*tabRequests, box->lifetime()); box->widthValue( ) | rpl::start_with_next([=](int width) { - selector->resizeToWidth(width); - selector->move(0, 0); + tabs->resizeToWidth(width); + tabs->move(0, 0); }, box->lifetime()); - selector->heightValue( + tabs->heightValue( ) | rpl::start_with_next([=](int height) { box->setAddedTopScrollSkip(height); }, box->lifetime()); @@ -363,4 +363,4 @@ object_ptr ReactionsListBox( initBox); } -} // namespace HistoryView +} // namespace HistoryView::Reactions diff --git a/Telegram/SourceFiles/history/view/reactions/message_reactions_list.h b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_list.h similarity index 86% rename from Telegram/SourceFiles/history/view/reactions/message_reactions_list.h rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions_list.h index 8e13506a4..b65c21065 100644 --- a/Telegram/SourceFiles/history/view/reactions/message_reactions_list.h +++ b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_list.h @@ -27,12 +27,12 @@ namespace Ui { class BoxContent; } // namespace Ui -namespace HistoryView { +namespace HistoryView::Reactions { -object_ptr ReactionsListBox( +object_ptr FullListBox( not_null window, not_null item, Data::ReactionId selected, std::shared_ptr whoReadIds = nullptr); -} // namespace HistoryView +} // namespace HistoryView::Reactions diff --git a/Telegram/SourceFiles/history/view/history_view_react_selector.cpp b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_selector.cpp similarity index 98% rename from Telegram/SourceFiles/history/view/history_view_react_selector.cpp rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions_selector.cpp index 5afd818ec..f04408b3b 100644 --- a/Telegram/SourceFiles/history/view/history_view_react_selector.cpp +++ b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_selector.cpp @@ -5,9 +5,9 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "history/view/history_view_react_selector.h" +#include "history/view/reactions/history_view_reactions_selector.h" -#include "history/view/history_view_react_button.h" +#include "history/view/reactions/history_view_reactions_button.h" #include "data/data_document.h" #include "data/data_session.h" #include "data/data_message_reactions.h" diff --git a/Telegram/SourceFiles/history/view/history_view_react_selector.h b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_selector.h similarity index 100% rename from Telegram/SourceFiles/history/view/history_view_react_selector.h rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions_selector.h diff --git a/Telegram/SourceFiles/history/view/reactions/message_reactions_selector.cpp b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_tabs.cpp similarity index 95% rename from Telegram/SourceFiles/history/view/reactions/message_reactions_selector.cpp rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions_tabs.cpp index 614b28ed6..0b550e488 100644 --- a/Telegram/SourceFiles/history/view/reactions/message_reactions_selector.cpp +++ b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_tabs.cpp @@ -5,7 +5,7 @@ the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ -#include "history/view/reactions/message_reactions_selector.h" +#include "history/view/reactions/history_view_reactions_tabs.h" #include "ui/rp_widget.h" #include "ui/abstract_button.h" @@ -14,7 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_widgets.h" #include "styles/style_chat.h" -namespace HistoryView { +namespace HistoryView::Reactions { namespace { using ::Data::ReactionId; @@ -103,7 +103,7 @@ not_null CreateTab( } // namespace -not_null CreateReactionSelector( +not_null CreateTabs( not_null parent, const base::flat_map &items, const ReactionId &selected, @@ -112,7 +112,7 @@ not_null CreateReactionSelector( rpl::variable selected; std::vector> tabs; }; - const auto result = Ui::CreateChild(parent.get()); + const auto result = Ui::CreateChild(parent.get()); using Entry = std::pair; auto tabs = Ui::CreateChild(parent.get()); const auto st = &st::reactionsTabs; @@ -184,4 +184,4 @@ not_null CreateReactionSelector( return result; } -} // namespace HistoryView +} // namespace HistoryView::Reactions diff --git a/Telegram/SourceFiles/history/view/reactions/message_reactions_selector.h b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_tabs.h similarity index 85% rename from Telegram/SourceFiles/history/view/reactions/message_reactions_selector.h rename to Telegram/SourceFiles/history/view/reactions/history_view_reactions_tabs.h index f9be86965..18844acae 100644 --- a/Telegram/SourceFiles/history/view/reactions/message_reactions_selector.h +++ b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_tabs.h @@ -15,19 +15,19 @@ namespace Data { struct ReactionId; } // namespace Data -namespace HistoryView { +namespace HistoryView::Reactions { -struct Selector { +struct Tabs { Fn move; Fn resizeToWidth; Fn()> changes; Fn()> heightValue; }; -not_null CreateReactionSelector( +not_null CreateTabs( not_null parent, const base::flat_map &items, const Data::ReactionId &selected, Ui::WhoReadType whoReadType); -} // namespace HistoryView +} // namespace HistoryView::Reactions diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index b745f3c39..b0e173b1e 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -21,9 +21,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "inline_bots/bot_attach_web_view.h" #include "history/history.h" #include "history/history_item.h" +#include "history/view/reactions/history_view_reactions.h" +#include "history/view/reactions/history_view_reactions_button.h" #include "history/view/history_view_replies_section.h" -#include "history/view/history_view_react_button.h" -#include "history/view/history_view_reactions.h" #include "history/view/history_view_scheduled_section.h" #include "media/player/media_player_instance.h" #include "media/view/media_view_open_common.h"