From 819020e51564565174e90b2d0c56f6df4323192c Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 15 Nov 2023 03:27:13 +0300 Subject: [PATCH] Moved out common default style entries from settings. --- Telegram/SourceFiles/api/api_chat_filters.cpp | 2 +- .../boxes/background_preview_box.cpp | 5 ++--- Telegram/SourceFiles/boxes/boxes.style | 8 +++++++ .../SourceFiles/boxes/create_poll_box.cpp | 15 ++++++------- .../SourceFiles/boxes/edit_privacy_box.cpp | 6 ++--- .../boxes/filters/edit_filter_links.cpp | 10 ++++----- .../boxes/peers/add_participants_box.cpp | 1 - .../boxes/peers/choose_peer_box.cpp | 4 ++-- .../boxes/peers/edit_peer_info_box.cpp | 5 ++--- .../boxes/peers/edit_peer_invite_link.cpp | 7 +++--- .../boxes/peers/edit_peer_invite_links.cpp | 9 ++++---- .../boxes/peers/edit_peer_type_box.cpp | 5 ++--- .../boxes/peers/edit_peer_usernames_list.cpp | 6 ++--- .../boxes/reactions_settings_box.cpp | 2 +- Telegram/SourceFiles/boxes/sessions_box.cpp | 10 ++++----- Telegram/SourceFiles/boxes/translate_box.cpp | 3 +-- Telegram/SourceFiles/boxes/username_box.cpp | 3 +-- Telegram/SourceFiles/calls/calls.style | 4 ++-- .../calls/group/calls_group_rtmp.cpp | 3 +-- .../view/media/history_view_service_box.cpp | 4 ++-- .../info/boosts/create_giveaway_box.cpp | 6 ++--- Telegram/SourceFiles/info/info.style | 4 ++++ .../settings_cloud_password_manage.cpp | 2 +- Telegram/SourceFiles/settings/settings.style | 21 ------------------ .../settings/settings_blocked_peers.cpp | 7 +++--- .../SourceFiles/settings/settings_chat.cpp | 6 ++--- .../settings/settings_experimental.cpp | 2 +- .../SourceFiles/settings/settings_folders.cpp | 6 ++--- .../settings/settings_global_ttl.cpp | 2 +- .../settings/settings_local_passcode.cpp | 2 +- .../settings/settings_notifications.cpp | 4 ++-- .../SourceFiles/settings/settings_premium.cpp | 4 ++-- .../settings/settings_privacy_controllers.cpp | 4 ++-- .../settings/settings_websites.cpp | 2 +- .../ui/boxes/choose_language_box.cpp | 3 +-- .../SourceFiles/ui/boxes/edit_invite_link.cpp | 22 +++++++++---------- Telegram/SourceFiles/ui/vertical_list.cpp | 13 +++++------ .../window/themes/window_theme_editor_box.cpp | 5 ++--- Telegram/lib_ui | 2 +- 39 files changed, 103 insertions(+), 126 deletions(-) diff --git a/Telegram/SourceFiles/api/api_chat_filters.cpp b/Telegram/SourceFiles/api/api_chat_filters.cpp index c5cbab7c3..7287b56e3 100644 --- a/Telegram/SourceFiles/api/api_chat_filters.cpp +++ b/Telegram/SourceFiles/api/api_chat_filters.cpp @@ -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 diff --git a/Telegram/SourceFiles/boxes/background_preview_box.cpp b/Telegram/SourceFiles/boxes/background_preview_box.cpp index 8901c65fd..e0f99a7a1 100644 --- a/Telegram/SourceFiles/boxes/background_preview_box.cpp +++ b/Telegram/SourceFiles/boxes/background_preview_box.cpp @@ -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(); diff --git a/Telegram/SourceFiles/boxes/boxes.style b/Telegram/SourceFiles/boxes/boxes.style index 7cf49f4f8..62eb6dc6b 100644 --- a/Telegram/SourceFiles/boxes/boxes.style +++ b/Telegram/SourceFiles/boxes/boxes.style @@ -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) { diff --git a/Telegram/SourceFiles/boxes/create_poll_box.cpp b/Telegram/SourceFiles/boxes/create_poll_box.cpp index 456e22914..373899be4 100644 --- a/Telegram/SourceFiles/boxes/create_poll_box.cpp +++ b/Telegram/SourceFiles/boxes/create_poll_box.cpp @@ -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(), diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp index 692757a68..899c8be02 100644 --- a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp @@ -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)); diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_links.cpp b/Telegram/SourceFiles/boxes/filters/edit_filter_links.cpp index 3ca2c4100..d60cc030d 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_links.cpp +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_links.cpp @@ -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 { diff --git a/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp index 575522e42..b27ce349a 100644 --- a/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp @@ -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 { diff --git a/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp b/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp index 73e012aa1..6ccc564fc 100644 --- a/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp @@ -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>( diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp index 1be539704..8b7031826 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp @@ -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; } diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp index ca78669b6..03bf6108d 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp @@ -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( diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp index d8d4c29e3..46905d67b 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_links.cpp @@ -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, diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp index 2aa4390dd..5e5dee319 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp @@ -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), diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_usernames_list.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_usernames_list.cpp index 68a8738d4..c586bb617 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_usernames_list.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_usernames_list.cpp @@ -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( diff --git a/Telegram/SourceFiles/boxes/reactions_settings_box.cpp b/Telegram/SourceFiles/boxes/reactions_settings_box.cpp index 3e61f8bf4..52ab5dc77 100644 --- a/Telegram/SourceFiles/boxes/reactions_settings_box.cpp +++ b/Telegram/SourceFiles/boxes/reactions_settings_box.cpp @@ -105,7 +105,7 @@ void AddMessage( object_ptr<Ui::RpWidget>(container), style::margins( 0, - st::settingsSectionSkip, + st::defaultVerticalListSkip, 0, st::settingsPrivacySkipTop)); diff --git a/Telegram/SourceFiles/boxes/sessions_box.cpp b/Telegram/SourceFiles/boxes/sessions_box.cpp index 2035c2bec..ec428042a 100644 --- a/Telegram/SourceFiles/boxes/sessions_box.cpp +++ b/Telegram/SourceFiles/boxes/sessions_box.cpp @@ -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( diff --git a/Telegram/SourceFiles/boxes/translate_box.cpp b/Telegram/SourceFiles/boxes/translate_box.cpp index 719ca7999..e0a760350 100644 --- a/Telegram/SourceFiles/boxes/translate_box.cpp +++ b/Telegram/SourceFiles/boxes/translate_box.cpp @@ -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)); diff --git a/Telegram/SourceFiles/boxes/username_box.cpp b/Telegram/SourceFiles/boxes/username_box.cpp index 180851ed3..52c08b684 100644 --- a/Telegram/SourceFiles/boxes/username_box.cpp +++ b/Telegram/SourceFiles/boxes/username_box.cpp @@ -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>( diff --git a/Telegram/SourceFiles/calls/calls.style b/Telegram/SourceFiles/calls/calls.style index a8d3b5600..cc009ad43 100644 --- a/Telegram/SourceFiles/calls/calls.style +++ b/Telegram/SourceFiles/calls/calls.style @@ -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) { diff --git a/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp b/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp index e214eba10..fded07614 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_rtmp.cpp @@ -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); diff --git a/Telegram/SourceFiles/history/view/media/history_view_service_box.cpp b/Telegram/SourceFiles/history/view/media/history_view_service_box.cpp index 57369d1fa..a1d723e43 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_service_box.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_service_box.cpp @@ -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) diff --git a/Telegram/SourceFiles/info/boosts/create_giveaway_box.cpp b/Telegram/SourceFiles/info/boosts/create_giveaway_box.cpp index 1d627d560..b34175a13 100644 --- a/Telegram/SourceFiles/info/boosts/create_giveaway_box.cpp +++ b/Telegram/SourceFiles/info/boosts/create_giveaway_box.cpp @@ -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()); }; diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index 6bf6dc70a..a91b29f7f 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -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); diff --git a/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_manage.cpp b/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_manage.cpp index b212a0e94..d2f8f9569 100644 --- a/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_manage.cpp +++ b/Telegram/SourceFiles/settings/cloud_password/settings_cloud_password_manage.cpp @@ -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() diff --git a/Telegram/SourceFiles/settings/settings.style b/Telegram/SourceFiles/settings/settings.style index 7ce12a06b..17ce558b2 100644 --- a/Telegram/SourceFiles/settings/settings.style +++ b/Telegram/SourceFiles/settings/settings.style @@ -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); diff --git a/Telegram/SourceFiles/settings/settings_blocked_peers.cpp b/Telegram/SourceFiles/settings/settings_blocked_peers.cpp index 514fadfcf..c0b2a4746 100644 --- a/Telegram/SourceFiles/settings/settings_blocked_peers.cpp +++ b/Telegram/SourceFiles/settings/settings_blocked_peers.cpp @@ -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)); diff --git a/Telegram/SourceFiles/settings/settings_chat.cpp b/Telegram/SourceFiles/settings/settings_chat.cpp index 43d1912a5..4de551787 100644 --- a/Telegram/SourceFiles/settings/settings_chat.cpp +++ b/Telegram/SourceFiles/settings/settings_chat.cpp @@ -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)); } diff --git a/Telegram/SourceFiles/settings/settings_experimental.cpp b/Telegram/SourceFiles/settings/settings_experimental.cpp index 08e53f4eb..2d91f6d99 100644 --- a/Telegram/SourceFiles/settings/settings_experimental.cpp +++ b/Telegram/SourceFiles/settings/settings_experimental.cpp @@ -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()) { diff --git a/Telegram/SourceFiles/settings/settings_folders.cpp b/Telegram/SourceFiles/settings/settings_folders.cpp index 0ea123835..34a8b9ec2 100644 --- a/Telegram/SourceFiles/settings/settings_folders.cpp +++ b/Telegram/SourceFiles/settings/settings_folders.cpp @@ -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( diff --git a/Telegram/SourceFiles/settings/settings_global_ttl.cpp b/Telegram/SourceFiles/settings/settings_global_ttl.cpp index 478634281..8e2024622 100644 --- a/Telegram/SourceFiles/settings/settings_global_ttl.cpp +++ b/Telegram/SourceFiles/settings/settings_global_ttl.cpp @@ -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); } diff --git a/Telegram/SourceFiles/settings/settings_local_passcode.cpp b/Telegram/SourceFiles/settings/settings_local_passcode.cpp index ae81ff236..d06726cb4 100644 --- a/Telegram/SourceFiles/settings/settings_local_passcode.cpp +++ b/Telegram/SourceFiles/settings/settings_local_passcode.cpp @@ -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); diff --git a/Telegram/SourceFiles/settings/settings_notifications.cpp b/Telegram/SourceFiles/settings/settings_notifications.cpp index 2ffe591c8..5ffd188bd 100644 --- a/Telegram/SourceFiles/settings/settings_notifications.cpp +++ b/Telegram/SourceFiles/settings/settings_notifications.cpp @@ -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, diff --git a/Telegram/SourceFiles/settings/settings_premium.cpp b/Telegram/SourceFiles/settings/settings_premium.cpp index 2a3d6183c..d149c3230 100644 --- a/Telegram/SourceFiles/settings/settings_premium.cpp +++ b/Telegram/SourceFiles/settings/settings_premium.cpp @@ -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, diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp index e5039e29e..08d44f662 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp @@ -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(); diff --git a/Telegram/SourceFiles/settings/settings_websites.cpp b/Telegram/SourceFiles/settings/settings_websites.cpp index fae9c51f9..a963a0488 100644 --- a/Telegram/SourceFiles/settings/settings_websites.cpp +++ b/Telegram/SourceFiles/settings/settings_websites.cpp @@ -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)); diff --git a/Telegram/SourceFiles/ui/boxes/choose_language_box.cpp b/Telegram/SourceFiles/ui/boxes/choose_language_box.cpp index e4bea1cc7..ef7604fcb 100644 --- a/Telegram/SourceFiles/ui/boxes/choose_language_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/choose_language_box.cpp @@ -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())); diff --git a/Telegram/SourceFiles/ui/boxes/edit_invite_link.cpp b/Telegram/SourceFiles/ui/boxes/edit_invite_link.cpp index b7805d503..be5fe34eb 100644 --- a/Telegram/SourceFiles/ui/boxes/edit_invite_link.cpp +++ b/Telegram/SourceFiles/ui/boxes/edit_invite_link.cpp @@ -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 = []( diff --git a/Telegram/SourceFiles/ui/vertical_list.cpp b/Telegram/SourceFiles/ui/vertical_list.cpp index 1e8951616..0fcf7012f 100644 --- a/Telegram/SourceFiles/ui/vertical_list.cpp +++ b/Telegram/SourceFiles/ui/vertical_list.cpp @@ -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 diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp index e92ee6ed5..f101a38c4 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor_box.cpp @@ -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, diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 388fc7091..164877a0d 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 388fc709186f6a47d42efaa922876ea39a9950b6 +Subproject commit 164877a0dcbfed41b7b496c807704b7efd693644