From a64b8d4181db5bea0085ecd9213861e78ac5323c Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 28 Apr 2022 16:27:39 +0300 Subject: [PATCH] Slightly improved style of section for group stickers. --- .../boxes/peers/edit_peer_info_box.cpp | 42 +++++++++---------- Telegram/SourceFiles/info/info.style | 13 ------ 2 files changed, 20 insertions(+), 35 deletions(-) diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp index 05b4a05cf..f2d61c862 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp @@ -544,38 +544,36 @@ object_ptr Controller::createStickersEdit() { Expects(_wrap != nullptr); const auto channel = _peer->asChannel(); + const auto bottomSkip = st::editPeerTopButtonsLayoutSkipCustomBottom; auto result = object_ptr>( _wrap, - object_ptr(_wrap), - st::editPeerInvitesMargins); + object_ptr(_wrap)); const auto container = result->entity(); - container->add(object_ptr( + Settings::AddSubsectionTitle( container, tr::lng_group_stickers(), - st::editPeerSectionLabel)); - container->add(object_ptr( - container, - st::editPeerInviteLinkSkip)); + { 0, st::settingsSubsectionTitlePadding.top() - bottomSkip, 0, 0 }); - container->add(object_ptr( + AddButtonWithCount( container, - tr::lng_group_stickers_description(), - st::editPeerPrivacyLabel)); - container->add(object_ptr( - container, - st::editPeerInviteLinkSkip)); + tr::lng_group_stickers_add(), + rpl::single(QString()), //Empty count. + [=, controller = _navigation->parentController()] { + controller->show( + Box(controller, channel), + Ui::LayerOption::KeepOther); + }, + { &st::settingsIconStickers, Settings::kIconLightOrange }); - container->add(object_ptr( - _wrap, - tr::lng_group_stickers_add(tr::now), - st::editPeerInviteLinkButton) - )->addClickHandler([=] { - _navigation->parentController()->show( - Box(_navigation->parentController(), channel), - Ui::LayerOption::KeepOther); - }); + Settings::AddSkip(container, bottomSkip); + + Settings::AddDividerText( + container, + tr::lng_group_stickers_description()); + + Settings::AddSkip(container, bottomSkip); return result; } diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index 8ce116a4d..c05b999e5 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -623,13 +623,6 @@ editPeerPrivacyBoxCheckbox: Checkbox(defaultBoxCheckbox) { editPeerHistoryVisibilityLabelMargins: margins(34px, 0px, 48px, 0px); editPeerPrivacyLabelMargins: margins(42px, 0px, 34px, 0px); editPeerPreHistoryLabelMargins: margins(34px, 0px, 34px, 0px); -editPeerSectionLabel: FlatLabel(boxTitle) { - style: TextStyle(defaultTextStyle) { - font: font(15px semibold); - linkFont: font(15px semibold); - linkFontOver: font(15px semibold underline); - } -} editPeerUsernameTitleLabelMargins: margins(22px, 17px, 22px, 10px); editPeerUsernameFieldMargins: margins(22px, 0px, 22px, 20px); editPeerUsername: setupChannelLink; @@ -638,7 +631,6 @@ editPeerInviteLink: FlatLabel(defaultFlatLabel) { minWidth: 1px; // for break everywhere style: boxTextStyle; } -editPeerInviteLinkButton: boxLinkButton; editPeerUsernameGood: FlatLabel(defaultFlatLabel) { textFg: boxTextFgGood; style: boxTextStyle; @@ -647,11 +639,6 @@ editPeerUsernameError: FlatLabel(editPeerUsernameGood) { textFg: boxTextFgError; } editPeerUsernamePosition: point(22px, 18px); -editPeerInviteLinkSkip: 10px; -editPeerInvitesMargins: margins(22px, 17px, 22px, 16px); -editPeerInvitesTopSkip: 10px; -editPeerInvitesSkip: 10px; -editPeerInviteLinkBoxBottomSkip: 15px; editPeerReactionsButton: SettingsButton(infoProfileButton) { padding: margins(59px, 13px, 8px, 11px);