Moved out common default style entries from settings.

This commit is contained in:
23rd 2023-11-15 03:27:13 +03:00
parent acb1a7ccf2
commit 819020e515
39 changed files with 103 additions and 126 deletions

View file

@ -422,7 +422,7 @@ void ToggleChatsController::setupBelowWidget() {
auto widget = object_ptr<Ui::DividerLabel>(
(QWidget*)nullptr,
std::move(layout),
st::settingsDividerLabelPadding);
st::defaultBoxDividerLabelPadding);
raw->add(object_ptr<Ui::FlatLabel>(
raw,
(_action == ToggleAction::Removing

View file

@ -43,7 +43,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_chat.h"
#include "styles/style_layers.h"
#include "styles/style_boxes.h"
#include "styles/style_settings.h"
#include <QtGui/QClipboard>
#include <QtGui/QGuiApplication>
@ -296,7 +295,7 @@ void BackgroundPreviewBox::createDimmingSlider(bool dark) {
Ui::AddSubsectionTitle(
inner,
tr::lng_background_dimming(),
style::margins(0, st::settingsSectionSkip, 0, 0),
style::margins(0, st::defaultVerticalListSkip, 0, 0),
equals ? nullptr : dark ? &_dark->subtitle : &_light->subtitle);
_dimmingSlider = inner->add(
object_ptr<Ui::MediaSlider>(
@ -378,7 +377,7 @@ auto BackgroundPreviewBox::prepareOverridenStyle(bool dark)
.box = st::defaultBox,
.toggle = toggle,
.slider = st::defaultContinuousSlider,
.subtitle = st::settingsSubsectionTitle,
.subtitle = st::defaultSubsectionTitle,
};
result.box.button.textFg = p->lightButtonFg();
result.box.button.textFgOver = p->lightButtonFgOver();

View file

@ -906,6 +906,14 @@ sponsoredUrlButton: RoundButton(defaultActiveButton) {
}
}
requestPeerRestriction: FlatLabel(defaultFlatLabel) {
minWidth: 240px;
textFg: membersAboutLimitFg;
style: TextStyle(boxTextStyle) {
lineHeight: 22px;
}
}
requestsBoxItem: PeerListItem(peerListBoxItem) {
height: 99px;
button: OutlineButton(defaultPeerListButton) {

View file

@ -34,7 +34,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_session_controller.h"
#include "styles/style_layers.h"
#include "styles/style_boxes.h"
#include "styles/style_settings.h"
namespace {
@ -818,9 +817,9 @@ not_null<Ui::InputField*> CreatePollBox::setupQuestion(
- st::createPollWarningPosition.x()),
(geometry.y()
- st::createPollFieldPadding.top()
- st::settingsSubsectionTitlePadding.bottom()
- st::settingsSubsectionTitle.style.font->height
+ st::settingsSubsectionTitle.style.font->ascent
- st::defaultSubsectionTitlePadding.bottom()
- st::defaultSubsectionTitle.style.font->height
+ st::defaultSubsectionTitle.style.font->ascent
- st::createPollWarning.style.font->ascent),
geometry.width());
}, warning->lifetime());
@ -875,9 +874,9 @@ not_null<Ui::InputField*> CreatePollBox::setupSolution(
- st::createPollWarningPosition.x()),
(geometry.y()
- st::createPollFieldPadding.top()
- st::settingsSubsectionTitlePadding.bottom()
- st::settingsSubsectionTitle.style.font->height
+ st::settingsSubsectionTitle.style.font->ascent
- st::defaultSubsectionTitlePadding.bottom()
- st::defaultSubsectionTitle.style.font->height
+ st::defaultSubsectionTitle.style.font->ascent
- st::createPollWarning.style.font->ascent),
geometry.width());
}, warning->lifetime());
@ -908,7 +907,7 @@ object_ptr<Ui::RpWidget> CreatePollBox::setupContent() {
object_ptr<Ui::FlatLabel>(
container,
tr::lng_polls_create_options(),
st::settingsSubsectionTitle),
st::defaultSubsectionTitle),
st::createPollFieldTitlePadding);
const auto options = lifetime().make_state<Options>(
getDelegate()->outerContainer(),

View file

@ -233,7 +233,7 @@ Ui::FlatLabel *EditPrivacyBox::addLabel(
object_ptr<Ui::DividerLabel>(
container,
std::move(label),
st::settingsDividerLabelPadding),
st::defaultBoxDividerLabelPadding),
{ 0, topSkip, 0, 0 });
return result;
}
@ -332,7 +332,7 @@ void EditPrivacyBox::setupContent() {
const auto warning = addLabelOrDivider(
content,
_controller->warning(),
st::settingsSectionSkip + st::settingsPrivacySkipTop);
st::defaultVerticalListSkip + st::settingsPrivacySkipTop);
if (warning) {
_controller->prepareWarningLabel(warning);
}
@ -355,7 +355,7 @@ void EditPrivacyBox::setupContent() {
addLabel(
content,
_controller->exceptionsDescription() | Ui::Text::ToWithEntities(),
st::settingsSectionSkip);
st::defaultVerticalListSkip);
if (auto below = _controller->setupBelowWidget(_window, content)) {
content->add(std::move(below));

View file

@ -141,10 +141,10 @@ void ChatFilterLinkBox(
tr::lng_group_invite_label_header(),
data.title),
style::margins(
st::settingsSubsectionTitlePadding.left(),
st::settingsSectionSkip,
st::settingsSubsectionTitlePadding.right(),
st::settingsSectionSkip * 2));
st::defaultSubsectionTitlePadding.left(),
st::defaultVerticalListSkip,
st::defaultSubsectionTitlePadding.right(),
st::defaultVerticalListSkip * 2));
labelField->setMaxLength(kMaxLinkTitleLength);
AddDivider(container);
@ -789,7 +789,7 @@ void LinkController::setupBelowWidget() {
? tr::lng_filters_link_chats_no_about()
: tr::lng_filters_link_chats_about()),
st::boxDividerLabel),
st::settingsDividerLabelPadding));
st::defaultBoxDividerLabelPadding));
}
Main::Session &LinkController::session() const {

View file

@ -35,7 +35,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "apiwrap.h"
#include "styles/style_boxes.h"
#include "styles/style_layers.h"
#include "styles/style_settings.h"
namespace {

View file

@ -28,7 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_session_controller.h"
#include "styles/style_boxes.h"
#include "styles/style_chat_helpers.h"
#include "styles/style_settings.h"
#include "styles/style_layers.h"
namespace {
@ -356,7 +356,7 @@ void ChoosePeerBoxController::prepareRestrictions() {
raw,
tr::lng_request_peer_requirements(),
{ 0, st::membersMarginTop, 0, 0 });
const auto skip = st::settingsSubsectionTitlePadding.left();
const auto skip = st::defaultSubsectionTitlePadding.left();
auto separator = QString::fromUtf8("\n\xE2\x80\xA2 ");
raw->add(
object_ptr<Ui::FlatLabel>(

View file

@ -60,7 +60,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_menu_icons.h"
#include "styles/style_boxes.h"
#include "styles/style_info.h"
#include "styles/style_settings.h"
namespace {
@ -581,7 +580,7 @@ object_ptr<Ui::RpWidget> Controller::createStickersEdit() {
Ui::AddSubsectionTitle(
container,
tr::lng_group_stickers(),
{ 0, st::settingsSubsectionTitlePadding.top() - bottomSkip, 0, 0 });
{ 0, st::defaultSubsectionTitlePadding.top() - bottomSkip, 0, 0 });
AddButtonWithCount(
container,
@ -1009,7 +1008,7 @@ void Controller::fillManageSection() {
kBotManagerUsername.utf16()))),
Ui::Text::RichLangValue),
st::boxDividerLabel),
st::settingsDividerLabelPadding));
st::defaultBoxDividerLabelPadding));
return;
}

