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:
@@ -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,
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user