diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index d048e6808..130d096c1 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -331,6 +331,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_settings_language" = "Language"; "lng_settings_default_scale" = "Default interface scale"; "lng_settings_edit_info" = "Edit information"; +"lng_settings_local_storage" = "Local storage"; +"lng_settings_connection_type" = "Connection type"; +"lng_settings_downloading_update" = "Downloading update {progress}..."; "lng_backgrounds_header" = "Choose your new chat background"; "lng_theme_sure_keep" = "Keep this theme?"; diff --git a/Telegram/SourceFiles/info/profile/info_profile_button.cpp b/Telegram/SourceFiles/info/profile/info_profile_button.cpp index 8258a97a4..7980d80c5 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_button.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_button.cpp @@ -58,6 +58,10 @@ rpl::producer Button::toggledValue() const { return rpl::never(); } +bool Button::toggled() const { + return _toggle ? _toggle->checked() : false; +} + void Button::setColorOverride(base::optional textColorOverride) { _textColorOverride = textColorOverride; update(); @@ -94,6 +98,7 @@ void Button::paintEvent(QPaintEvent *e) { QRect Button::toggleRect() const { Expects(_toggle != nullptr); + auto size = _toggle->getSize(); auto left = width() - _st.toggleSkip - size.width(); auto top = (height() - size.height()) / 2; diff --git a/Telegram/SourceFiles/info/profile/info_profile_button.h b/Telegram/SourceFiles/info/profile/info_profile_button.h index 6bf04af40..ebcfbc496 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_button.h +++ b/Telegram/SourceFiles/info/profile/info_profile_button.h @@ -28,6 +28,7 @@ public: Button *toggleOn(rpl::producer &&toggled); rpl::producer toggledValue() const; + bool toggled() const; void setColorOverride(base::optional textColorOverride); diff --git a/Telegram/SourceFiles/settings/settings.style b/Telegram/SourceFiles/settings/settings.style index 37a8e21db..2f51ec746 100644 --- a/Telegram/SourceFiles/settings/settings.style +++ b/Telegram/SourceFiles/settings/settings.style @@ -8,18 +8,34 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL using "basic.style"; using "ui/widgets/widgets.style"; using "info/info.style"; +using "boxes/boxes.style"; -settingsSectionButton: infoProfileButton; +settingsSectionButton: InfoProfileButton(infoProfileButton) { + font: boxTextFont; +} +settingsButton: InfoProfileButton(settingsSectionButton) { + padding: margins(28px, 10px, 8px, 8px); +} settingsSectionSkip: infoProfileSkip; settingsButtonRightPosition: point(28px, 10px); settingsButtonRight: FlatLabel(defaultFlatLabel) { textFg: windowActiveTextFg; + style: boxTextStyle; } settingsScalePadding: margins(79px, 10px, 28px, 8px); settingsSlider: SettingsSlider(defaultSettingsSlider) { labelFg: windowSubTextFg; labelFgActive: windowActiveTextFg; } +settingsUpdateToggle: InfoProfileButton(settingsButton) { + height: 38px; +} +settingsUpdateState: FlatLabel(defaultFlatLabel) { + textFg: windowSubTextFg; +} +settingsUpdate: InfoProfileButton(infoMainButton, settingsButton) { +} +settingsUpdateStatePosition: point(28px, 30px); settingsNotificationsCheckbox: defaultBoxCheckbox; settingsNotificationsCheckboxPadding: margins(22px, 10px, 10px, 10px); diff --git a/Telegram/SourceFiles/settings/settings_common.cpp b/Telegram/SourceFiles/settings/settings_common.cpp index 901fbc91e..0f28a69d3 100644 --- a/Telegram/SourceFiles/settings/settings_common.cpp +++ b/Telegram/SourceFiles/settings/settings_common.cpp @@ -15,6 +15,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "settings/settings_privacy_security.h" #include "ui/wrap/padding_wrap.h" #include "ui/wrap/vertical_layout.h" +#include "ui/widgets/labels.h" +#include "info/profile/info_profile_button.h" #include "boxes/abstract_box.h" #include "lang/lang_keys.h" #include "mainwindow.h" @@ -22,16 +24,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Settings { -void AddSkip(not_null container) { - container->add(object_ptr( - container, - st::settingsSectionSkip)); -} - -void AddDivider(not_null container) { - container->add(object_ptr(container)); -} - object_ptr
CreateSection( Type type, not_null parent, @@ -54,6 +46,48 @@ object_ptr
CreateSection( Unexpected("Settings section type in Widget::createInnerWidget."); } +void AddSkip(not_null container) { + container->add(object_ptr( + container, + st::settingsSectionSkip)); +} + +void AddDivider(not_null container) { + container->add(object_ptr(container)); +} + +not_null AddButton( + not_null container, + LangKey text, + const style::InfoProfileButton &st) { + return container->add(object_ptr