View file

@ -46,7 +46,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_boxes.h"
#include "styles/style_layers.h" // st::boxDividerLabel.
#include "styles/style_info.h"
#include "styles/style_settings.h"
#include "styles/style_menu_icons.h"
#include <QtGui/QGuiApplication>
@ -457,7 +456,7 @@ void Controller::addHeaderBlock(not_null<Ui::VerticalLayout*> container) {
container,
tr::lng_group_invite_expired_about(),
st::boxAttentionDividerLabel),
st::settingsDividerLabelPadding)));
st::defaultBoxDividerLabelPadding)));
const auto grayLabelWrap = container->add(
object_ptr<Ui::SlideWrap<Ui::DividerLabel>>(
container,
@ -467,7 +466,7 @@ void Controller::addHeaderBlock(not_null<Ui::VerticalLayout*> container) {
container,
std::move(grayLabelText),
st::boxDividerLabel),
st::settingsDividerLabelPadding)));
st::defaultBoxDividerLabelPadding)));
const auto justDividerWrap = container->add(
object_ptr<Ui::SlideWrap<>>(
container,
@ -665,7 +664,7 @@ void Controller::setupAboveJoinedWidget() {
const auto remaining = Ui::CreateChild<Ui::FlatLabel>(
listHeader,
std::move(remainingText),
st::settingsSubsectionTitleRight);
st::inviteLinkTitleRight);
dataValue(
) | rpl::start_with_next([=](const LinkData &data) {
remaining->setTextColorOverride(

View file

@ -29,7 +29,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/unixtime.h"
#include "styles/style_info.h"
#include "styles/style_layers.h" // st::boxDividerLabel
#include "styles/style_settings.h" // st::settingsDividerLabelPadding
#include "styles/style_menu_icons.h"
namespace {
@ -921,7 +920,7 @@ void ManageInviteLinksBox(
object_ptr<Ui::FlatLabel>(
container,
tr::lng_group_invite_other_list(),
st::settingsSubsectionTitle),
st::defaultSubsectionTitle),
st::inviteLinkRevokedTitlePadding));
}
@ -947,7 +946,7 @@ void ManageInviteLinksBox(
container,
tr::lng_group_invite_add_about(),
st::boxDividerLabel),
st::settingsDividerLabelPadding)),
st::defaultBoxDividerLabelPadding)),
style::margins(0, st::inviteLinkCreateSkip, 0, 0));
const auto adminsDivider = container->add(object_ptr<Ui::SlideWrap<>>(
@ -958,7 +957,7 @@ void ManageInviteLinksBox(
object_ptr<Ui::FlatLabel>(
container,
tr::lng_group_invite_other_title(),
st::settingsSubsectionTitle),
st::defaultSubsectionTitle),
st::inviteLinkRevokedTitlePadding));
const auto admins = AddAdminsList(show, container, peer, admin);
@ -970,7 +969,7 @@ void ManageInviteLinksBox(
object_ptr<Ui::FlatLabel>(
container,
tr::lng_group_invite_revoked_title(),
st::settingsSubsectionTitle),
st::defaultSubsectionTitle),
st::inviteLinkRevokedTitlePadding));
const auto revoked = AddLinksList(
show,

View file

@ -45,7 +45,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_layers.h"
#include "styles/style_boxes.h"
#include "styles/style_info.h"
#include "styles/style_settings.h"
namespace {
@ -425,8 +424,8 @@ object_ptr<Ui::RpWidget> Controller::createUsernameEdit() {
object_ptr<Ui::FlatLabel>(
container,
tr::lng_create_group_link(),
st::settingsSubsectionTitle),
st::settingsSubsectionTitlePadding);
st::defaultSubsectionTitle),
st::defaultSubsectionTitlePadding);
const auto placeholder = container->add(
object_ptr<Ui::RpWidget>(container),

View file

@ -25,7 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/wrap/vertical_layout_reorder.h"
#include "styles/style_boxes.h" // contactsStatusFont.
#include "styles/style_info.h"
#include "styles/style_settings.h"
#include "styles/style_layers.h"
#include "styles/style_menu_icons.h"
#include <QtGui/QGuiApplication>
@ -238,8 +238,8 @@ void UsernamesList::rebuild(const Data::Usernames &usernames) {
_peer->isSelf()
? tr::lng_usernames_subtitle()
: tr::lng_channel_usernames_subtitle(),
st::settingsSubsectionTitle),
st::settingsSubsectionTitlePadding);
st::defaultSubsectionTitle),
st::defaultSubsectionTitlePadding);
}
const auto content = _container->add(

View file

@ -105,7 +105,7 @@ void AddMessage(
object_ptr<Ui::RpWidget>(container),
style::margins(
0,
st::settingsSectionSkip,
st::defaultVerticalListSkip,
0,
st::settingsPrivacySkipTop));

View file

@ -116,12 +116,12 @@ private:
void RenameBox(not_null<Ui::GenericBox*> box) {
box->setTitle(tr::lng_settings_rename_device_title());
const auto skip = st::settingsSubsectionTitlePadding.top();
const auto skip = st::defaultSubsectionTitlePadding.top();
box->addRow(
object_ptr<Ui::FlatLabel>(
box,
tr::lng_settings_device_name(),
st::settingsSubsectionTitle),
st::defaultSubsectionTitle),
st::boxRowPadding + style::margins(0, skip, 0, 0));
const auto name = box->addRow(
object_ptr<Ui::InputField>(
@ -920,8 +920,8 @@ void SessionsContent::Inner::setupContent() {
) | rpl::start_with_next([=](QSize outer, QPoint position) {
const auto x = st::sessionTerminateSkip
+ st::sessionTerminate.iconPosition.x();
const auto y = st::settingsSubsectionTitlePadding.top()
+ st::settingsSubsectionTitle.style.font->ascent
const auto y = st::defaultSubsectionTitlePadding.top()
+ st::defaultSubsectionTitle.style.font->ascent
- st::defaultLinkButton.font->ascent;
rename->moveToRight(x, y, outer.width());
}, rename->lifetime());
@ -999,7 +999,7 @@ void SessionsContent::Inner::setupContent() {
content,
tr::lng_sessions_other_desc(),
st::boxDividerLabel),
st::settingsDividerLabelPadding))->setDuration(0);
st::defaultBoxDividerLabelPadding))->setDuration(0);
terminateWrap->toggleOn(
rpl::combine(

View file

@ -35,7 +35,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_chat_helpers.h"
#include "styles/style_info.h" // inviteLinkListItem.
#include "styles/style_layers.h"
#include "styles/style_settings.h" // settingsSubsectionTitlePadding.
#include <QLocale>
@ -187,7 +186,7 @@ void TranslateBox(
Ui::AddSkip(container);
{
const auto padding = st::settingsSubsectionTitlePadding;
const auto padding = st::defaultSubsectionTitlePadding;
const auto subtitle = Ui::AddSubsectionTitle(
container,
state->to.value() | rpl::map(LanguageName));

View file

@ -30,7 +30,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/wrap/slide_wrap.h"
#include "styles/style_layers.h"
#include "styles/style_boxes.h"
#include "styles/style_settings.h"
namespace {
@ -369,7 +368,7 @@ void UsernamesBox(
container,
std::move(description),
st::boxDividerLabel),
st::settingsDividerLabelPadding));
st::defaultBoxDividerLabelPadding));
const auto list = box->addRow(
object_ptr<UsernamesList>(

View file

@ -12,7 +12,7 @@ using "ui/layers/layers.style";
using "ui/chat/chat.style"; // GroupCallUserpics
using "info/info.style"; // ShortInfoCover
using "window/window.style";
using "settings/settings.style"; // settingsSubsectionTitle
using "settings/settings.style"; // defaultSubsectionTitle
CallSignalBars {
width: pixels;
@ -1374,7 +1374,7 @@ groupCallRtmpShowButton: IconButton(defaultIconButton) {
groupCallSettingsRtmpShowButton: IconButton(groupCallRtmpShowButton) {
ripple: groupCallRipple;
}
groupCallSubsectionTitle: FlatLabel(settingsSubsectionTitle) {
groupCallSubsectionTitle: FlatLabel(defaultSubsectionTitle) {
textFg: groupCallActiveFg;
}
groupCallAttentionBoxButton: RoundButton(groupCallBoxButton) {

View file

@ -26,7 +26,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_info.h"
#include "styles/style_layers.h"
#include "styles/style_menu_icons.h"
#include "styles/style_settings.h"
#include <QGuiApplication>
#include <QStyle>
@ -54,7 +53,7 @@ void StartWithBox(
std::move(data),
&st::boxLabel,
&st::groupCallRtmpShowButton,
&st::settingsSubsectionTitle,
&st::defaultSubsectionTitle,
&st::attentionBoxButton,
&st::defaultPopupMenu);

View file

@ -16,7 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/painter.h"
#include "styles/style_chat.h"
#include "styles/style_premium.h"
#include "styles/style_settings.h"
#include "styles/style_layers.h"
namespace HistoryView {
@ -52,7 +52,7 @@ ServiceBox::ServiceBox(
- st::msgPadding.left()
- st::msgPadding.right())
, _title(
st::settingsSubsectionTitle.style,
st::defaultSubsectionTitle.style,
_content->title(),
kDefaultTextOptions,
_maxWidth)

View file

@ -184,7 +184,7 @@ void AddPremiumTopBarWithDefaultTitleBar(
st::giveawayGiftCodeTopHeight
- st::boxTitleHeight
+ st::boxDividerHeight
+ st::settingsSectionSkip,
+ st::defaultVerticalListSkip,
st::boxDividerBg,
RectPart::Bottom),
{});
@ -720,7 +720,7 @@ void CreateGiveawayBox(
dateContainer->add(object_ptr<Ui::DividerLabel>(
dateContainer,
std::move(terms),
st::settingsDividerLabelPadding));
st::defaultBoxDividerLabelPadding));
} else {
Ui::AddDividerText(
dateContainer,
@ -761,7 +761,7 @@ void CreateGiveawayBox(
listOptions->add(object_ptr<Ui::DividerLabel>(
listOptions,
std::move(termsContainer),
st::settingsDividerLabelPadding));
st::defaultBoxDividerLabelPadding));
box->verticalLayout()->resizeToWidth(box->width());
};

View file

@ -758,6 +758,10 @@ topBarConnectingAnimation: InfiniteRadialAnimation(defaultInfiniteRadialAnimatio
size: size(8px, 8px);
}
inviteLinkTitleRight: FlatLabel(defaultSubsectionTitle) {
minWidth: 0px;
}
inviteLinkFieldRadius: 5px;
inviteLinkFieldHeight: 42px;
inviteLinkFieldMargin: margins(14px, 12px, 36px, 9px);

View file

@ -163,7 +163,7 @@ void Manage::setupContent() {
content,
tr::lng_settings_cloud_password_manage_about2(),
st::boxDividerLabel),
st::settingsDividerLabelPadding));
st::defaultBoxDividerLabelPadding));
rpl::combine(
about->geometryValue(),
content->widthValue()

View file

@ -47,7 +47,6 @@ settingsOptionDisabled: SettingsButton(settingsButtonNoIcon) {
textBgOver: windowBg;
toggleOver: infoProfileToggle;
}
settingsSectionSkip: 6px;
settingsButtonRightSkip: 23px;
settingsScalePadding: margins(60px, 7px, 22px, 4px);
settingsBigScalePadding: margins(21px, 7px, 21px, 4px);
@ -72,7 +71,6 @@ settingsUpdateState: FlatLabel(defaultFlatLabel) {
settingsUpdate: SettingsButton(infoMainButton, settingsButtonNoIcon) {
}
settingsUpdateStatePosition: point(22px, 29px);
settingsDividerLabelPadding: margins(22px, 8px, 22px, 16px);
settingsIconChat: icon {{ "settings/chat", settingsIconFg }};
settingsIconInterfaceScale: icon {{ "settings/interface_scale", settingsIconFg }};
@ -128,17 +126,6 @@ settingsSendTypeSkip: 5px;
settingsBackgroundThumb: 76px;
settingsThumbSkip: 16px;
settingsSubsectionTitle: FlatLabel(defaultFlatLabel) {
style: TextStyle(semiboldTextStyle) {
font: font(boxFontSize semibold);
}
textFg: windowActiveTextFg;
minWidth: 240px;
}
settingsSubsectionTitleRight: FlatLabel(settingsSubsectionTitle) {
minWidth: 0px;
}
settingsSubsectionTitlePadding: margins(22px, 7px, 10px, 9px);
settingsBackgroundPadding: margins(22px, 11px, 10px, 12px);
settingsTileSkip: 15px;
settingsFromGalleryTop: 2px;
@ -501,14 +488,6 @@ settingsNotificationTypeDetails: FlatLabel(defaultFlatLabel) {
textFg: windowSubTextFg;
}
requestPeerRestriction: FlatLabel(defaultFlatLabel) {
minWidth: 240px;
textFg: membersAboutLimitFg;
style: TextStyle(boxTextStyle) {
lineHeight: 22px;
}
}
powerSavingButton: SettingsButton(settingsButton) {
style: boxTextStyle;
padding: margins(57px, 8px, 22px, 8px);

View file

@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_session_controller.h"
#include "styles/style_settings.h"
#include "styles/style_boxes.h"
#include "styles/style_layers.h"
#include "styles/style_menu_icons.h"
namespace Settings {
@ -220,11 +221,11 @@ void Blocked::setupContent() {
) | rpl::start_with_next([=](int height, bool empty) {
const auto subtitled = !empty || (_countBlocked.current() > 0);
const auto total = st::settingsBlockedHeightMin;
const auto padding = st::settingsSubsectionTitlePadding
const auto padding = st::defaultSubsectionTitlePadding
+ st::settingsBlockedListSubtitleAddPadding;
const auto subtitle = st::settingsSectionSkip
const auto subtitle = st::defaultVerticalListSkip
+ padding.top()
+ st::settingsSubsectionTitle.style.font->height
+ st::defaultSubsectionTitle.style.font->height
+ padding.bottom();
const auto min = total - (subtitled ? subtitle : 0);
resize(width(), std::max(height, min));

View file

@ -363,7 +363,7 @@ void ColorsPalette::updateInnerGeometry() {
const auto width = inner->width() - padding.left() - padding.right();
const auto skip = (width - size * _buttons.size())
/ float64(_buttons.size() - 1);
const auto y = st::settingsSectionSkip * 2;
const auto y = st::defaultVerticalListSkip * 2;
auto x = float64(padding.left());
for (const auto &button : _buttons) {
button->moveToLeft(int(base::SafeRound(x)), y);
@ -1499,7 +1499,7 @@ void SetupCloudThemes(
showAll->widthValue()
) | rpl::start_with_next([=](int top, int outerWidth, int width) {
showAll->moveToRight(
st::settingsSubsectionTitlePadding.left(),
st::defaultSubsectionTitlePadding.left(),
top,
outerWidth);
}, showAll->lifetime());
@ -1557,7 +1557,7 @@ void SetupCloudThemes(
return (Background()->themeObject().cloud.createdBy == userId);
}));
Ui::AddSkip(inner, 2 * st::settingsSectionSkip);
Ui::AddSkip(inner, 2 * st::defaultVerticalListSkip);
wrap->setDuration(0)->toggleOn(list->empty() | rpl::map(!_1));
}

View file

@ -104,7 +104,7 @@ void SetupExperimental(
container,
tr::lng_settings_experimental_about(),
st::boxLabel),
st::settingsDividerLabelPadding);
st::defaultBoxDividerLabelPadding);
auto reset = (Button*)nullptr;
if (base::options::changed()) {

View file

@ -284,7 +284,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
}
const auto left = (_state == State::Suggested)
? st::settingsSubsectionTitlePadding.left()
? st::defaultSubsectionTitlePadding.left()
: st::settingsButtonActive.padding.left();
const auto buttonsLeft = std::min(
_add.x(),
@ -341,7 +341,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
const auto limit = [=] {
return Data::PremiumLimits(session).dialogFiltersCurrent();
};
Ui::AddSkip(container, st::settingsSectionSkip);
Ui::AddSkip(container, st::defaultVerticalListSkip);
Ui::AddSubsectionTitle(container, tr::lng_filters_subtitle());
struct State {
@ -612,7 +612,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
}, button->lifetime());
}
aboutRows->resizeToWidth(container->width());
Ui::AddSkip(aboutRows, st::settingsSectionSkip);
Ui::AddSkip(aboutRows, st::defaultVerticalListSkip);
}, aboutRows->lifetime());
auto showSuggestions = rpl::combine(

View file

@ -416,7 +416,7 @@ void GlobalTTL::setupContent() {
content->add(object_ptr<Ui::DividerLabel>(
content,
std::move(footer),
st::settingsDividerLabelPadding));
st::defaultBoxDividerLabelPadding));
Ui::ResizeFitChild(this, content);
}

