2023-11-14 19:12:53 +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
|
|
|
|
*/
|
|
|
|
#include "ui/vertical_list.h"
|
|
|
|
|
2023-12-08 06:37:37 +00:00
|
|
|
#include "ui/text/text_utilities.h"
|
2023-11-14 19:12:53 +00:00
|
|
|
#include "ui/widgets/box_content_divider.h"
|
|
|
|
#include "ui/widgets/labels.h"
|
|
|
|
#include "ui/wrap/padding_wrap.h"
|
|
|
|
#include "ui/wrap/vertical_layout.h"
|
|
|
|
#include "styles/style_layers.h"
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
|
|
|
void AddSkip(not_null<Ui::VerticalLayout*> container) {
|
2023-11-15 00:27:13 +00:00
|
|
|
AddSkip(container, st::defaultVerticalListSkip);
|
2023-11-14 19:12:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AddSkip(not_null<Ui::VerticalLayout*> container, int skip) {
|
2023-11-15 00:27:13 +00:00
|
|
|
container->add(object_ptr<Ui::FixedHeightWidget>(container, skip));
|
2023-11-14 19:12:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AddDivider(not_null<Ui::VerticalLayout*> container) {
|
|
|
|
container->add(object_ptr<Ui::BoxContentDivider>(container));
|
|
|
|
}
|
|
|
|
|
|
|
|
void AddDividerText(
|
|
|
|
not_null<Ui::VerticalLayout*> container,
|
2024-02-17 20:25:40 +00:00
|
|
|
rpl::producer<QString> text,
|
2024-02-20 10:33:46 +00:00
|
|
|
const style::margins &margins,
|
|
|
|
RectParts parts) {
|
2024-02-17 20:25:40 +00:00
|
|
|
AddDividerText(
|
|
|
|
container,
|
|
|
|
std::move(text) | Ui::Text::ToWithEntities(),
|
2024-02-20 10:33:46 +00:00
|
|
|
margins,
|
|
|
|
parts);
|
2023-12-08 06:37:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AddDividerText(
|
|
|
|
not_null<Ui::VerticalLayout*> container,
|
2024-02-17 20:25:40 +00:00
|
|
|
rpl::producer<TextWithEntities> text,
|
2024-02-20 10:33:46 +00:00
|
|
|
const style::margins &margins,
|
|
|
|
RectParts parts) {
|
2023-11-14 19:12:53 +00:00
|
|
|
container->add(object_ptr<Ui::DividerLabel>(
|
|
|
|
container,
|
|
|
|
object_ptr<Ui::FlatLabel>(
|
|
|
|
container,
|
|
|
|
std::move(text),
|
|
|
|
st::boxDividerLabel),
|
2024-02-20 10:33:46 +00:00
|
|
|
margins,
|
|
|
|
parts));
|
2023-11-14 19:12:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
not_null<Ui::FlatLabel*> AddSubsectionTitle(
|
|
|
|
not_null<Ui::VerticalLayout*> container,
|
|
|
|
rpl::producer<QString> text,
|
|
|
|
style::margins addPadding,
|
|
|
|
const style::FlatLabel *st) {
|
|
|
|
return container->add(
|
|
|
|
object_ptr<Ui::FlatLabel>(
|
|
|
|
container,
|
|
|
|
std::move(text),
|
2023-11-15 00:27:13 +00:00
|
|
|
st ? *st : st::defaultSubsectionTitle),
|
|
|
|
st::defaultSubsectionTitlePadding + addPadding);
|
2023-11-14 19:12:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Ui
|