Rename several HistoryView::Reactions modules.

This commit is contained in:
John Preston 2022-08-19 11:27:02 +03:00
parent b648387e96
commit fa26afaf9a
22 changed files with 56 additions and 57 deletions

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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));

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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<PeerListRow> Controller::createRow(
} // namespace
object_ptr<Ui::BoxContent> ReactionsListBox(
object_ptr<Ui::BoxContent> FullListBox(
not_null<Window::SessionController*> window,
not_null<HistoryItem*> item,
Data::ReactionId selected,
@ -332,20 +332,20 @@ object_ptr<Ui::BoxContent> 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<Ui::BoxContent> ReactionsListBox(
initBox);
}
} // namespace HistoryView
} // namespace HistoryView::Reactions

View file

@ -27,12 +27,12 @@ namespace Ui {
class BoxContent;
} // namespace Ui
namespace HistoryView {
namespace HistoryView::Reactions {
object_ptr<Ui::BoxContent> ReactionsListBox(
object_ptr<Ui::BoxContent> FullListBox(
not_null<Window::SessionController*> window,
not_null<HistoryItem*> item,
Data::ReactionId selected,
std::shared_ptr<Api::WhoReadList> whoReadIds = nullptr);
} // namespace HistoryView
} // namespace HistoryView::Reactions

View file

@ -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"

View file

@ -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<Ui::AbstractButton*> CreateTab(
} // namespace
not_null<Selector*> CreateReactionSelector(
not_null<Tabs*> CreateTabs(
not_null<QWidget*> parent,
const base::flat_map<ReactionId, int> &items,
const ReactionId &selected,
@ -112,7 +112,7 @@ not_null<Selector*> CreateReactionSelector(
rpl::variable<ReactionId> selected;
std::vector<not_null<Ui::AbstractButton*>> tabs;
};
const auto result = Ui::CreateChild<Selector>(parent.get());
const auto result = Ui::CreateChild<Tabs>(parent.get());
using Entry = std::pair<int, ReactionId>;
auto tabs = Ui::CreateChild<Ui::RpWidget>(parent.get());
const auto st = &st::reactionsTabs;
@ -184,4 +184,4 @@ not_null<Selector*> CreateReactionSelector(
return result;
}
} // namespace HistoryView
} // namespace HistoryView::Reactions

View file

@ -15,19 +15,19 @@ namespace Data {
struct ReactionId;
} // namespace Data
namespace HistoryView {
namespace HistoryView::Reactions {
struct Selector {
struct Tabs {
Fn<void(int, int)> move;
Fn<void(int)> resizeToWidth;
Fn<rpl::producer<Data::ReactionId>()> changes;
Fn<rpl::producer<int>()> heightValue;
};
not_null<Selector*> CreateReactionSelector(
not_null<Tabs*> CreateTabs(
not_null<QWidget*> parent,
const base::flat_map<Data::ReactionId, int> &items,
const Data::ReactionId &selected,
Ui::WhoReadType whoReadType);
} // namespace HistoryView
} // namespace HistoryView::Reactions

View file

@ -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"