Slightly improved style of boosts info.

This commit is contained in:
23rd 2023-11-07 01:23:52 +03:00
parent 1cb762913c
commit 4592e4e4bb
15 changed files with 42 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 B

View file

@ -24,7 +24,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "settings/settings_common.h"
#include "statistics/widgets/chart_header_widget.h"
#include "ui/boxes/boost_box.h"
#include "ui/controls/invite_link_buttons.h"
#include "ui/controls/invite_link_label.h"
#include "ui/rect.h"
#include "ui/widgets/buttons.h"
@ -181,8 +180,35 @@ void FillShareLink(
) | rpl::start_with_next(copyLink, label->lifetime());
const auto copyShareWrap = content->add(
object_ptr<Ui::VerticalLayout>(content));
Ui::AddCopyShareLinkButtons(copyShareWrap, copyLink, shareLink);
copyShareWrap->widgetAt(0)->showChildren();
{
const auto wrap = content->add(
object_ptr<Ui::FixedHeightWidget>(
content,
st::inviteLinkButton.height),
st::inviteLinkButtonsPadding);
const auto copy = CreateChild<Ui::RoundButton>(
wrap,
tr::lng_group_invite_context_copy(),
st::inviteLinkCopy);
copy->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
copy->setClickedCallback(copyLink);
const auto share = CreateChild<Ui::RoundButton>(
wrap,
tr::lng_group_invite_context_share(),
st::inviteLinkShare);
share->setTextTransform(Ui::RoundButton::TextTransform::NoTransform);
share->setClickedCallback(shareLink);
wrap->widthValue(
) | rpl::start_with_next([=](int width) {
const auto buttonWidth = (width - st::inviteLinkButtonsSkip) / 2;
copy->setFullWidth(buttonWidth);
share->setFullWidth(buttonWidth);
copy->moveToLeft(0, 0, width);
share->moveToRight(0, 0, width);
}, wrap->lifetime());
wrap->showChildren();
}
::Settings::AddSkip(content, st::boostsLinkFieldPadding.bottom());
}
@ -366,6 +392,7 @@ void InnerWidget::fill() {
::Settings::AddDividerText(inner, tr::lng_boosts_list_subtext());
}
::Settings::AddSkip(inner);
::Settings::AddSkip(inner);
AddHeader(inner, tr::lng_boosts_link_title);
::Settings::AddSkip(inner, st::boostsLinkSkip);

View file

@ -476,6 +476,11 @@ PaintRoundImageCallback BoostRow::generatePaintUserpicCallback(bool force) {
}
return [=](Painter &p, int x, int y, int outerWidth, int size) mutable {
_userpic.paintCircle(p, x, y, outerWidth, size);
(_boost.isUnclaimed
? st::boostsListUnclaimedIcon
: st::boostsListUnknownIcon).paintInCenter(
p,
{ x, y, size, size });
};
}

View file

@ -159,9 +159,11 @@ boostsListBadgeHeight: 16px;
boostsListRightBadgeTextStyle: TextStyle(defaultTextStyle) {
font: font(12px semibold);
}
boostsListRightBadgeTextPadding: margins(16px, 1px, 6px, 0px);
boostsListRightBadgePadding: margins(4px, 5px, 8px, 0px);
boostsListRightBadgeTextPadding: margins(22px, 1px, 8px, 0px);
boostsListRightBadgePadding: margins(4px, 5px, 12px, 0px);
boostsListRightBadgeHeight: 20px;
boostsListGiftMiniIconPadding: margins(1px, 2px, 0px, 0px);
boostsListGiftMiniIcon: icon{{ "boosts/boost_mini2", historyPeer8UserpicBg2 }};
boostsListGiveawayMiniIcon: icon{{ "boosts/boost_mini2", historyPeer4UserpicBg2 }};
boostsListGiftMiniIconPadding: margins(4px, 2px, 0px, 0px);
boostsListGiftMiniIcon: icon{{ "boosts/mini_gift", historyPeer8UserpicBg2 }};
boostsListGiveawayMiniIcon: icon{{ "boosts/mini_giveaway", historyPeer4UserpicBg2 }};
boostsListUnclaimedIcon: icon{{ "boosts/boost_unknown", premiumButtonFg }};
boostsListUnknownIcon: icon{{ "boosts/boost_unclaimed", premiumButtonFg }};