Slightly improved style of learn more box in channel earn info section.

This commit is contained in:
23rd 2024-03-27 21:24:00 +03:00 committed by John Preston
parent 4e0d770d05
commit a1264a6088
11 changed files with 55 additions and 30 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -113,3 +113,7 @@ sponsoredAboutTitleIcon: icon {{ "sponsored/large_about", activeButtonFg }};
sponsoredAboutPrivacyIcon: icon {{ "sponsored/privacy_about", boxTextFg }};
sponsoredAboutRemoveIcon: icon {{ "sponsored/remove_about", boxTextFg }};
sponsoredAboutSplitIcon: icon {{ "sponsored/revenue_split", boxTextFg }};
channelEarnLearnTitleIcon: icon {{ "sponsored/large_earn", activeButtonFg }};
channelEarnLearnChannelIcon: icon {{ "sponsored/channel", boxTextFg }};
channelEarnLearnWithdrawalsIcon: icon {{ "sponsored/withdrawals", boxTextFg }};

View file

@ -226,33 +226,6 @@ void InnerWidget::fill() {
makeContext(label));
};
{
using Type = Statistic::ChartViewType;
Ui::AddSkip(container);
Ui::AddSkip(container);
if (data.topHoursGraph.chart) {
const auto widget = container->add(
object_ptr<Statistic::ChartWidget>(container),
st::statisticsLayerMargins);
widget->setChartData(data.topHoursGraph.chart, Type::Linear);
widget->setTitle(tr::lng_channel_earn_chart_top_hours());
}
if (data.revenueGraph.chart) {
Ui::AddSkip(container);
Ui::AddDivider(container);
Ui::AddSkip(container);
Ui::AddSkip(container);
const auto widget = container->add(
object_ptr<Statistic::ChartWidget>(container),
st::statisticsLayerMargins);
widget->setChartData(data.revenueGraph.chart, Type::StackBar);
widget->setTitle(tr::lng_channel_earn_chart_revenue());
}
Ui::AddSkip(container);
}
const auto arrow = Ui::Text::SingleCustomEmoji(
session->data().customEmojiManager().registerInternalEmoji(
st::topicButtonArrow,
@ -285,6 +258,26 @@ void InnerWidget::fill() {
Ui::AddSkip(content);
Ui::AddSkip(content);
Ui::AddSkip(content);
{
const auto &icon = st::channelEarnLearnTitleIcon;
const auto rect = Rect(icon.size() * 1.4);
auto owned = object_ptr<Ui::RpWidget>(content);
owned->resize(rect.size());
const auto widget = box->addRow(
object_ptr<Ui::CenterWrap<>>(
content,
std::move(owned)))->entity();
widget->paintRequest(
) | rpl::start_with_next([=] {
auto p = Painter(widget);
p.setPen(Qt::NoPen);
p.setBrush(st::activeButtonBg);
p.drawEllipse(rect);
icon.paintInCenter(p, rect);
}, widget->lifetime());
}
Ui::AddSkip(content);
Ui::AddSkip(content);
box->addRow(object_ptr<Ui::CenterWrap<>>(
content,
object_ptr<Ui::FlatLabel>(
@ -336,19 +329,19 @@ void InnerWidget::fill() {
addEntry(
tr::lng_channel_earn_learn_in_subtitle(),
tr::lng_channel_earn_learn_in_about(),
st::getBoostsButtonIcon);
st::channelEarnLearnChannelIcon);
Ui::AddSkip(content);
Ui::AddSkip(content);
addEntry(
tr::lng_channel_earn_learn_split_subtitle(),
tr::lng_channel_earn_learn_split_about(),
st::getBoostsButtonIcon);
st::sponsoredAboutSplitIcon);
Ui::AddSkip(content);
Ui::AddSkip(content);
addEntry(
tr::lng_channel_earn_learn_out_subtitle(),
tr::lng_channel_earn_learn_out_about(),
st::getBoostsButtonIcon);
st::channelEarnLearnWithdrawalsIcon);
Ui::AddSkip(content);
Ui::AddSkip(content);
}
@ -428,6 +421,34 @@ void InnerWidget::fill() {
RectPart::Top | RectPart::Bottom));
};
addAboutWithLearn(tr::lng_channel_earn_about);
{
using Type = Statistic::ChartViewType;
Ui::AddSkip(container);
Ui::AddSkip(container);
if (data.topHoursGraph.chart) {
const auto widget = container->add(
object_ptr<Statistic::ChartWidget>(container),
st::statisticsLayerMargins);
widget->setChartData(data.topHoursGraph.chart, Type::Linear);
widget->setTitle(tr::lng_channel_earn_chart_top_hours());
}
if (data.revenueGraph.chart) {
Ui::AddSkip(container);
Ui::AddDivider(container);
Ui::AddSkip(container);
Ui::AddSkip(container);
const auto widget = container->add(
object_ptr<Statistic::ChartWidget>(container),
st::statisticsLayerMargins);
widget->setChartData(data.revenueGraph.chart, Type::StackBar);
widget->setTitle(tr::lng_channel_earn_chart_revenue());
}
Ui::AddSkip(container);
}
Ui::AddSkip(container);
Ui::AddDivider(container);
Ui::AddSkip(container);
{
AddHeader(container, tr::lng_channel_earn_overview_title);