mirror of https://github.com/procxx/kepka.git
Implement intro wrap for new settings.
This commit is contained in:
parent
34665cd6da
commit
c1ae9e9680
|
@ -7,7 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include "info/info_layer_widget.h"
|
#include "info/info_layer_widget.h"
|
||||||
|
|
||||||
#include <rpl/mappers.h>
|
|
||||||
#include "info/info_content_widget.h"
|
#include "info/info_content_widget.h"
|
||||||
#include "info/info_top_bar.h"
|
#include "info/info_top_bar.h"
|
||||||
#include "info/info_memento.h"
|
#include "info/info_memento.h"
|
||||||
|
|
|
@ -33,7 +33,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "mediaview.h"
|
#include "mediaview.h"
|
||||||
#include "storage/localstorage.h"
|
#include "storage/localstorage.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "old_settings/settings_widget.h"
|
#include "settings/settings_intro.h"
|
||||||
#include "platform/platform_notifications_manager.h"
|
#include "platform/platform_notifications_manager.h"
|
||||||
#include "window/layer_widget.h"
|
#include "window/layer_widget.h"
|
||||||
#include "window/notifications_manager.h"
|
#include "window/notifications_manager.h"
|
||||||
|
@ -307,8 +307,7 @@ void MainWindow::showSettings() {
|
||||||
if (const auto controller = this->controller()) {
|
if (const auto controller = this->controller()) {
|
||||||
controller->showSettings();
|
controller->showSettings();
|
||||||
} else {
|
} else {
|
||||||
// #TODO settings
|
showSpecialLayer(Box<Settings::LayerWidget>(), anim::type::normal);
|
||||||
showSpecialLayer(Box<OldSettings::Widget>(), anim::type::normal);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ settingsButtonRight: FlatLabel(defaultFlatLabel) {
|
||||||
style: boxTextStyle;
|
style: boxTextStyle;
|
||||||
}
|
}
|
||||||
settingsScalePadding: margins(79px, 10px, 28px, 8px);
|
settingsScalePadding: margins(79px, 10px, 28px, 8px);
|
||||||
|
settingsBigScalePadding: margins(24px, 10px, 24px, 8px);
|
||||||
settingsSlider: SettingsSlider(defaultSettingsSlider) {
|
settingsSlider: SettingsSlider(defaultSettingsSlider) {
|
||||||
barFg: windowBgOver;
|
barFg: windowBgOver;
|
||||||
labelFg: windowSubTextFg;
|
labelFg: windowSubTextFg;
|
||||||
|
|
|
@ -27,7 +27,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_settings.h"
|
#include "styles/style_settings.h"
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
namespace {
|
|
||||||
|
|
||||||
class BackgroundRow : public Ui::RpWidget {
|
class BackgroundRow : public Ui::RpWidget {
|
||||||
public:
|
public:
|
||||||
|
@ -624,10 +623,7 @@ void SetupChatBackground(not_null<Ui::VerticalLayout*> container) {
|
||||||
}, adaptive->lifetime());
|
}, adaptive->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupThemeOptions(not_null<Ui::VerticalLayout*> container) {
|
void SetupNightMode(not_null<Ui::VerticalLayout*> container) {
|
||||||
AddDivider(container);
|
|
||||||
AddSkip(container);
|
|
||||||
|
|
||||||
const auto calling = Ui::AttachAsChild(container, 0);
|
const auto calling = Ui::AttachAsChild(container, 0);
|
||||||
AddButton(
|
AddButton(
|
||||||
container,
|
container,
|
||||||
|
@ -648,16 +644,9 @@ void SetupThemeOptions(not_null<Ui::VerticalLayout*> container) {
|
||||||
container,
|
container,
|
||||||
change);
|
change);
|
||||||
}, container->lifetime());
|
}, container->lifetime());
|
||||||
|
}
|
||||||
|
|
||||||
AddButton(
|
void SetupUseDefaultTheme(not_null<Ui::VerticalLayout*> container) {
|
||||||
container,
|
|
||||||
lng_settings_bg_edit_theme,
|
|
||||||
st::settingsButton
|
|
||||||
)->addClickHandler(App::LambdaDelayed(
|
|
||||||
st::settingsButton.ripple.hideDuration,
|
|
||||||
container,
|
|
||||||
[] { Window::Theme::Editor::Start(); }));
|
|
||||||
|
|
||||||
using Update = const Window::Theme::BackgroundUpdate;
|
using Update = const Window::Theme::BackgroundUpdate;
|
||||||
container->add(
|
container->add(
|
||||||
object_ptr<Ui::SlideWrap<Button>>(
|
object_ptr<Ui::SlideWrap<Button>>(
|
||||||
|
@ -678,12 +667,28 @@ void SetupThemeOptions(not_null<Ui::VerticalLayout*> container) {
|
||||||
})))->entity()->addClickHandler([] {
|
})))->entity()->addClickHandler([] {
|
||||||
Window::Theme::ApplyDefault();
|
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);
|
AddSkip(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
Chat::Chat(QWidget *parent, not_null<UserData*> self)
|
Chat::Chat(QWidget *parent, not_null<UserData*> self)
|
||||||
: Section(parent)
|
: Section(parent)
|
||||||
, _self(self) {
|
, _self(self) {
|
||||||
|
|
|
@ -11,6 +11,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
|
|
||||||
|
void SetupNightMode(not_null<Ui::VerticalLayout*> container);
|
||||||
|
void SetupUseDefaultTheme(not_null<Ui::VerticalLayout*> container);
|
||||||
|
|
||||||
class Chat : public Section {
|
class Chat : public Section {
|
||||||
public:
|
public:
|
||||||
Chat(QWidget *parent, not_null<UserData*> self);
|
Chat(QWidget *parent, not_null<UserData*> self);
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace Settings {
|
||||||
object_ptr<Section> CreateSection(
|
object_ptr<Section> CreateSection(
|
||||||
Type type,
|
Type type,
|
||||||
not_null<QWidget*> parent,
|
not_null<QWidget*> parent,
|
||||||
not_null<Window::Controller*> controller,
|
Window::Controller *controller,
|
||||||
UserData *self) {
|
UserData *self) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Type::Main:
|
case Type::Main:
|
||||||
|
|
|
@ -61,7 +61,7 @@ public:
|
||||||
object_ptr<Section> CreateSection(
|
object_ptr<Section> CreateSection(
|
||||||
Type type,
|
Type type,
|
||||||
not_null<QWidget*> parent,
|
not_null<QWidget*> parent,
|
||||||
not_null<Window::Controller*> controller,
|
Window::Controller *controller = nullptr,
|
||||||
UserData *self = nullptr);
|
UserData *self = nullptr);
|
||||||
|
|
||||||
void AddSkip(not_null<Ui::VerticalLayout*> container);
|
void AddSkip(not_null<Ui::VerticalLayout*> container);
|
||||||
|
|
|
@ -27,9 +27,18 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_settings.h"
|
#include "styles/style_settings.h"
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
namespace {
|
|
||||||
|
bool HasConnectionType() {
|
||||||
|
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY
|
||||||
|
return true;
|
||||||
|
#endif // TDESKTOP_DISABLE_NETWORK_PROXY
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void SetupConnectionType(not_null<Ui::VerticalLayout*> container) {
|
void SetupConnectionType(not_null<Ui::VerticalLayout*> container) {
|
||||||
|
if (!HasConnectionType()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY
|
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY
|
||||||
const auto connectionType = [] {
|
const auto connectionType = [] {
|
||||||
const auto transport = MTP::dctransport();
|
const auto transport = MTP::dctransport();
|
||||||
|
@ -74,14 +83,15 @@ void SetupStorageAndConnection(not_null<Ui::VerticalLayout*> container) {
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HasUpdate() {
|
||||||
|
return !Core::UpdaterDisabled();
|
||||||
|
}
|
||||||
|
|
||||||
void SetupUpdate(not_null<Ui::VerticalLayout*> container) {
|
void SetupUpdate(not_null<Ui::VerticalLayout*> container) {
|
||||||
if (Core::UpdaterDisabled()) {
|
if (!HasUpdate()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddDivider(container);
|
|
||||||
AddSkip(container);
|
|
||||||
|
|
||||||
const auto texts = Ui::AttachAsChild(
|
const auto texts = Ui::AttachAsChild(
|
||||||
container,
|
container,
|
||||||
rpl::event_stream<QString>());
|
rpl::event_stream<QString>());
|
||||||
|
@ -116,8 +126,6 @@ void SetupUpdate(not_null<Ui::VerticalLayout*> container) {
|
||||||
update->moveToLeft(0, 0);
|
update->moveToLeft(0, 0);
|
||||||
}, update->lifetime());
|
}, update->lifetime());
|
||||||
|
|
||||||
AddSkip(container);
|
|
||||||
|
|
||||||
rpl::combine(
|
rpl::combine(
|
||||||
toggle->widthValue(),
|
toggle->widthValue(),
|
||||||
label->widthValue()
|
label->widthValue()
|
||||||
|
@ -218,14 +226,15 @@ void SetupUpdate(not_null<Ui::VerticalLayout*> container) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HasTray() {
|
||||||
|
return cSupportTray() || (cPlatform() == dbipWindows);
|
||||||
|
}
|
||||||
|
|
||||||
void SetupTray(not_null<Ui::VerticalLayout*> container) {
|
void SetupTray(not_null<Ui::VerticalLayout*> container) {
|
||||||
if (!cSupportTray() && cPlatform() != dbipWindows) {
|
if (!HasTray()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddDivider(container);
|
|
||||||
AddSkip(container);
|
|
||||||
|
|
||||||
const auto trayEnabler = Ui::AttachAsChild(
|
const auto trayEnabler = Ui::AttachAsChild(
|
||||||
container,
|
container,
|
||||||
rpl::event_stream<bool>());
|
rpl::event_stream<bool>());
|
||||||
|
@ -369,12 +378,8 @@ void SetupTray(not_null<Ui::VerticalLayout*> container) {
|
||||||
}, sendto->lifetime());
|
}, sendto->lifetime());
|
||||||
}
|
}
|
||||||
#endif // OS_WIN_STORE
|
#endif // OS_WIN_STORE
|
||||||
|
|
||||||
AddSkip(container);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
General::General(QWidget *parent, UserData *self)
|
General::General(QWidget *parent, UserData *self)
|
||||||
: Section(parent)
|
: Section(parent)
|
||||||
, _self(self) {
|
, _self(self) {
|
||||||
|
@ -385,8 +390,19 @@ void General::setupContent() {
|
||||||
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||||
|
|
||||||
AddSkip(content, st::settingsFirstDividerSkip);
|
AddSkip(content, st::settingsFirstDividerSkip);
|
||||||
SetupUpdate(content);
|
|
||||||
SetupTray(content);
|
if (!Core::UpdaterDisabled()) {
|
||||||
|
AddDivider(content);
|
||||||
|
AddSkip(content);
|
||||||
|
SetupUpdate(content);
|
||||||
|
AddSkip(content);
|
||||||
|
}
|
||||||
|
if (HasTray()) {
|
||||||
|
AddDivider(content);
|
||||||
|
AddSkip(content);
|
||||||
|
SetupTray(content);
|
||||||
|
AddSkip(content);
|
||||||
|
}
|
||||||
SetupStorageAndConnection(content);
|
SetupStorageAndConnection(content);
|
||||||
|
|
||||||
Ui::ResizeFitChild(this, content);
|
Ui::ResizeFitChild(this, content);
|
||||||
|
|
|
@ -11,6 +11,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
|
|
||||||
|
bool HasConnectionType();
|
||||||
|
void SetupConnectionType(not_null<Ui::VerticalLayout*> container);
|
||||||
|
bool HasUpdate();
|
||||||
|
void SetupUpdate(not_null<Ui::VerticalLayout*> container);
|
||||||
|
bool HasTray();
|
||||||
|
void SetupTray(not_null<Ui::VerticalLayout*> container);
|
||||||
|
|
||||||
class General : public Section {
|
class General : public Section {
|
||||||
public:
|
public:
|
||||||
explicit General(QWidget *parent, UserData *self = nullptr);
|
explicit General(QWidget *parent, UserData *self = nullptr);
|
||||||
|
|
|
@ -0,0 +1,526 @@
|
||||||
|
/*
|
||||||
|
This file is part of Telegram Desktop,
|
||||||
|
the official desktop application for the Telegram messaging service.
|
||||||
|
|
||||||
|
For license and copyright information please follow this link:
|
||||||
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
*/
|
||||||
|
#include "settings/settings_intro.h"
|
||||||
|
|
||||||
|
#include "settings/settings_common.h"
|
||||||
|
#include "settings/settings_general.h"
|
||||||
|
#include "settings/settings_main.h"
|
||||||
|
#include "settings/settings_chat.h"
|
||||||
|
#include "settings/settings_codes.h"
|
||||||
|
#include "ui/wrap/fade_wrap.h"
|
||||||
|
#include "ui/wrap/vertical_layout.h"
|
||||||
|
#include "ui/widgets/shadow.h"
|
||||||
|
#include "ui/widgets/labels.h"
|
||||||
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/scroll_area.h"
|
||||||
|
#include "lang/lang_keys.h"
|
||||||
|
#include "styles/style_settings.h"
|
||||||
|
#include "styles/style_boxes.h"
|
||||||
|
#include "styles/style_info.h"
|
||||||
|
|
||||||
|
namespace Settings {
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
class TopBar : public Ui::RpWidget {
|
||||||
|
public:
|
||||||
|
TopBar(QWidget *parent, const style::InfoTopBar &st);
|
||||||
|
|
||||||
|
void setTitle(rpl::producer<QString> &&title);
|
||||||
|
|
||||||
|
template <typename ButtonWidget>
|
||||||
|
ButtonWidget *addButton(base::unique_qptr<ButtonWidget> button) {
|
||||||
|
auto result = button.get();
|
||||||
|
pushButton(std::move(button));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int resizeGetHeight(int newWidth) override;
|
||||||
|
void paintEvent(QPaintEvent *e) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void updateControlsGeometry(int newWidth);
|
||||||
|
Ui::RpWidget *pushButton(base::unique_qptr<Ui::RpWidget> button);
|
||||||
|
void removeButton(not_null<Ui::RpWidget*> button);
|
||||||
|
|
||||||
|
const style::InfoTopBar &_st;
|
||||||
|
std::vector<base::unique_qptr<Ui::RpWidget>> _buttons;
|
||||||
|
QPointer<Ui::FlatLabel> _title;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
object_ptr<Ui::RpWidget> CreateIntroSettings(QWidget *parent) {
|
||||||
|
auto result = object_ptr<Ui::VerticalLayout>(parent);
|
||||||
|
|
||||||
|
if (HasConnectionType()) {
|
||||||
|
AddDivider(result);
|
||||||
|
AddSkip(result);
|
||||||
|
SetupConnectionType(result);
|
||||||
|
AddSkip(result);
|
||||||
|
}
|
||||||
|
if (HasUpdate()) {
|
||||||
|
AddDivider(result);
|
||||||
|
AddSkip(result);
|
||||||
|
SetupUpdate(result);
|
||||||
|
AddSkip(result);
|
||||||
|
}
|
||||||
|
if (HasTray()) {
|
||||||
|
AddDivider(result);
|
||||||
|
AddSkip(result);
|
||||||
|
SetupTray(result);
|
||||||
|
AddSkip(result);
|
||||||
|
}
|
||||||
|
AddDivider(result);
|
||||||
|
AddSkip(result);
|
||||||
|
SetupInterfaceScale(result, false);
|
||||||
|
SetupNightMode(result);
|
||||||
|
SetupUseDefaultTheme(result);
|
||||||
|
AddSkip(result);
|
||||||
|
|
||||||
|
AddDivider(result);
|
||||||
|
AddSkip(result);
|
||||||
|
SetupFaq(result, false);
|
||||||
|
AddSkip(result);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
TopBar::TopBar(QWidget *parent, const style::InfoTopBar &st)
|
||||||
|
: RpWidget(parent)
|
||||||
|
, _st(st) {
|
||||||
|
setAttribute(Qt::WA_OpaquePaintEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TopBar::setTitle(rpl::producer<QString> &&title) {
|
||||||
|
if (_title) {
|
||||||
|
delete _title;
|
||||||
|
}
|
||||||
|
_title = Ui::CreateChild<Ui::FlatLabel>(
|
||||||
|
this,
|
||||||
|
std::move(title),
|
||||||
|
_st.title);
|
||||||
|
updateControlsGeometry(width());
|
||||||
|
}
|
||||||
|
|
||||||
|
Ui::RpWidget *TopBar::pushButton(base::unique_qptr<Ui::RpWidget> button) {
|
||||||
|
auto wrapped = std::move(button);
|
||||||
|
auto weak = wrapped.get();
|
||||||
|
_buttons.push_back(std::move(wrapped));
|
||||||
|
weak->widthValue(
|
||||||
|
) | rpl::start_with_next([this] {
|
||||||
|
updateControlsGeometry(width());
|
||||||
|
}, lifetime());
|
||||||
|
return weak;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TopBar::removeButton(not_null<Ui::RpWidget*> button) {
|
||||||
|
_buttons.erase(
|
||||||
|
std::remove(_buttons.begin(), _buttons.end(), button),
|
||||||
|
_buttons.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
int TopBar::resizeGetHeight(int newWidth) {
|
||||||
|
updateControlsGeometry(newWidth);
|
||||||
|
return _st.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TopBar::updateControlsGeometry(int newWidth) {
|
||||||
|
auto right = 0;
|
||||||
|
for (auto &button : _buttons) {
|
||||||
|
if (!button) continue;
|
||||||
|
button->moveToRight(right, 0, newWidth);
|
||||||
|
right += button->width();
|
||||||
|
}
|
||||||
|
if (_title) {
|
||||||
|
_title->moveToLeft(
|
||||||
|
_st.titlePosition.x(),
|
||||||
|
_st.titlePosition.y(),
|
||||||
|
newWidth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TopBar::paintEvent(QPaintEvent *e) {
|
||||||
|
Painter p(this);
|
||||||
|
p.fillRect(e->rect(), _st.bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
class IntroWidget : public Ui::RpWidget {
|
||||||
|
public:
|
||||||
|
IntroWidget(QWidget *parent);
|
||||||
|
|
||||||
|
void forceContentRepaint();
|
||||||
|
|
||||||
|
rpl::producer<int> desiredHeightValue() const override;
|
||||||
|
|
||||||
|
void updateGeometry(QRect newGeometry, int additionalScroll);
|
||||||
|
int scrollTillBottom(int forHeight) const;
|
||||||
|
rpl::producer<int> scrollTillBottomChanges() const;
|
||||||
|
|
||||||
|
void setInnerFocus();
|
||||||
|
|
||||||
|
~IntroWidget();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void resizeEvent(QResizeEvent *e) override;
|
||||||
|
void keyPressEvent(QKeyEvent *e) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void updateControlsGeometry();
|
||||||
|
QRect contentGeometry() const;
|
||||||
|
void setInnerWidget(object_ptr<Ui::RpWidget> content);
|
||||||
|
void showContent();
|
||||||
|
rpl::producer<bool> topShadowToggledValue() const;
|
||||||
|
void createTopBar();
|
||||||
|
void applyAdditionalScroll(int additionalScroll);
|
||||||
|
|
||||||
|
rpl::variable<int> _scrollTopSkip = -1;
|
||||||
|
rpl::event_stream<int> _scrollTillBottomChanges;
|
||||||
|
object_ptr<Ui::RpWidget> _wrap;
|
||||||
|
not_null<Ui::ScrollArea*> _scroll;
|
||||||
|
Ui::PaddingWrap<Ui::RpWidget> *_innerWrap = nullptr;
|
||||||
|
int _innerDesiredHeight = 0;
|
||||||
|
|
||||||
|
int _additionalScroll = 0;
|
||||||
|
object_ptr<TopBar> _topBar = { nullptr };
|
||||||
|
|
||||||
|
object_ptr<Ui::FadeShadow> _topShadow;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
IntroWidget::IntroWidget(QWidget *parent)
|
||||||
|
: RpWidget(parent)
|
||||||
|
, _topShadow(this)
|
||||||
|
, _wrap(this)
|
||||||
|
, _scroll(Ui::CreateChild<Ui::ScrollArea>(_wrap.data(), st::infoScroll)) {
|
||||||
|
_wrap->setAttribute(Qt::WA_OpaquePaintEvent);
|
||||||
|
_wrap->paintRequest(
|
||||||
|
) | rpl::start_with_next([=](QRect clip) {
|
||||||
|
Painter p(_wrap.data());
|
||||||
|
p.fillRect(clip, st::boxBg);
|
||||||
|
}, _wrap->lifetime());
|
||||||
|
|
||||||
|
_scrollTopSkip.changes(
|
||||||
|
) | rpl::start_with_next([this] {
|
||||||
|
updateControlsGeometry();
|
||||||
|
}, lifetime());
|
||||||
|
|
||||||
|
createTopBar();
|
||||||
|
showContent();
|
||||||
|
_topShadow->toggleOn(
|
||||||
|
topShadowToggledValue(
|
||||||
|
) | rpl::filter([](bool shown) {
|
||||||
|
return true;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntroWidget::updateControlsGeometry() {
|
||||||
|
if (!_innerWrap) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_topBar->resizeToWidth(width());
|
||||||
|
_topShadow->resizeToWidth(width());
|
||||||
|
_topShadow->moveToLeft(0, _topBar->height());
|
||||||
|
_wrap->setGeometry(contentGeometry());
|
||||||
|
|
||||||
|
auto newScrollTop = _scroll->scrollTop();
|
||||||
|
auto scrollGeometry = _wrap->rect().marginsRemoved(
|
||||||
|
QMargins(0, _scrollTopSkip.current(), 0, 0));
|
||||||
|
if (_scroll->geometry() != scrollGeometry) {
|
||||||
|
_scroll->setGeometry(scrollGeometry);
|
||||||
|
_innerWrap->resizeToWidth(_scroll->width());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_scroll->isHidden()) {
|
||||||
|
auto scrollTop = _scroll->scrollTop();
|
||||||
|
_innerWrap->setVisibleTopBottom(
|
||||||
|
scrollTop,
|
||||||
|
scrollTop + _scroll->height());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntroWidget::forceContentRepaint() {
|
||||||
|
// WA_OpaquePaintEvent on TopBar creates render glitches when
|
||||||
|
// animating the LayerWidget's height :( Fixing by repainting.
|
||||||
|
|
||||||
|
if (_topBar) {
|
||||||
|
_topBar->update();
|
||||||
|
}
|
||||||
|
_scroll->update();
|
||||||
|
if (_innerWrap) {
|
||||||
|
_innerWrap->update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntroWidget::createTopBar() {
|
||||||
|
_topBar.create(this, st::infoLayerTopBar);
|
||||||
|
_topBar->setTitle(Lang::Viewer(lng_menu_settings));
|
||||||
|
auto close = _topBar->addButton(
|
||||||
|
base::make_unique_q<Ui::IconButton>(
|
||||||
|
_topBar,
|
||||||
|
st::infoLayerTopBarClose));
|
||||||
|
close->addClickHandler([] {
|
||||||
|
Ui::hideSettingsAndLayer();
|
||||||
|
});
|
||||||
|
|
||||||
|
_topBar->lower();
|
||||||
|
_topBar->resizeToWidth(width());
|
||||||
|
_topBar->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntroWidget::setInnerWidget(object_ptr<Ui::RpWidget> content) {
|
||||||
|
_innerWrap = _scroll->setOwnedWidget(
|
||||||
|
object_ptr<Ui::PaddingWrap<Ui::RpWidget>>(
|
||||||
|
this,
|
||||||
|
std::move(content),
|
||||||
|
_innerWrap ? _innerWrap->padding() : style::margins()));
|
||||||
|
_innerWrap->move(0, 0);
|
||||||
|
|
||||||
|
// MSVC BUG + REGRESSION rpl::mappers::tuple :(
|
||||||
|
rpl::combine(
|
||||||
|
_scroll->scrollTopValue(),
|
||||||
|
_scroll->heightValue(),
|
||||||
|
_innerWrap->entity()->desiredHeightValue()
|
||||||
|
) | rpl::start_with_next([this](
|
||||||
|
int top,
|
||||||
|
int height,
|
||||||
|
int desired) {
|
||||||
|
const auto bottom = top + height;
|
||||||
|
_innerDesiredHeight = desired;
|
||||||
|
_innerWrap->setVisibleTopBottom(top, bottom);
|
||||||
|
_scrollTillBottomChanges.fire_copy(std::max(desired - bottom, 0));
|
||||||
|
}, _innerWrap->lifetime());
|
||||||
|
}
|
||||||
|
|
||||||
|
rpl::producer<bool> IntroWidget::topShadowToggledValue() const {
|
||||||
|
using namespace rpl::mappers;
|
||||||
|
return rpl::combine(
|
||||||
|
_scroll->scrollTopValue(),
|
||||||
|
_scrollTopSkip.value()
|
||||||
|
) | rpl::map((_1 > 0) || (_2 > 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntroWidget::showContent() {
|
||||||
|
setInnerWidget(CreateIntroSettings(_scroll));
|
||||||
|
|
||||||
|
_additionalScroll = 0;
|
||||||
|
updateControlsGeometry();
|
||||||
|
_topShadow->raise();
|
||||||
|
_topShadow->finishAnimating();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntroWidget::setInnerFocus() {
|
||||||
|
setFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
rpl::producer<int> IntroWidget::desiredHeightValue() const {
|
||||||
|
using namespace rpl::mappers;
|
||||||
|
return rpl::combine(
|
||||||
|
_topBar->heightValue(),
|
||||||
|
_innerWrap->entity()->desiredHeightValue(),
|
||||||
|
_scrollTopSkip.value()
|
||||||
|
) | rpl::map(_1 + _2 + _3);
|
||||||
|
}
|
||||||
|
|
||||||
|
QRect IntroWidget::contentGeometry() const {
|
||||||
|
return rect().marginsRemoved({ 0, _topBar->height(), 0, 0 });
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntroWidget::resizeEvent(QResizeEvent *e) {
|
||||||
|
updateControlsGeometry();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntroWidget::keyPressEvent(QKeyEvent *e) {
|
||||||
|
CodesFeedString(e->text());
|
||||||
|
return RpWidget::keyPressEvent(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntroWidget::applyAdditionalScroll(int additionalScroll) {
|
||||||
|
if (_innerWrap) {
|
||||||
|
_innerWrap->setPadding({ 0, 0, 0, additionalScroll });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void IntroWidget::updateGeometry(QRect newGeometry, int additionalScroll) {
|
||||||
|
auto scrollChanged = (_additionalScroll != additionalScroll);
|
||||||
|
auto geometryChanged = (geometry() != newGeometry);
|
||||||
|
auto shrinkingContent = (additionalScroll < _additionalScroll);
|
||||||
|
_additionalScroll = additionalScroll;
|
||||||
|
|
||||||
|
if (geometryChanged) {
|
||||||
|
if (shrinkingContent) {
|
||||||
|
setGeometry(newGeometry);
|
||||||
|
}
|
||||||
|
if (scrollChanged) {
|
||||||
|
applyAdditionalScroll(additionalScroll);
|
||||||
|
}
|
||||||
|
if (!shrinkingContent) {
|
||||||
|
setGeometry(newGeometry);
|
||||||
|
}
|
||||||
|
} else if (scrollChanged) {
|
||||||
|
applyAdditionalScroll(additionalScroll);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int IntroWidget::scrollTillBottom(int forHeight) const {
|
||||||
|
auto scrollHeight = forHeight
|
||||||
|
- _scrollTopSkip.current()
|
||||||
|
- _topBar->height();
|
||||||
|
auto scrollBottom = _scroll->scrollTop() + scrollHeight;
|
||||||
|
auto desired = _innerDesiredHeight;
|
||||||
|
return std::max(desired - scrollBottom, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
rpl::producer<int> IntroWidget::scrollTillBottomChanges() const {
|
||||||
|
return _scrollTillBottomChanges.events();
|
||||||
|
}
|
||||||
|
|
||||||
|
IntroWidget::~IntroWidget() = default;
|
||||||
|
|
||||||
|
LayerWidget::LayerWidget(QWidget*)
|
||||||
|
: _content(this) {
|
||||||
|
setupHeightConsumers();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LayerWidget::setupHeightConsumers() {
|
||||||
|
_content->scrollTillBottomChanges(
|
||||||
|
) | rpl::filter([this] {
|
||||||
|
return !_inResize;
|
||||||
|
}) | rpl::start_with_next([this] {
|
||||||
|
resizeToWidth(width());
|
||||||
|
}, lifetime());
|
||||||
|
_content->desiredHeightValue(
|
||||||
|
) | rpl::start_with_next([this](int height) {
|
||||||
|
accumulate_max(_desiredHeight, height);
|
||||||
|
if (_content && !_inResize) {
|
||||||
|
resizeToWidth(width());
|
||||||
|
}
|
||||||
|
}, lifetime());
|
||||||
|
}
|
||||||
|
|
||||||
|
void LayerWidget::showFinished() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void LayerWidget::parentResized() {
|
||||||
|
const auto parentSize = parentWidget()->size();
|
||||||
|
const auto parentWidth = parentSize.width();
|
||||||
|
const auto newWidth = (parentWidth < MinimalSupportedWidth())
|
||||||
|
? parentWidth
|
||||||
|
: qMin(
|
||||||
|
parentWidth - 2 * st::infoMinimalLayerMargin,
|
||||||
|
st::infoDesiredWidth);
|
||||||
|
resizeToWidth(newWidth);
|
||||||
|
}
|
||||||
|
|
||||||
|
int LayerWidget::MinimalSupportedWidth() {
|
||||||
|
auto minimalMargins = 2 * st::infoMinimalLayerMargin;
|
||||||
|
return st::infoMinimalWidth + minimalMargins;
|
||||||
|
}
|
||||||
|
|
||||||
|
int LayerWidget::resizeGetHeight(int newWidth) {
|
||||||
|
if (!parentWidget() || !_content) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_inResize = true;
|
||||||
|
auto guard = gsl::finally([&] { _inResize = false; });
|
||||||
|
|
||||||
|
auto parentSize = parentWidget()->size();
|
||||||
|
auto windowWidth = parentSize.width();
|
||||||
|
auto windowHeight = parentSize.height();
|
||||||
|
auto newLeft = (windowWidth - newWidth) / 2;
|
||||||
|
if (!newLeft) {
|
||||||
|
_content->updateGeometry({
|
||||||
|
0,
|
||||||
|
st::boxRadius,
|
||||||
|
windowWidth,
|
||||||
|
windowHeight - st::boxRadius }, 0);
|
||||||
|
auto newGeometry = QRect(0, 0, windowWidth, windowHeight);
|
||||||
|
if (newGeometry != geometry()) {
|
||||||
|
_content->forceContentRepaint();
|
||||||
|
}
|
||||||
|
if (newGeometry.topLeft() != geometry().topLeft()) {
|
||||||
|
move(newGeometry.topLeft());
|
||||||
|
}
|
||||||
|
_tillTop = _tillBottom = true;
|
||||||
|
return windowHeight;
|
||||||
|
}
|
||||||
|
auto newTop = snap(
|
||||||
|
windowHeight / 24,
|
||||||
|
st::infoLayerTopMinimal,
|
||||||
|
st::infoLayerTopMaximal);
|
||||||
|
auto newBottom = newTop;
|
||||||
|
auto desiredHeight = st::boxRadius + _desiredHeight + st::boxRadius;
|
||||||
|
accumulate_min(desiredHeight, windowHeight - newTop - newBottom);
|
||||||
|
|
||||||
|
// First resize content to new width and get the new desired height.
|
||||||
|
auto contentLeft = 0;
|
||||||
|
auto contentTop = st::boxRadius;
|
||||||
|
auto contentBottom = st::boxRadius;
|
||||||
|
auto contentWidth = newWidth;
|
||||||
|
auto contentHeight = desiredHeight - contentTop - contentBottom;
|
||||||
|
auto scrollTillBottom = _content->scrollTillBottom(contentHeight);
|
||||||
|
auto additionalScroll = std::min(scrollTillBottom, newBottom);
|
||||||
|
|
||||||
|
desiredHeight += additionalScroll;
|
||||||
|
contentHeight += additionalScroll;
|
||||||
|
_tillTop = false;
|
||||||
|
_tillBottom = (newTop + desiredHeight >= windowHeight);
|
||||||
|
if (_tillBottom) {
|
||||||
|
contentHeight += contentBottom;
|
||||||
|
additionalScroll += contentBottom;
|
||||||
|
}
|
||||||
|
_content->updateGeometry({
|
||||||
|
contentLeft,
|
||||||
|
contentTop,
|
||||||
|
contentWidth,
|
||||||
|
contentHeight }, additionalScroll);
|
||||||
|
|
||||||
|
auto newGeometry = QRect(newLeft, newTop, newWidth, desiredHeight);
|
||||||
|
if (newGeometry != geometry()) {
|
||||||
|
_content->forceContentRepaint();
|
||||||
|
}
|
||||||
|
if (newGeometry.topLeft() != geometry().topLeft()) {
|
||||||
|
move(newGeometry.topLeft());
|
||||||
|
}
|
||||||
|
|
||||||
|
return desiredHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LayerWidget::doSetInnerFocus() {
|
||||||
|
_content->setInnerFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LayerWidget::paintEvent(QPaintEvent *e) {
|
||||||
|
Painter p(this);
|
||||||
|
|
||||||
|
auto clip = e->rect();
|
||||||
|
auto r = st::boxRadius;
|
||||||
|
auto parts = RectPart::None | 0;
|
||||||
|
if (!_tillTop && clip.intersects({ 0, 0, width(), r })) {
|
||||||
|
parts |= RectPart::FullTop;
|
||||||
|
}
|
||||||
|
if (!_tillBottom && clip.intersects({ 0, height() - r, width(), r })) {
|
||||||
|
parts |= RectPart::FullBottom;
|
||||||
|
}
|
||||||
|
if (parts) {
|
||||||
|
App::roundRect(
|
||||||
|
p,
|
||||||
|
rect(),
|
||||||
|
st::boxBg,
|
||||||
|
BoxCorners,
|
||||||
|
nullptr,
|
||||||
|
parts);
|
||||||
|
}
|
||||||
|
if (_tillTop) {
|
||||||
|
p.fillRect(0, 0, width(), r, st::boxBg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Info
|
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
This file is part of Telegram Desktop,
|
||||||
|
the official desktop application for the Telegram messaging service.
|
||||||
|
|
||||||
|
For license and copyright information please follow this link:
|
||||||
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "window/layer_widget.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class VerticalLayout;
|
||||||
|
class FadeShadow;
|
||||||
|
class FlatLabel;
|
||||||
|
template <typename Widget>
|
||||||
|
class FadeWrap;
|
||||||
|
} // namespace Ui
|
||||||
|
|
||||||
|
namespace Settings {
|
||||||
|
|
||||||
|
class IntroWidget;
|
||||||
|
|
||||||
|
class LayerWidget : public Window::LayerWidget {
|
||||||
|
public:
|
||||||
|
LayerWidget(QWidget*);
|
||||||
|
|
||||||
|
void showFinished() override;
|
||||||
|
void parentResized() override;
|
||||||
|
|
||||||
|
static int MinimalSupportedWidth();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int resizeGetHeight(int newWidth) override;
|
||||||
|
void doSetInnerFocus() override;
|
||||||
|
|
||||||
|
void paintEvent(QPaintEvent *e) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void setupHeightConsumers();
|
||||||
|
|
||||||
|
object_ptr<IntroWidget> _content;
|
||||||
|
|
||||||
|
int _desiredHeight = 0;
|
||||||
|
bool _inResize = false;
|
||||||
|
bool _tillTop = false;
|
||||||
|
bool _tillBottom = false;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Info
|
|
@ -26,7 +26,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_settings.h"
|
#include "styles/style_settings.h"
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
namespace {
|
|
||||||
|
|
||||||
void SetupUploadPhotoButton(
|
void SetupUploadPhotoButton(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
|
@ -136,12 +135,16 @@ void SetupSections(
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupInterfaceScale(not_null<Ui::VerticalLayout*> container) {
|
bool HasInterfaceScale() {
|
||||||
if (cRetina()) {
|
return !cRetina();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetupInterfaceScale(
|
||||||
|
not_null<Ui::VerticalLayout*> container,
|
||||||
|
bool icon) {
|
||||||
|
if (!HasInterfaceScale()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AddDivider(container);
|
|
||||||
AddSkip(container);
|
|
||||||
|
|
||||||
const auto toggled = Ui::AttachAsChild(
|
const auto toggled = Ui::AttachAsChild(
|
||||||
container,
|
container,
|
||||||
|
@ -152,13 +155,13 @@ void SetupInterfaceScale(not_null<Ui::VerticalLayout*> container) {
|
||||||
const auto button = AddButton(
|
const auto button = AddButton(
|
||||||
container,
|
container,
|
||||||
lng_settings_default_scale,
|
lng_settings_default_scale,
|
||||||
st::settingsSectionButton,
|
icon ? st::settingsSectionButton : st::settingsGeneralButton,
|
||||||
&st::settingsIconInterfaceScale
|
icon ? &st::settingsIconInterfaceScale : nullptr
|
||||||
)->toggleOn(toggled->events_starting_with_copy(switched));
|
)->toggleOn(toggled->events_starting_with_copy(switched));
|
||||||
|
|
||||||
const auto slider = container->add(
|
const auto slider = container->add(
|
||||||
object_ptr<Ui::SettingsSlider>(container, st::settingsSlider),
|
object_ptr<Ui::SettingsSlider>(container, st::settingsSlider),
|
||||||
st::settingsScalePadding);
|
icon ? st::settingsScalePadding : st::settingsBigScalePadding);
|
||||||
|
|
||||||
const auto inSetScale = Ui::AttachAsChild(container, false);
|
const auto inSetScale = Ui::AttachAsChild(container, false);
|
||||||
const auto setScale = std::make_shared<Fn<void(DBIScale)>>();
|
const auto setScale = std::make_shared<Fn<void(DBIScale)>>();
|
||||||
|
@ -245,22 +248,24 @@ void SetupInterfaceScale(not_null<Ui::VerticalLayout*> container) {
|
||||||
) | rpl::start_with_next([=](int section) {
|
) | rpl::start_with_next([=](int section) {
|
||||||
(*setScale)(scaleByIndex(section));
|
(*setScale)(scaleByIndex(section));
|
||||||
}, slider->lifetime());
|
}, slider->lifetime());
|
||||||
|
}
|
||||||
|
|
||||||
AddSkip(container);
|
void SetupFaq(not_null<Ui::VerticalLayout*> container, bool icon) {
|
||||||
|
AddButton(
|
||||||
|
container,
|
||||||
|
lng_settings_faq,
|
||||||
|
icon ? st::settingsSectionButton : st::settingsGeneralButton,
|
||||||
|
icon ? &st::settingsIconFaq : nullptr
|
||||||
|
)->addClickHandler([] {
|
||||||
|
QDesktopServices::openUrl(telegramFaqLink());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupHelp(not_null<Ui::VerticalLayout*> container) {
|
void SetupHelp(not_null<Ui::VerticalLayout*> container) {
|
||||||
AddDivider(container);
|
AddDivider(container);
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
|
|
||||||
AddButton(
|
SetupFaq(container);
|
||||||
container,
|
|
||||||
lng_settings_faq,
|
|
||||||
st::settingsSectionButton,
|
|
||||||
&st::settingsIconFaq
|
|
||||||
)->addClickHandler([] {
|
|
||||||
QDesktopServices::openUrl(telegramFaqLink());
|
|
||||||
});
|
|
||||||
|
|
||||||
if (AuthSession::Exists()) {
|
if (AuthSession::Exists()) {
|
||||||
const auto button = AddButton(
|
const auto button = AddButton(
|
||||||
|
@ -281,8 +286,6 @@ void SetupHelp(not_null<Ui::VerticalLayout*> container) {
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
Main::Main(
|
Main::Main(
|
||||||
QWidget *parent,
|
QWidget *parent,
|
||||||
not_null<Window::Controller*> controller,
|
not_null<Window::Controller*> controller,
|
||||||
|
@ -310,7 +313,12 @@ void Main::setupContent(not_null<Window::Controller*> controller) {
|
||||||
SetupSections(content, [=](Type type) {
|
SetupSections(content, [=](Type type) {
|
||||||
_showOther.fire_copy(type);
|
_showOther.fire_copy(type);
|
||||||
});
|
});
|
||||||
SetupInterfaceScale(content);
|
if (HasInterfaceScale()) {
|
||||||
|
AddDivider(content);
|
||||||
|
AddSkip(content);
|
||||||
|
SetupInterfaceScale(content);
|
||||||
|
AddSkip(content);
|
||||||
|
}
|
||||||
SetupHelp(content);
|
SetupHelp(content);
|
||||||
|
|
||||||
Ui::ResizeFitChild(this, content);
|
Ui::ResizeFitChild(this, content);
|
||||||
|
|
|
@ -19,6 +19,14 @@ class VerticalLayout;
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
|
|
||||||
|
bool HasInterfaceScale();
|
||||||
|
void SetupInterfaceScale(
|
||||||
|
not_null<Ui::VerticalLayout*> container,
|
||||||
|
bool icon = true);
|
||||||
|
void SetupFaq(
|
||||||
|
not_null<Ui::VerticalLayout*> container,
|
||||||
|
bool icon = true);
|
||||||
|
|
||||||
class Main : public Section {
|
class Main : public Section {
|
||||||
public:
|
public:
|
||||||
Main(
|
Main(
|
||||||
|
|
|
@ -8,7 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "window/window_controller.h"
|
#include "window/window_controller.h"
|
||||||
|
|
||||||
#include "window/main_window.h"
|
#include "window/main_window.h"
|
||||||
#include "old_settings/settings_widget.h"
|
|
||||||
#include "info/info_memento.h"
|
#include "info/info_memento.h"
|
||||||
#include "info/info_controller.h"
|
#include "info/info_controller.h"
|
||||||
#include "history/history.h"
|
#include "history/history.h"
|
||||||
|
@ -478,18 +477,11 @@ void Navigation::showPeerInfo(
|
||||||
void Navigation::showSettings(
|
void Navigation::showSettings(
|
||||||
Settings::Type type,
|
Settings::Type type,
|
||||||
const SectionShow ¶ms) {
|
const SectionShow ¶ms) {
|
||||||
if (AuthSession::Exists()) {
|
showSection(
|
||||||
showSection(
|
Info::Memento(
|
||||||
Info::Memento(
|
Info::Settings::Tag{ Auth().user() },
|
||||||
Info::Settings::Tag{ Auth().user() },
|
Info::Section(type)),
|
||||||
Info::Section(type)),
|
params);
|
||||||
params);
|
|
||||||
} else {
|
|
||||||
// #TODO settings
|
|
||||||
App::wnd()->showSpecialLayer(
|
|
||||||
Box<OldSettings::Widget>(),
|
|
||||||
params.animated);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Navigation::showSettings(const SectionShow ¶ms) {
|
void Navigation::showSettings(const SectionShow ¶ms) {
|
||||||
|
|
|
@ -574,6 +574,8 @@
|
||||||
<(src_loc)/settings/settings_general.h
|
<(src_loc)/settings/settings_general.h
|
||||||
<(src_loc)/settings/settings_information.cpp
|
<(src_loc)/settings/settings_information.cpp
|
||||||
<(src_loc)/settings/settings_information.h
|
<(src_loc)/settings/settings_information.h
|
||||||
|
<(src_loc)/settings/settings_intro.cpp
|
||||||
|
<(src_loc)/settings/settings_intro.h
|
||||||
<(src_loc)/settings/settings_main.cpp
|
<(src_loc)/settings/settings_main.cpp
|
||||||
<(src_loc)/settings/settings_main.h
|
<(src_loc)/settings/settings_main.h
|
||||||
<(src_loc)/settings/settings_notifications.cpp
|
<(src_loc)/settings/settings_notifications.cpp
|
||||||
|
|
Loading…
Reference in New Issue