2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Implement intro wrap for new settings.

This commit is contained in:
John Preston
2018-09-11 21:07:04 +03:00
parent 34665cd6da
commit c1ae9e9680
15 changed files with 689 additions and 72 deletions

View File

@@ -27,7 +27,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_settings.h"
namespace Settings {
namespace {
class BackgroundRow : public Ui::RpWidget {
public:
@@ -624,10 +623,7 @@ void SetupChatBackground(not_null<Ui::VerticalLayout*> container) {
}, adaptive->lifetime());
}
void SetupThemeOptions(not_null<Ui::VerticalLayout*> container) {
AddDivider(container);
AddSkip(container);
void SetupNightMode(not_null<Ui::VerticalLayout*> container) {
const auto calling = Ui::AttachAsChild(container, 0);
AddButton(
container,
@@ -648,16 +644,9 @@ void SetupThemeOptions(not_null<Ui::VerticalLayout*> container) {
container,
change);
}, container->lifetime());
}
AddButton(
container,
lng_settings_bg_edit_theme,
st::settingsButton
)->addClickHandler(App::LambdaDelayed(
st::settingsButton.ripple.hideDuration,
container,
[] { Window::Theme::Editor::Start(); }));
void SetupUseDefaultTheme(not_null<Ui::VerticalLayout*> container) {
using Update = const Window::Theme::BackgroundUpdate;
container->add(
object_ptr<Ui::SlideWrap<Button>>(
@@ -678,12 +667,28 @@ void SetupThemeOptions(not_null<Ui::VerticalLayout*> container) {
})))->entity()->addClickHandler([] {
Window::Theme::ApplyDefault();
});
}
void SetupThemeOptions(not_null<Ui::VerticalLayout*> container) {
AddDivider(container);
AddSkip(container);
SetupNightMode(container);
AddButton(
container,
lng_settings_bg_edit_theme,
st::settingsButton
)->addClickHandler(App::LambdaDelayed(
st::settingsButton.ripple.hideDuration,
container,
[] { Window::Theme::Editor::Start(); }));
SetupUseDefaultTheme(container);
AddSkip(container);
}
} // namespace
Chat::Chat(QWidget *parent, not_null<UserData*> self)
: Section(parent)
, _self(self) {