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>( auto widget = object_ptr<Ui::DividerLabel>(
(QWidget*)nullptr, (QWidget*)nullptr,
std::move(layout), std::move(layout),
st::settingsDividerLabelPadding); st::defaultBoxDividerLabelPadding);
raw->add(object_ptr<Ui::FlatLabel>( raw->add(object_ptr<Ui::FlatLabel>(
raw, raw,
(_action == ToggleAction::Removing (_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_chat.h"
#include "styles/style_layers.h" #include "styles/style_layers.h"
#include "styles/style_boxes.h" #include "styles/style_boxes.h"
#include "styles/style_settings.h"
#include <QtGui/QClipboard> #include <QtGui/QClipboard>
#include <QtGui/QGuiApplication> #include <QtGui/QGuiApplication>
@ -296,7 +295,7 @@ void BackgroundPreviewBox::createDimmingSlider(bool dark) {
Ui::AddSubsectionTitle( Ui::AddSubsectionTitle(
inner, inner,
tr::lng_background_dimming(), 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); equals ? nullptr : dark ? &_dark->subtitle : &_light->subtitle);
_dimmingSlider = inner->add( _dimmingSlider = inner->add(
object_ptr<Ui::MediaSlider>( object_ptr<Ui::MediaSlider>(
@ -378,7 +377,7 @@ auto BackgroundPreviewBox::prepareOverridenStyle(bool dark)
.box = st::defaultBox, .box = st::defaultBox,
.toggle = toggle, .toggle = toggle,
.slider = st::defaultContinuousSlider, .slider = st::defaultContinuousSlider,
.subtitle = st::settingsSubsectionTitle, .subtitle = st::defaultSubsectionTitle,
}; };
result.box.button.textFg = p->lightButtonFg(); result.box.button.textFg = p->lightButtonFg();
result.box.button.textFgOver = p->lightButtonFgOver(); 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) { requestsBoxItem: PeerListItem(peerListBoxItem) {
height: 99px; height: 99px;
button: OutlineButton(defaultPeerListButton) { button: OutlineButton(defaultPeerListButton) {

View file

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

View file

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

View file

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

View file

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

View file

@ -28,7 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_session_controller.h" #include "window/window_session_controller.h"
#include "styles/style_boxes.h" #include "styles/style_boxes.h"
#include "styles/style_chat_helpers.h" #include "styles/style_chat_helpers.h"
#include "styles/style_settings.h" #include "styles/style_layers.h"
namespace { namespace {
@ -356,7 +356,7 @@ void ChoosePeerBoxController::prepareRestrictions() {
raw, raw,
tr::lng_request_peer_requirements(), tr::lng_request_peer_requirements(),
{ 0, st::membersMarginTop, 0, 0 }); { 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 "); auto separator = QString::fromUtf8("\n\xE2\x80\xA2 ");
raw->add( raw->add(
object_ptr<Ui::FlatLabel>( 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_menu_icons.h"
#include "styles/style_boxes.h" #include "styles/style_boxes.h"
#include "styles/style_info.h" #include "styles/style_info.h"
#include "styles/style_settings.h"
namespace { namespace {
@ -581,7 +580,7 @@ object_ptr<Ui::RpWidget> Controller::createStickersEdit() {
Ui::AddSubsectionTitle( Ui::AddSubsectionTitle(
container, container,
tr::lng_group_stickers(), tr::lng_group_stickers(),
{ 0, st::settingsSubsectionTitlePadding.top() - bottomSkip, 0, 0 }); { 0, st::defaultSubsectionTitlePadding.top() - bottomSkip, 0, 0 });
AddButtonWithCount( AddButtonWithCount(
container, container,
@ -1009,7 +1008,7 @@ void Controller::fillManageSection() {
kBotManagerUsername.utf16()))), kBotManagerUsername.utf16()))),
Ui::Text::RichLangValue), Ui::Text::RichLangValue),
st::boxDividerLabel), st::boxDividerLabel),
st::settingsDividerLabelPadding)); st::defaultBoxDividerLabelPadding));
return; return;
} }

View file

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

View file

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

View file

@ -45,7 +45,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_layers.h" #include "styles/style_layers.h"
#include "styles/style_boxes.h" #include "styles/style_boxes.h"
#include "styles/style_info.h" #include "styles/style_info.h"
#include "styles/style_settings.h"
namespace { namespace {
@ -425,8 +424,8 @@ object_ptr<Ui::RpWidget> Controller::createUsernameEdit() {
object_ptr<Ui::FlatLabel>( object_ptr<Ui::FlatLabel>(
container, container,
tr::lng_create_group_link(), tr::lng_create_group_link(),
st::settingsSubsectionTitle), st::defaultSubsectionTitle),
st::settingsSubsectionTitlePadding); st::defaultSubsectionTitlePadding);
const auto placeholder = container->add( const auto placeholder = container->add(
object_ptr<Ui::RpWidget>(container), 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 "ui/wrap/vertical_layout_reorder.h"
#include "styles/style_boxes.h" // contactsStatusFont. #include "styles/style_boxes.h" // contactsStatusFont.
#include "styles/style_info.h" #include "styles/style_info.h"
#include "styles/style_settings.h" #include "styles/style_layers.h"
#include "styles/style_menu_icons.h" #include "styles/style_menu_icons.h"
#include <QtGui/QGuiApplication> #include <QtGui/QGuiApplication>
@ -238,8 +238,8 @@ void UsernamesList::rebuild(const Data::Usernames &usernames) {
_peer->isSelf() _peer->isSelf()
? tr::lng_usernames_subtitle() ? tr::lng_usernames_subtitle()
: tr::lng_channel_usernames_subtitle(), : tr::lng_channel_usernames_subtitle(),
st::settingsSubsectionTitle), st::defaultSubsectionTitle),
st::settingsSubsectionTitlePadding); st::defaultSubsectionTitlePadding);
} }
const auto content = _container->add( const auto content = _container->add(

View file

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

View file

@ -116,12 +116,12 @@ private:
void RenameBox(not_null<Ui::GenericBox*> box) { void RenameBox(not_null<Ui::GenericBox*> box) {
box->setTitle(tr::lng_settings_rename_device_title()); box->setTitle(tr::lng_settings_rename_device_title());
const auto skip = st::settingsSubsectionTitlePadding.top(); const auto skip = st::defaultSubsectionTitlePadding.top();
box->addRow( box->addRow(
object_ptr<Ui::FlatLabel>( object_ptr<Ui::FlatLabel>(
box, box,
tr::lng_settings_device_name(), tr::lng_settings_device_name(),
st::settingsSubsectionTitle), st::defaultSubsectionTitle),
st::boxRowPadding + style::margins(0, skip, 0, 0)); st::boxRowPadding + style::margins(0, skip, 0, 0));
const auto name = box->addRow( const auto name = box->addRow(
object_ptr<Ui::InputField>( object_ptr<Ui::InputField>(
@ -920,8 +920,8 @@ void SessionsContent::Inner::setupContent() {
) | rpl::start_with_next([=](QSize outer, QPoint position) { ) | rpl::start_with_next([=](QSize outer, QPoint position) {
const auto x = st::sessionTerminateSkip const auto x = st::sessionTerminateSkip
+ st::sessionTerminate.iconPosition.x(); + st::sessionTerminate.iconPosition.x();
const auto y = st::settingsSubsectionTitlePadding.top() const auto y = st::defaultSubsectionTitlePadding.top()
+ st::settingsSubsectionTitle.style.font->ascent + st::defaultSubsectionTitle.style.font->ascent
- st::defaultLinkButton.font->ascent; - st::defaultLinkButton.font->ascent;
rename->moveToRight(x, y, outer.width()); rename->moveToRight(x, y, outer.width());
}, rename->lifetime()); }, rename->lifetime());
@ -999,7 +999,7 @@ void SessionsContent::Inner::setupContent() {
content, content,
tr::lng_sessions_other_desc(), tr::lng_sessions_other_desc(),
st::boxDividerLabel), st::boxDividerLabel),
st::settingsDividerLabelPadding))->setDuration(0); st::defaultBoxDividerLabelPadding))->setDuration(0);
terminateWrap->toggleOn( terminateWrap->toggleOn(
rpl::combine( 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_chat_helpers.h"
#include "styles/style_info.h" // inviteLinkListItem. #include "styles/style_info.h" // inviteLinkListItem.
#include "styles/style_layers.h" #include "styles/style_layers.h"
#include "styles/style_settings.h" // settingsSubsectionTitlePadding.
#include <QLocale> #include <QLocale>
@ -187,7 +186,7 @@ void TranslateBox(
Ui::AddSkip(container); Ui::AddSkip(container);
{ {
const auto padding = st::settingsSubsectionTitlePadding; const auto padding = st::defaultSubsectionTitlePadding;
const auto subtitle = Ui::AddSubsectionTitle( const auto subtitle = Ui::AddSubsectionTitle(
container, container,
state->to.value() | rpl::map(LanguageName)); 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 "ui/wrap/slide_wrap.h"
#include "styles/style_layers.h" #include "styles/style_layers.h"
#include "styles/style_boxes.h" #include "styles/style_boxes.h"
#include "styles/style_settings.h"
namespace { namespace {
@ -369,7 +368,7 @@ void UsernamesBox(
container, container,
std::move(description), std::move(description),
st::boxDividerLabel), st::boxDividerLabel),
st::settingsDividerLabelPadding)); st::defaultBoxDividerLabelPadding));
const auto list = box->addRow( const auto list = box->addRow(
object_ptr<UsernamesList>( object_ptr<UsernamesList>(

View file

@ -12,7 +12,7 @@ using "ui/layers/layers.style";
using "ui/chat/chat.style"; // GroupCallUserpics using "ui/chat/chat.style"; // GroupCallUserpics
using "info/info.style"; // ShortInfoCover using "info/info.style"; // ShortInfoCover
using "window/window.style"; using "window/window.style";
using "settings/settings.style"; // settingsSubsectionTitle using "settings/settings.style"; // defaultSubsectionTitle
CallSignalBars { CallSignalBars {
width: pixels; width: pixels;
@ -1374,7 +1374,7 @@ groupCallRtmpShowButton: IconButton(defaultIconButton) {
groupCallSettingsRtmpShowButton: IconButton(groupCallRtmpShowButton) { groupCallSettingsRtmpShowButton: IconButton(groupCallRtmpShowButton) {
ripple: groupCallRipple; ripple: groupCallRipple;
} }
groupCallSubsectionTitle: FlatLabel(settingsSubsectionTitle) { groupCallSubsectionTitle: FlatLabel(defaultSubsectionTitle) {
textFg: groupCallActiveFg; textFg: groupCallActiveFg;
} }
groupCallAttentionBoxButton: RoundButton(groupCallBoxButton) { 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_info.h"
#include "styles/style_layers.h" #include "styles/style_layers.h"
#include "styles/style_menu_icons.h" #include "styles/style_menu_icons.h"
#include "styles/style_settings.h"
#include <QGuiApplication> #include <QGuiApplication>
#include <QStyle> #include <QStyle>
@ -54,7 +53,7 @@ void StartWithBox(
std::move(data), std::move(data),
&st::boxLabel, &st::boxLabel,
&st::groupCallRtmpShowButton, &st::groupCallRtmpShowButton,
&st::settingsSubsectionTitle, &st::defaultSubsectionTitle,
&st::attentionBoxButton, &st::attentionBoxButton,
&st::defaultPopupMenu); &st::defaultPopupMenu);

View file

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

View file

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

View file

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

View file

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

View file

@ -47,7 +47,6 @@ settingsOptionDisabled: SettingsButton(settingsButtonNoIcon) {
textBgOver: windowBg; textBgOver: windowBg;
toggleOver: infoProfileToggle; toggleOver: infoProfileToggle;
} }
settingsSectionSkip: 6px;
settingsButtonRightSkip: 23px; settingsButtonRightSkip: 23px;
settingsScalePadding: margins(60px, 7px, 22px, 4px); settingsScalePadding: margins(60px, 7px, 22px, 4px);
settingsBigScalePadding: margins(21px, 7px, 21px, 4px); settingsBigScalePadding: margins(21px, 7px, 21px, 4px);
@ -72,7 +71,6 @@ settingsUpdateState: FlatLabel(defaultFlatLabel) {
settingsUpdate: SettingsButton(infoMainButton, settingsButtonNoIcon) { settingsUpdate: SettingsButton(infoMainButton, settingsButtonNoIcon) {
} }
settingsUpdateStatePosition: point(22px, 29px); settingsUpdateStatePosition: point(22px, 29px);
settingsDividerLabelPadding: margins(22px, 8px, 22px, 16px);
settingsIconChat: icon {{ "settings/chat", settingsIconFg }}; settingsIconChat: icon {{ "settings/chat", settingsIconFg }};
settingsIconInterfaceScale: icon {{ "settings/interface_scale", settingsIconFg }}; settingsIconInterfaceScale: icon {{ "settings/interface_scale", settingsIconFg }};
@ -128,17 +126,6 @@ settingsSendTypeSkip: 5px;
settingsBackgroundThumb: 76px; settingsBackgroundThumb: 76px;
settingsThumbSkip: 16px; 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); settingsBackgroundPadding: margins(22px, 11px, 10px, 12px);
settingsTileSkip: 15px; settingsTileSkip: 15px;
settingsFromGalleryTop: 2px; settingsFromGalleryTop: 2px;
@ -501,14 +488,6 @@ settingsNotificationTypeDetails: FlatLabel(defaultFlatLabel) {
textFg: windowSubTextFg; textFg: windowSubTextFg;
} }
requestPeerRestriction: FlatLabel(defaultFlatLabel) {
minWidth: 240px;
textFg: membersAboutLimitFg;
style: TextStyle(boxTextStyle) {
lineHeight: 22px;
}
}
powerSavingButton: SettingsButton(settingsButton) { powerSavingButton: SettingsButton(settingsButton) {
style: boxTextStyle; style: boxTextStyle;
padding: margins(57px, 8px, 22px, 8px); 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 "window/window_session_controller.h"
#include "styles/style_settings.h" #include "styles/style_settings.h"
#include "styles/style_boxes.h" #include "styles/style_boxes.h"
#include "styles/style_layers.h"
#include "styles/style_menu_icons.h" #include "styles/style_menu_icons.h"
namespace Settings { namespace Settings {
@ -220,11 +221,11 @@ void Blocked::setupContent() {
) | rpl::start_with_next([=](int height, bool empty) { ) | rpl::start_with_next([=](int height, bool empty) {
const auto subtitled = !empty || (_countBlocked.current() > 0); const auto subtitled = !empty || (_countBlocked.current() > 0);
const auto total = st::settingsBlockedHeightMin; const auto total = st::settingsBlockedHeightMin;
const auto padding = st::settingsSubsectionTitlePadding const auto padding = st::defaultSubsectionTitlePadding
+ st::settingsBlockedListSubtitleAddPadding; + st::settingsBlockedListSubtitleAddPadding;
const auto subtitle = st::settingsSectionSkip const auto subtitle = st::defaultVerticalListSkip
+ padding.top() + padding.top()
+ st::settingsSubsectionTitle.style.font->height + st::defaultSubsectionTitle.style.font->height
+ padding.bottom(); + padding.bottom();
const auto min = total - (subtitled ? subtitle : 0); const auto min = total - (subtitled ? subtitle : 0);
resize(width(), std::max(height, min)); 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 width = inner->width() - padding.left() - padding.right();
const auto skip = (width - size * _buttons.size()) const auto skip = (width - size * _buttons.size())
/ float64(_buttons.size() - 1); / float64(_buttons.size() - 1);
const auto y = st::settingsSectionSkip * 2; const auto y = st::defaultVerticalListSkip * 2;
auto x = float64(padding.left()); auto x = float64(padding.left());
for (const auto &button : _buttons) { for (const auto &button : _buttons) {
button->moveToLeft(int(base::SafeRound(x)), y); button->moveToLeft(int(base::SafeRound(x)), y);
@ -1499,7 +1499,7 @@ void SetupCloudThemes(
showAll->widthValue() showAll->widthValue()
) | rpl::start_with_next([=](int top, int outerWidth, int width) { ) | rpl::start_with_next([=](int top, int outerWidth, int width) {
showAll->moveToRight( showAll->moveToRight(
st::settingsSubsectionTitlePadding.left(), st::defaultSubsectionTitlePadding.left(),
top, top,
outerWidth); outerWidth);
}, showAll->lifetime()); }, showAll->lifetime());
@ -1557,7 +1557,7 @@ void SetupCloudThemes(
return (Background()->themeObject().cloud.createdBy == userId); 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)); wrap->setDuration(0)->toggleOn(list->empty() | rpl::map(!_1));
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -633,7 +633,7 @@ void Content::Inner::setupContent() {
content, content,
tr::lng_settings_logged_in_description(), tr::lng_settings_logged_in_description(),
st::boxDividerLabel), st::boxDividerLabel),
st::settingsDividerLabelPadding + QMargins(0, skip, 0, skip)) st::defaultBoxDividerLabelPadding + QMargins(0, skip, 0, skip))
)->setDuration(0); )->setDuration(0);
terminateWrap->toggleOn(_list->itemsCount() | rpl::map(_1 > 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 "base/debug_log.h"
#include "styles/style_info.h" #include "styles/style_info.h"
#include "styles/style_layers.h" #include "styles/style_layers.h"
#include "styles/style_settings.h"
namespace Ui { namespace Ui {
namespace { namespace {
@ -183,7 +182,7 @@ void Row::paintEvent(QPaintEvent *e) {
p.setPen(Qt::NoPen); p.setPen(Qt::NoPen);
p.setBrush(color); p.setBrush(color);
const auto left = st::settingsSubsectionTitlePadding.left(); const auto left = st::defaultSubsectionTitlePadding.left();
const auto toggleRect = SettingsButton::maybeToggleRect(); const auto toggleRect = SettingsButton::maybeToggleRect();
const auto right = left const auto right = left
+ (toggleRect.isEmpty() ? 0 : (width() - toggleRect.x())); + (toggleRect.isEmpty() ? 0 : (width() - toggleRect.x()));

View file

@ -62,9 +62,9 @@ void EditInviteLinkBox(
object_ptr<FlatLabel>( object_ptr<FlatLabel>(
container, container,
std::move(text), std::move(text),
st::settingsSubsectionTitle), st::defaultSubsectionTitle),
(st::settingsSubsectionTitlePadding (st::defaultSubsectionTitlePadding
+ style::margins(0, st::settingsSectionSkip, 0, 0))); + style::margins(0, st::defaultVerticalListSkip, 0, 0)));
}; };
const auto addDivider = [&]( const auto addDivider = [&](
not_null<VerticalLayout*> container, not_null<VerticalLayout*> container,
@ -77,7 +77,7 @@ void EditInviteLinkBox(
container, container,
std::move(text), std::move(text),
st::boxDividerLabel), st::boxDividerLabel),
st::settingsDividerLabelPadding), st::defaultBoxDividerLabelPadding),
margins); margins);
}; };
@ -108,7 +108,7 @@ void EditInviteLinkBox(
container, container,
tr::lng_group_invite_request_approve(), tr::lng_group_invite_request_approve(),
st::settingsButtonNoIcon), st::settingsButtonNoIcon),
style::margins{ 0, 0, 0, st::settingsSectionSkip }); style::margins{ 0, 0, 0, st::defaultVerticalListSkip });
if (requestApproval) { if (requestApproval) {
requestApproval->toggleOn(state->requestApproval.value()); requestApproval->toggleOn(state->requestApproval.value());
state->requestApproval = requestApproval->toggledValue(); state->requestApproval = requestApproval->toggledValue();
@ -129,17 +129,17 @@ void EditInviteLinkBox(
tr::lng_group_invite_label_header(), tr::lng_group_invite_label_header(),
data.label), data.label),
style::margins( style::margins(
st::settingsSubsectionTitlePadding.left(), st::defaultSubsectionTitlePadding.left(),
st::settingsSectionSkip, st::defaultVerticalListSkip,
st::settingsSubsectionTitlePadding.right(), st::defaultSubsectionTitlePadding.right(),
st::settingsSectionSkip * 2)); st::defaultVerticalListSkip * 2));
labelField->setMaxLength(kMaxLabelLength); labelField->setMaxLength(kMaxLabelLength);
addDivider(container, tr::lng_group_invite_label_about()); addDivider(container, tr::lng_group_invite_label_about());
addTitle(container, tr::lng_group_invite_expire_title()); addTitle(container, tr::lng_group_invite_expire_title());
const auto expiresWrap = container->add( const auto expiresWrap = container->add(
object_ptr<VerticalLayout>(container), object_ptr<VerticalLayout>(container),
style::margins(0, 0, 0, st::settingsSectionSkip)); style::margins(0, 0, 0, st::defaultVerticalListSkip));
addDivider( addDivider(
container, container,
tr::lng_group_invite_expire_about()); tr::lng_group_invite_expire_about());
@ -152,7 +152,7 @@ void EditInviteLinkBox(
addTitle(usagesInner, tr::lng_group_invite_usage_title()); addTitle(usagesInner, tr::lng_group_invite_usage_title());
const auto usagesWrap = usagesInner->add( const auto usagesWrap = usagesInner->add(
object_ptr<VerticalLayout>(usagesInner), 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()); addDivider(usagesInner, tr::lng_group_invite_usage_about());
static const auto addButton = []( 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/padding_wrap.h"
#include "ui/wrap/vertical_layout.h" #include "ui/wrap/vertical_layout.h"
#include "styles/style_layers.h" #include "styles/style_layers.h"
#include "styles/style_settings.h"
namespace Ui { namespace Ui {
void AddSkip(not_null<Ui::VerticalLayout*> container) { void AddSkip(not_null<Ui::VerticalLayout*> container) {
AddSkip(container, st::settingsSectionSkip); AddSkip(container, st::defaultVerticalListSkip);
} }
void AddSkip(not_null<Ui::VerticalLayout*> container, int skip) { void AddSkip(not_null<Ui::VerticalLayout*> container, int skip) {
container->add(object_ptr<Ui::FixedHeightWidget>( container->add(object_ptr<Ui::FixedHeightWidget>(container, skip));
container,
skip));
} }
void AddDivider(not_null<Ui::VerticalLayout*> container) { void AddDivider(not_null<Ui::VerticalLayout*> container) {
@ -39,7 +36,7 @@ void AddDividerText(
container, container,
std::move(text), std::move(text),
st::boxDividerLabel), st::boxDividerLabel),
st::settingsDividerLabelPadding)); st::defaultBoxDividerLabelPadding));
} }
not_null<Ui::FlatLabel*> AddSubsectionTitle( not_null<Ui::FlatLabel*> AddSubsectionTitle(
@ -51,8 +48,8 @@ not_null<Ui::FlatLabel*> AddSubsectionTitle(
object_ptr<Ui::FlatLabel>( object_ptr<Ui::FlatLabel>(
container, container,
std::move(text), std::move(text),
st ? *st : st::settingsSubsectionTitle), st ? *st : st::defaultSubsectionTitle),
st::settingsSubsectionTitlePadding + addPadding); st::defaultSubsectionTitlePadding + addPadding);
} }
} // namespace Ui } // namespace Ui

View file

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

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