diff --git a/Telegram/Resources/icons/settings_chat.png b/Telegram/Resources/icons/settings_chat.png new file mode 100644 index 000000000..ca3b669ce Binary files /dev/null and b/Telegram/Resources/icons/settings_chat.png differ diff --git a/Telegram/Resources/icons/settings_chat@2x.png b/Telegram/Resources/icons/settings_chat@2x.png new file mode 100644 index 000000000..30b4f3e0b Binary files /dev/null and b/Telegram/Resources/icons/settings_chat@2x.png differ diff --git a/Telegram/Resources/icons/settings_edit.png b/Telegram/Resources/icons/settings_edit.png new file mode 100644 index 000000000..fad4f64fa Binary files /dev/null and b/Telegram/Resources/icons/settings_edit.png differ diff --git a/Telegram/Resources/icons/settings_edit@2x.png b/Telegram/Resources/icons/settings_edit@2x.png new file mode 100644 index 000000000..f4b7e547c Binary files /dev/null and b/Telegram/Resources/icons/settings_edit@2x.png differ diff --git a/Telegram/Resources/icons/settings_faq.png b/Telegram/Resources/icons/settings_faq.png new file mode 100644 index 000000000..9c487fa63 Binary files /dev/null and b/Telegram/Resources/icons/settings_faq.png differ diff --git a/Telegram/Resources/icons/settings_faq@2x.png b/Telegram/Resources/icons/settings_faq@2x.png new file mode 100644 index 000000000..924d2ddb8 Binary files /dev/null and b/Telegram/Resources/icons/settings_faq@2x.png differ diff --git a/Telegram/Resources/icons/settings_general.png b/Telegram/Resources/icons/settings_general.png new file mode 100644 index 000000000..469abcaf8 Binary files /dev/null and b/Telegram/Resources/icons/settings_general.png differ diff --git a/Telegram/Resources/icons/settings_general@2x.png b/Telegram/Resources/icons/settings_general@2x.png new file mode 100644 index 000000000..95a6e3c3f Binary files /dev/null and b/Telegram/Resources/icons/settings_general@2x.png differ diff --git a/Telegram/Resources/icons/settings_information.png b/Telegram/Resources/icons/settings_information.png new file mode 100644 index 000000000..02cf5c07a Binary files /dev/null and b/Telegram/Resources/icons/settings_information.png differ diff --git a/Telegram/Resources/icons/settings_information@2x.png b/Telegram/Resources/icons/settings_information@2x.png new file mode 100644 index 000000000..b335acf21 Binary files /dev/null and b/Telegram/Resources/icons/settings_information@2x.png differ diff --git a/Telegram/Resources/icons/settings_interface_scale.png b/Telegram/Resources/icons/settings_interface_scale.png new file mode 100644 index 000000000..7db6e9f25 Binary files /dev/null and b/Telegram/Resources/icons/settings_interface_scale.png differ diff --git a/Telegram/Resources/icons/settings_interface_scale@2x.png b/Telegram/Resources/icons/settings_interface_scale@2x.png new file mode 100644 index 000000000..7187b9b22 Binary files /dev/null and b/Telegram/Resources/icons/settings_interface_scale@2x.png differ diff --git a/Telegram/Resources/icons/settings_language.png b/Telegram/Resources/icons/settings_language.png new file mode 100644 index 000000000..b921ea427 Binary files /dev/null and b/Telegram/Resources/icons/settings_language.png differ diff --git a/Telegram/Resources/icons/settings_language@2x.png b/Telegram/Resources/icons/settings_language@2x.png new file mode 100644 index 000000000..6c070e3e3 Binary files /dev/null and b/Telegram/Resources/icons/settings_language@2x.png differ diff --git a/Telegram/Resources/icons/settings_name.png b/Telegram/Resources/icons/settings_name.png new file mode 100644 index 000000000..41d025518 Binary files /dev/null and b/Telegram/Resources/icons/settings_name.png differ diff --git a/Telegram/Resources/icons/settings_name@2x.png b/Telegram/Resources/icons/settings_name@2x.png new file mode 100644 index 000000000..85249294f Binary files /dev/null and b/Telegram/Resources/icons/settings_name@2x.png differ diff --git a/Telegram/Resources/icons/settings_notifications.png b/Telegram/Resources/icons/settings_notifications.png new file mode 100644 index 000000000..c6baf4125 Binary files /dev/null and b/Telegram/Resources/icons/settings_notifications.png differ diff --git a/Telegram/Resources/icons/settings_notifications@2x.png b/Telegram/Resources/icons/settings_notifications@2x.png new file mode 100644 index 000000000..998b44c34 Binary files /dev/null and b/Telegram/Resources/icons/settings_notifications@2x.png differ diff --git a/Telegram/Resources/icons/settings_phone_number.png b/Telegram/Resources/icons/settings_phone_number.png new file mode 100644 index 000000000..0889cfe25 Binary files /dev/null and b/Telegram/Resources/icons/settings_phone_number.png differ diff --git a/Telegram/Resources/icons/settings_phone_number@2x.png b/Telegram/Resources/icons/settings_phone_number@2x.png new file mode 100644 index 000000000..8f536db05 Binary files /dev/null and b/Telegram/Resources/icons/settings_phone_number@2x.png differ diff --git a/Telegram/Resources/icons/settings_privacy_security.png b/Telegram/Resources/icons/settings_privacy_security.png new file mode 100644 index 000000000..573abf2bc Binary files /dev/null and b/Telegram/Resources/icons/settings_privacy_security.png differ diff --git a/Telegram/Resources/icons/settings_privacy_security@2x.png b/Telegram/Resources/icons/settings_privacy_security@2x.png new file mode 100644 index 000000000..5b5bacc99 Binary files /dev/null and b/Telegram/Resources/icons/settings_privacy_security@2x.png differ diff --git a/Telegram/Resources/icons/settings_set_photo.png b/Telegram/Resources/icons/settings_set_photo.png new file mode 100644 index 000000000..e350c5c36 Binary files /dev/null and b/Telegram/Resources/icons/settings_set_photo.png differ diff --git a/Telegram/Resources/icons/settings_set_photo@2x.png b/Telegram/Resources/icons/settings_set_photo@2x.png new file mode 100644 index 000000000..da5023ae6 Binary files /dev/null and b/Telegram/Resources/icons/settings_set_photo@2x.png differ diff --git a/Telegram/Resources/icons/settings_username.png b/Telegram/Resources/icons/settings_username.png new file mode 100644 index 000000000..0f55678e9 Binary files /dev/null and b/Telegram/Resources/icons/settings_username.png differ diff --git a/Telegram/Resources/icons/settings_username@2x.png b/Telegram/Resources/icons/settings_username@2x.png new file mode 100644 index 000000000..7125e84bc Binary files /dev/null and b/Telegram/Resources/icons/settings_username@2x.png differ diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index 59a3250c9..1a7de6387 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -156,8 +156,13 @@ infoTopBarCall: IconButton(infoTopBarNotifications) { iconOver: icon {{ "top_bar_call", boxTitleCloseFgOver }}; } infoTopBarSave: IconButton(infoTopBarNotifications) { + width: 48px; icon: icon {{ "passport_ready", windowActiveTextFg }}; - iconOver: icon {{ "passport_ready", windowActiveTextFg}}; + iconOver: icon {{ "passport_ready", windowActiveTextFg }}; + iconPosition: point(11px, 17px); + ripple: RippleAnimation(defaultRippleAnimation) { + color: lightButtonBgOver; + } } infoTopBarForward: IconButton(infoTopBarBack) { width: 46px; @@ -229,6 +234,10 @@ infoLayerTopBarCall: IconButton(infoLayerTopBarNotifications) { infoLayerTopBarSave: IconButton(infoLayerTopBarNotifications) { icon: icon {{ "passport_ready", windowActiveTextFg }}; iconOver: icon {{ "passport_ready", windowActiveTextFg }}; + iconPosition: point(13px, 18px); + ripple: RippleAnimation(defaultRippleAnimation) { + color: lightButtonBgOver; + } } infoLayerTopBarForward: IconButton(infoLayerTopBarBack) { width: 45px; diff --git a/Telegram/SourceFiles/info/info_layer_widget.cpp b/Telegram/SourceFiles/info/info_layer_widget.cpp index bd3667b24..ed6239a29 100644 --- a/Telegram/SourceFiles/info/info_layer_widget.cpp +++ b/Telegram/SourceFiles/info/info_layer_widget.cpp @@ -19,7 +19,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "window/main_window.h" #include "auth_session.h" #include "styles/style_info.h" -#include "styles/style_old_settings.h" #include "styles/style_window.h" #include "styles/style_boxes.h" diff --git a/Telegram/SourceFiles/settings/settings.style b/Telegram/SourceFiles/settings/settings.style index c0faba4d9..e61fe672a 100644 --- a/Telegram/SourceFiles/settings/settings.style +++ b/Telegram/SourceFiles/settings/settings.style @@ -10,47 +10,67 @@ using "ui/widgets/widgets.style"; using "info/info.style"; using "boxes/boxes.style"; +settingsFirstDividerSkip: 3px; settingsSectionButton: InfoProfileButton(infoProfileButton) { font: boxTextFont; + padding: margins(79px, 13px, 22px, 11px); } settingsGeneralButton: InfoProfileButton(settingsSectionButton) { - padding: margins(28px, 10px, 22px, 8px); + padding: margins(24px, 13px, 22px, 11px); } settingsButton: InfoProfileButton(settingsSectionButton) { - padding: margins(22px, 10px, 22px, 8px); + padding: margins(22px, 13px, 22px, 11px); } -settingsSectionSkip: infoProfileSkip; +settingsSectionSkip: 9px; +settingsSectionIconPosition: point(22px, 9px); settingsSeparatorPadding: margins(22px, infoProfileSkip, 0px, infoProfileSkip); -settingsButtonRightPosition: point(28px, 10px); +settingsButtonRightPosition: point(28px, 13px); settingsButtonRight: FlatLabel(defaultFlatLabel) { textFg: windowActiveTextFg; style: boxTextStyle; } settingsScalePadding: margins(79px, 10px, 28px, 8px); settingsSlider: SettingsSlider(defaultSettingsSlider) { + barFg: windowBgOver; labelFg: windowSubTextFg; labelFgActive: windowActiveTextFg; } -settingsUpdateToggle: InfoProfileButton(settingsButton) { - height: 38px; +settingsUpdateToggle: InfoProfileButton(settingsGeneralButton) { + height: 40px; + padding: margins(24px, 8px, 22px, 8px); } settingsUpdateState: FlatLabel(defaultFlatLabel) { textFg: windowSubTextFg; } settingsUpdate: InfoProfileButton(infoMainButton, settingsButton) { } -settingsUpdateStatePosition: point(28px, 30px); -settingsDividerLabelPadding: margins(22px, 7px, 22px, 14px); +settingsUpdateStatePosition: point(24px, 29px); +settingsDividerLabelPadding: margins(22px, 10px, 22px, 19px); -settingsSendType: defaultBoxCheckbox; -settingsSendTypePadding: margins(22px, 5px, 10px, 5px); -settingsSendTypeSkip: 5px; +settingsIconSetPhoto: icon {{ "settings_set_photo", menuIconFg }}; +settingsIconInformation: icon {{ "settings_information", menuIconFg }}; +settingsIconNotifications: icon {{ "settings_notifications", menuIconFg }}; +settingsIconChat: icon {{ "settings_chat", menuIconFg }}; +settingsIconGeneral: icon {{ "settings_general", menuIconFg }}; +settingsIconPrivacySecurity: icon {{ "settings_privacy_security", menuIconFg }}; +settingsIconLanguage: icon {{ "settings_language", menuIconFg }}; +settingsIconInterfaceScale: icon {{ "settings_interface_scale", menuIconFg }}; +settingsIconFaq: icon {{ "settings_faq", menuIconFg }}; -settingsCheckbox: defaultBoxCheckbox; +settingsSetPhotoSkip: 7px; + +settingsCheckbox: Checkbox(defaultBoxCheckbox) { + textPosition: point(15px, 1px); +} settingsCheckboxPadding: margins(22px, 10px, 10px, 10px); settingsLink: boxLinkButton; settingsAdvancedNotificationsPadding: margins(22px, 20px, 10px, 10px); settingsLinkLabel: defaultFlatLabel; +settingsCheckboxesSkip: 12px; + +settingsSendType: settingsCheckbox; +settingsSendTypePadding: margins(22px, 5px, 10px, 5px); +settingsSendTypeSkip: 5px; settingsAskPathPadding: margins(22px, 10px, 10px, 0px); settingsDownloadPathPadding: margins(22px, 1px, 10px, 0px); @@ -65,10 +85,12 @@ settingsSubsectionTitle: FlatLabel(defaultFlatLabel) { } textFg: windowActiveTextFg; } -settingsSubsectionTitlePadding: margins(22px, 7px, 10px, 9px); -settingsBackgroundPadding: margins(22px, 8px, 10px, 8px); +settingsSubsectionTitlePadding: margins(22px, 7px, 10px, 6px); +settingsBackgroundPadding: margins(22px, 11px, 10px, 12px); +settingsTileSkip: 15px; settingsFromGalleryTop: 2px; settingsFromFileTop: 14px; +settingsPrivacySecurityPadding: 12px; settingsCloudPasswordLabel: FlatLabel(defaultFlatLabel) { textFg: windowSubTextFg; @@ -78,7 +100,7 @@ settingsCloudPasswordLabel: FlatLabel(defaultFlatLabel) { settingsCloudPasswordLabelPadding: margins(22px, 8px, 10px, 8px); settingsInfoRowHeight: 62px; -settingsInfoIconPosition: point(24px, 16px); +settingsInfoIconPosition: point(22px, 18px); settingsInfoValue: FlatLabel(defaultFlatLabel) { textFg: windowFg; style: boxTextStyle; @@ -89,13 +111,47 @@ settingsInfoAbout: FlatLabel(settingsInfoValue) { textFg: windowSubTextFg; style: defaultTextStyle; } -settingsInfoAboutPosition: point(78px, 33px); +settingsInfoAboutPosition: point(78px, 34px); settingsInfoRightSkip: 60px; -settingsInfoEditPosition: point(12px, 12px); +settingsInfoEditPosition: point(0px, 6px); settingsInfoEdit: IconButton(defaultIconButton) { -} + width: 56px; + height: 56px; -settingsBioMargins: margins(20px, 2px, 20px, 2px); + icon: icon {{ "settings_edit", menuIconFg }}; + iconOver: icon {{ "settings_edit", menuIconFgOver }}; + iconPosition: point(14px, 14px); + + rippleAreaPosition: point(8px, 8px); + rippleAreaSize: 40px; + ripple: RippleAnimation(defaultRippleAnimation) { + color: windowBgOver; + } +} +settingsBio: InputField(defaultInputField) { + textBg: transparent; + textMargins: margins(2px, 7px, 2px, 0px); + + placeholderFg: placeholderFg; + placeholderFgActive: placeholderFgActive; + placeholderFgError: placeholderFgActive; + placeholderMargins: margins(2px, 0px, 2px, 0px); + placeholderScale: 0.; + placeholderFont: normalFont; + + border: 0px; + borderActive: 0px; + + heightMin: 32px; + + font: boxTextFont; +} +settingsInfoAfterSkip: 14px; +settingsInfoName: icon {{ "settings_name", menuIconFg }}; +settingsInfoPhone: icon {{ "settings_phone_number", menuIconFg }}; +settingsInfoUsername: icon {{ "settings_username", menuIconFg }}; + +settingsBioMargins: margins(20px, 6px, 20px, 6px); settingsBioCountdown: FlatLabel(defaultFlatLabel) { style: boxTextStyle; textFg: windowSubTextFg; diff --git a/Telegram/SourceFiles/settings/settings_chat.cpp b/Telegram/SourceFiles/settings/settings_chat.cpp index 5e187b3b9..367ab9ea1 100644 --- a/Telegram/SourceFiles/settings/settings_chat.cpp +++ b/Telegram/SourceFiles/settings/settings_chat.cpp @@ -372,7 +372,7 @@ void DownloadPathRow::setupControls() { void SetupChatOptions(not_null container) { AddDivider(container); - AddSkip(container); + AddSkip(container, st::settingsCheckboxesSkip); auto wrap = object_ptr(container); const auto inner = wrap.data(); @@ -468,13 +468,13 @@ void SetupChatOptions(not_null container) { }, inner->lifetime()); - AddSkip(container); + AddSkip(container, st::settingsCheckboxesSkip); } void SetupSendKey(not_null container) { AddDivider(container); const auto skip = st::settingsSendTypeSkip; - const auto full = st::settingsSectionSkip + skip; + const auto full = st::settingsCheckboxesSkip + skip; AddSkip(container, full); enum class SendByType { @@ -553,7 +553,7 @@ void SetupMediaOptions(not_null container) { void SetupChatBackground(not_null container) { AddDivider(container); - AddSkip(container); + AddSkip(container, st::settingsCheckboxesSkip); AddSubsectionTitle(container, lng_settings_section_background); @@ -571,7 +571,7 @@ void SetupChatBackground(not_null container) { std::move(wrap), QMargins(0, skipTop, 0, skipBottom))); - AddSkip(container); + AddSkip(container, st::settingsTileSkip); const auto tile = inner->add( object_ptr( @@ -693,6 +693,7 @@ Chat::Chat(QWidget *parent, not_null self) void Chat::setupContent() { const auto content = Ui::CreateChild(this); + AddSkip(content, st::settingsFirstDividerSkip); SetupChatOptions(content); SetupSendKey(content); SetupMediaOptions(content); diff --git a/Telegram/SourceFiles/settings/settings_common.cpp b/Telegram/SourceFiles/settings/settings_common.cpp index b58530cc6..c2957c4af 100644 --- a/Telegram/SourceFiles/settings/settings_common.cpp +++ b/Telegram/SourceFiles/settings/settings_common.cpp @@ -76,11 +76,35 @@ void AddDividerText( not_null AddButton( not_null container, LangKey text, - const style::InfoProfileButton &st) { - return container->add(object_ptr