Moved entry point for boosts statistic to channel context menu.

This commit is contained in:
23rd 2023-10-21 23:55:17 +03:00 committed by John Preston
parent f2fa1cd70d
commit be38800a70
6 changed files with 9 additions and 15 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -14,7 +14,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history_item.h"
#include "info/info_controller.h"
#include "info/info_memento.h"
#include "info/boosts/info_boosts_widget.h"
#include "info/statistics/info_statistics_list_controllers.h"
#include "info/statistics/info_statistics_recent_message.h"
#include "info/statistics/info_statistics_widget.h"
@ -514,20 +513,6 @@ void InnerWidget::load() {
descriptor.api->channelStats(),
descriptor.api->supergroupStats(),
};
if (_state.stats.channel) {
::Settings::AddSkip(inner);
const auto button = ::Settings::AddButton(
inner,
tr::lng_boosts_title(),
st::boostsButton);
const auto controller = _controller;
button->setClickedCallback([=, peer = descriptor.peer] {
controller->showSection(Info::Boosts::Make(peer));
});
::Settings::AddSkip(inner);
::Settings::AddDivider(inner);
::Settings::AddSkip(inner);
}
fill();
finishLoading();

View File

@ -52,6 +52,7 @@ menuIconClear: icon {{ "menu/clear", menuIconColor }};
menuIconManage: icon {{ "menu/manage", menuIconColor }};
menuIconDiscussion: icon {{ "menu/discussion", menuIconColor }};
menuIconStats: icon {{ "menu/stats", menuIconColor }};
menuIconBoosts: icon {{ "menu/boosts", menuIconColor }};
menuIconCreatePoll: icon {{ "menu/create_poll", menuIconColor }};
menuIconQrCode: icon {{ "menu/qr_code", menuIconColor }};
menuIconExpand: icon {{ "menu/expand", menuIconColor }};

View File

@ -62,6 +62,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "support/support_helper.h"
#include "info/info_controller.h"
#include "info/info_memento.h"
#include "info/boosts/info_boosts_widget.h"
#include "info/profile/info_profile_values.h"
#include "info/statistics/info_statistics_widget.h"
#include "info/stories/info_stories_widget.h"
@ -1006,6 +1007,13 @@ void Filler::addViewStatistics() {
controller->showSection(Info::Statistics::Make(peer, {}));
}
}, &st::menuIconStats);
if (!channel->isMegagroup()) {
_addAction(tr::lng_boosts_title(tr::now), [=] {
if (const auto strong = weak.get()) {
controller->showSection(Info::Boosts::Make(peer));
}
}, &st::menuIconBoosts);
}
}
}
}