View file

@ -498,7 +498,7 @@ void LocalPasscodeManage::setupContent() {
return s1 + "\n\n" + s2;
}),
st::boxDividerLabel),
st::settingsDividerLabelPadding));
st::defaultBoxDividerLabelPadding));
about->geometryValue(
) | rpl::start_with_next([=](const QRect &r) {
divider->setGeometry(r);

View file

@ -718,9 +718,9 @@ NotifyPreview::NotifyPreview(bool nameShown, bool previewShown)
_logo.setDevicePixelRatio(ratio);
_name.setText(
st::settingsSubsectionTitle.style,
st::defaultSubsectionTitle.style,
tr::lng_notification_preview_title(tr::now));
_title.setText(st::settingsSubsectionTitle.style, AppName.utf16());
_title.setText(st::defaultSubsectionTitle.style, AppName.utf16());
_text.setText(
st::boxTextStyle,

View file

@ -886,7 +886,7 @@ void Premium::setupSubscriptionOptions(
const auto lastSkip = TopTransitionSkip() * (isEmojiStatus ? 1 : 2);
Ui::AddSkip(content, lastSkip - st::settingsSectionSkip);
Ui::AddSkip(content, lastSkip - st::defaultVerticalListSkip);
Ui::AddSkip(skip->entity(), lastSkip);
auto toggleOn = rpl::combine(
@ -1100,7 +1100,7 @@ void Premium::setupContent() {
tr::lng_premium_summary_bottom_subtitle(
) | rpl::map(Ui::Text::Bold),
stLabel),
st::settingsSubsectionTitlePadding);
st::defaultSubsectionTitlePadding);
content->add(
object_ptr<Ui::FlatLabel>(
content,

View file

@ -585,7 +585,7 @@ object_ptr<Ui::RpWidget> PhoneNumberPrivacyController::setupMiddleWidget(
addOption(Option::Contacts);
Ui::AddSkip(
container,
st::settingsSectionSkip + st::settingsPrivacySkipTop);
st::defaultVerticalListSkip + st::settingsPrivacySkipTop);
Ui::AddDivider(container);
using namespace rpl::mappers;
@ -917,7 +917,7 @@ object_ptr<Ui::RpWidget> ForwardsPrivacyController::setupAboveWidget(
object_ptr<Ui::RpWidget>(parent),
style::margins(
0,
st::settingsSectionSkip,
st::defaultVerticalListSkip,
0,
st::settingsPrivacySkipTop));
const auto widget = result->entity();

View file

@ -633,7 +633,7 @@ void Content::Inner::setupContent() {
content,
tr::lng_settings_logged_in_description(),
st::boxDividerLabel),
st::settingsDividerLabelPadding + QMargins(0, skip, 0, skip))
st::defaultBoxDividerLabelPadding + QMargins(0, skip, 0, skip))
)->setDuration(0);
terminateWrap->toggleOn(_list->itemsCount() | rpl::map(_1 > 0));

View file

@ -17,7 +17,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/debug_log.h"
#include "styles/style_info.h"
#include "styles/style_layers.h"
#include "styles/style_settings.h"
namespace Ui {
namespace {
@ -183,7 +182,7 @@ void Row::paintEvent(QPaintEvent *e) {
p.setPen(Qt::NoPen);
p.setBrush(color);
const auto left = st::settingsSubsectionTitlePadding.left();
const auto left = st::defaultSubsectionTitlePadding.left();
const auto toggleRect = SettingsButton::maybeToggleRect();
const auto right = left
+ (toggleRect.isEmpty() ? 0 : (width() - toggleRect.x()));

View file

@ -62,9 +62,9 @@ void EditInviteLinkBox(
object_ptr<FlatLabel>(
container,
std::move(text),
st::settingsSubsectionTitle),
(st::settingsSubsectionTitlePadding
+ style::margins(0, st::settingsSectionSkip, 0, 0)));
st::defaultSubsectionTitle),
(st::defaultSubsectionTitlePadding
+ style::margins(0, st::defaultVerticalListSkip, 0, 0)));
};
const auto addDivider = [&](
not_null<VerticalLayout*> container,
@ -77,7 +77,7 @@ void EditInviteLinkBox(
container,
std::move(text),
st::boxDividerLabel),
st::settingsDividerLabelPadding),
st::defaultBoxDividerLabelPadding),
margins);
};
@ -108,7 +108,7 @@ void EditInviteLinkBox(
container,
tr::lng_group_invite_request_approve(),
st::settingsButtonNoIcon),
style::margins{ 0, 0, 0, st::settingsSectionSkip });
style::margins{ 0, 0, 0, st::defaultVerticalListSkip });
if (requestApproval) {
requestApproval->toggleOn(state->requestApproval.value());
state->requestApproval = requestApproval->toggledValue();
@ -129,17 +129,17 @@ void EditInviteLinkBox(
tr::lng_group_invite_label_header(),
data.label),
style::margins(
st::settingsSubsectionTitlePadding.left(),
st::settingsSectionSkip,
st::settingsSubsectionTitlePadding.right(),
st::settingsSectionSkip * 2));
st::defaultSubsectionTitlePadding.left(),
st::defaultVerticalListSkip,
st::defaultSubsectionTitlePadding.right(),
st::defaultVerticalListSkip * 2));
labelField->setMaxLength(kMaxLabelLength);
addDivider(container, tr::lng_group_invite_label_about());
addTitle(container, tr::lng_group_invite_expire_title());
const auto expiresWrap = container->add(
object_ptr<VerticalLayout>(container),
style::margins(0, 0, 0, st::settingsSectionSkip));
style::margins(0, 0, 0, st::defaultVerticalListSkip));
addDivider(
container,
tr::lng_group_invite_expire_about());
@ -152,7 +152,7 @@ void EditInviteLinkBox(
addTitle(usagesInner, tr::lng_group_invite_usage_title());
const auto usagesWrap = usagesInner->add(
object_ptr<VerticalLayout>(usagesInner),
style::margins(0, 0, 0, st::settingsSectionSkip));
style::margins(0, 0, 0, st::defaultVerticalListSkip));
addDivider(usagesInner, tr::lng_group_invite_usage_about());
static const auto addButton = [](

View file

@ -12,18 +12,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/wrap/padding_wrap.h"
#include "ui/wrap/vertical_layout.h"
#include "styles/style_layers.h"
#include "styles/style_settings.h"
namespace Ui {
void AddSkip(not_null<Ui::VerticalLayout*> container) {
AddSkip(container, st::settingsSectionSkip);
AddSkip(container, st::defaultVerticalListSkip);
}
void AddSkip(not_null<Ui::VerticalLayout*> container, int skip) {
container->add(object_ptr<Ui::FixedHeightWidget>(
container,
skip));
container->add(object_ptr<Ui::FixedHeightWidget>(container, skip));
}
void AddDivider(not_null<Ui::VerticalLayout*> container) {
@ -39,7 +36,7 @@ void AddDividerText(
container,
std::move(text),
st::boxDividerLabel),
st::settingsDividerLabelPadding));
st::defaultBoxDividerLabelPadding));
}
not_null<Ui::FlatLabel*> AddSubsectionTitle(
@ -51,8 +48,8 @@ not_null<Ui::FlatLabel*> AddSubsectionTitle(
object_ptr<Ui::FlatLabel>(
container,
std::move(text),
st ? *st : st::settingsSubsectionTitle),
st::settingsSubsectionTitlePadding + addPadding);
st ? *st : st::defaultSubsectionTitle),
st::defaultSubsectionTitlePadding + addPadding);
}
} // namespace Ui

View file

@ -44,7 +44,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "apiwrap.h"
#include "styles/style_widgets.h"
#include "styles/style_window.h"
#include "styles/style_settings.h"
#include "styles/style_layers.h"
#include "styles/style_boxes.h"
@ -853,8 +852,8 @@ void SaveThemeBox(
object_ptr<Ui::FlatLabel>(
box,
tr::lng_theme_editor_background_image(),
st::settingsSubsectionTitle),
st::settingsSubsectionTitlePadding);
st::defaultSubsectionTitle),
st::defaultSubsectionTitlePadding);
const auto back = box->addRow(
object_ptr<BackgroundSelector>(
box,

@ -1 +1 @@
Subproject commit 388fc709186f6a47d42efaa922876ea39a9950b6
Subproject commit 164877a0dcbfed41b7b496c807704b7efd693644