2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Implement topics pin limit box.

This commit is contained in:
John Preston
2022-11-08 18:49:53 +04:00
parent 8a288476b8
commit 248337daf5
4 changed files with 37 additions and 5 deletions

View File

@@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_chat_filters.h"
#include "data/data_user.h"
#include "data/data_channel.h"
#include "data/data_forum.h"
#include "data/data_session.h"
#include "data/data_folder.h"
#include "data/data_premium_limits.h"
@@ -800,6 +801,28 @@ void PinsLimitBox(
PinsCount(session->data().chatsList()));
}
void ForumPinsLimitBox(
not_null<Ui::GenericBox*> box,
not_null<Data::Forum*> forum) {
const auto premium = false;
const auto premiumPossible = false;
const auto current = forum->owner().pinnedChatsLimit(forum) * 1.;
auto text = tr::lng_forum_pin_limit(
lt_count,
rpl::single(current),
Ui::Text::RichLangValue);
SimpleLimitBox(
box,
&forum->session(),
false,
tr::lng_filter_pin_limit_title(),
std::move(text),
QString(),
{ current, current, current * 2, &st::premiumIconPins });
}
void CaptionLimitBox(
not_null<Ui::GenericBox*> box,
not_null<Main::Session*> session,

View File

@@ -9,6 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/layers/generic_box.h"
namespace Data {
class Forum;
} // namespace Data
namespace Main {
class Session;
} // namespace Main
@@ -41,6 +45,9 @@ void FolderPinsLimitBox(
void PinsLimitBox(
not_null<Ui::GenericBox*> box,
not_null<Main::Session*> session);
void ForumPinsLimitBox(
not_null<Ui::GenericBox*> box,
not_null<Data::Forum*> forum);
void CaptionLimitBox(
not_null<Ui::GenericBox*> box,
not_null<Main::Session*> session,