2023-10-27 08:23:48 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2024-03-19 06:09:00 +00:00
|
|
|
namespace style {
|
|
|
|
struct SettingsButton;
|
|
|
|
} // namespace style
|
|
|
|
|
|
|
|
namespace st {
|
|
|
|
extern const style::SettingsButton &peerAppearanceButton;
|
|
|
|
} // namespace st
|
|
|
|
|
2023-10-27 08:23:48 +00:00
|
|
|
namespace ChatHelpers {
|
|
|
|
class Show;
|
|
|
|
} // namespace ChatHelpers
|
|
|
|
|
|
|
|
namespace Ui {
|
2024-03-21 01:43:53 +00:00
|
|
|
class RpWidget;
|
2023-10-27 08:23:48 +00:00
|
|
|
class GenericBox;
|
|
|
|
class ChatStyle;
|
2023-10-27 13:49:37 +00:00
|
|
|
class ChatTheme;
|
2023-10-27 08:23:48 +00:00
|
|
|
class VerticalLayout;
|
2023-12-22 04:17:44 +00:00
|
|
|
struct AskBoostReason;
|
2024-03-19 06:09:00 +00:00
|
|
|
class RpWidget;
|
2024-03-21 01:43:53 +00:00
|
|
|
class SettingsButton;
|
2023-10-27 08:23:48 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2024-03-21 01:43:53 +00:00
|
|
|
void AddLevelBadge(
|
|
|
|
int level,
|
|
|
|
not_null<Ui::SettingsButton*> button,
|
|
|
|
Ui::RpWidget *right,
|
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
const QMargins &padding,
|
|
|
|
rpl::producer<QString> text);
|
|
|
|
|
2023-10-27 08:23:48 +00:00
|
|
|
void EditPeerColorBox(
|
|
|
|
not_null<Ui::GenericBox*> box,
|
|
|
|
std::shared_ptr<ChatHelpers::Show> show,
|
|
|
|
not_null<PeerData*> peer,
|
2023-10-27 13:49:37 +00:00
|
|
|
std::shared_ptr<Ui::ChatStyle> style = nullptr,
|
|
|
|
std::shared_ptr<Ui::ChatTheme> theme = nullptr);
|
2023-10-27 08:23:48 +00:00
|
|
|
|
|
|
|
void AddPeerColorButton(
|
|
|
|
not_null<Ui::VerticalLayout*> container,
|
|
|
|
std::shared_ptr<ChatHelpers::Show> show,
|
|
|
|
not_null<PeerData*> peer);
|
2023-12-22 04:17:44 +00:00
|
|
|
|
|
|
|
void CheckBoostLevel(
|
|
|
|
std::shared_ptr<ChatHelpers::Show> show,
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
Fn<std::optional<Ui::AskBoostReason>(int level)> askMore,
|
|
|
|
Fn<void()> cancel);
|
2024-03-19 06:09:00 +00:00
|
|
|
|
|
|
|
struct ButtonWithEmoji {
|
|
|
|
not_null<const style::SettingsButton*> st;
|
|
|
|
int emojiWidth = 0;
|
|
|
|
int noneWidth = 0;
|
|
|
|
int added = 0;
|
|
|
|
};
|
|
|
|
[[nodiscard]] ButtonWithEmoji ButtonStyleWithRightEmoji(
|
|
|
|
not_null<Ui::RpWidget*> parent,
|
|
|
|
const QString &noneString,
|
|
|
|
const style::SettingsButton &parentSt = st::peerAppearanceButton);
|