Add empty experimental settings section.
This commit is contained in:
parent
3a78e94f2f
commit
4aafcebef5
|
@ -1027,6 +1027,8 @@ PRIVATE
|
||||||
settings/settings_codes.h
|
settings/settings_codes.h
|
||||||
settings/settings_common.cpp
|
settings/settings_common.cpp
|
||||||
settings/settings_common.h
|
settings/settings_common.h
|
||||||
|
settings/settings_experimental.cpp
|
||||||
|
settings/settings_experimental.h
|
||||||
settings/settings_folders.cpp
|
settings/settings_folders.cpp
|
||||||
settings/settings_folders.h
|
settings/settings_folders.h
|
||||||
settings/settings_information.cpp
|
settings/settings_information.cpp
|
||||||
|
|
|
@ -392,6 +392,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_settings_section_scale" = "Interface Scale";
|
"lng_settings_section_scale" = "Interface Scale";
|
||||||
"lng_settings_scale_auto" = "Auto ({cur})";
|
"lng_settings_scale_auto" = "Auto ({cur})";
|
||||||
|
|
||||||
|
"lng_settings_experimental" = "Experimental settings";
|
||||||
|
"lng_settings_experimental_about" = "Warning! Those are experimental settings. Some may not work. Others may break the app. Any of them may disappear in the next version without a trace. Use at your own risk.";
|
||||||
|
|
||||||
"lng_settings_section_chat_settings" = "Chat Settings";
|
"lng_settings_section_chat_settings" = "Chat Settings";
|
||||||
"lng_settings_replace_emojis" = "Replace emoji";
|
"lng_settings_replace_emojis" = "Replace emoji";
|
||||||
"lng_settings_suggest_emoji" = "Suggest emoji replacements";
|
"lng_settings_suggest_emoji" = "Suggest emoji replacements";
|
||||||
|
|
|
@ -641,6 +641,8 @@ rpl::producer<QString> TitleValue(
|
||||||
return tr::lng_filters_title();
|
return tr::lng_filters_title();
|
||||||
case Section::SettingsType::Calls:
|
case Section::SettingsType::Calls:
|
||||||
return tr::lng_settings_section_call_settings();
|
return tr::lng_settings_section_call_settings();
|
||||||
|
case Section::SettingsType::Experimental:
|
||||||
|
return tr::lng_settings_experimental();
|
||||||
}
|
}
|
||||||
Unexpected("Bad settings type in Info::TitleValue()");
|
Unexpected("Bad settings type in Info::TitleValue()");
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,9 @@ bool HasUpdate() {
|
||||||
return !Core::UpdaterDisabled();
|
return !Core::UpdaterDisabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupUpdate(not_null<Ui::VerticalLayout*> container) {
|
void SetupUpdate(
|
||||||
|
not_null<Ui::VerticalLayout*> container,
|
||||||
|
Fn<void(Type)> showOther) {
|
||||||
if (!HasUpdate()) {
|
if (!HasUpdate()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -112,6 +114,24 @@ void SetupUpdate(not_null<Ui::VerticalLayout*> container) {
|
||||||
tr::lng_settings_install_beta(),
|
tr::lng_settings_install_beta(),
|
||||||
st::settingsButton).get();
|
st::settingsButton).get();
|
||||||
|
|
||||||
|
if (showOther) {
|
||||||
|
const auto experimental = inner->add(
|
||||||
|
object_ptr<Ui::SlideWrap<Button>>(
|
||||||
|
inner,
|
||||||
|
object_ptr<Button>(
|
||||||
|
inner,
|
||||||
|
tr::lng_settings_experimental(),
|
||||||
|
st::settingsButton)));
|
||||||
|
if (!install) {
|
||||||
|
experimental->toggle(true, anim::type::instant);
|
||||||
|
} else {
|
||||||
|
experimental->toggleOn(install->toggledValue());
|
||||||
|
}
|
||||||
|
experimental->entity()->setClickedCallback([=] {
|
||||||
|
showOther(Type::Experimental);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const auto check = AddButton(
|
const auto check = AddButton(
|
||||||
inner,
|
inner,
|
||||||
tr::lng_settings_check_now(),
|
tr::lng_settings_check_now(),
|
||||||
|
@ -708,7 +728,9 @@ void Advanced::setupContent(not_null<Window::SessionController*> controller) {
|
||||||
addDivider();
|
addDivider();
|
||||||
AddSkip(content);
|
AddSkip(content);
|
||||||
AddSubsectionTitle(content, tr::lng_settings_version_info());
|
AddSubsectionTitle(content, tr::lng_settings_version_info());
|
||||||
SetupUpdate(content);
|
SetupUpdate(content, [=](Type type) {
|
||||||
|
_showOther.fire_copy(type);
|
||||||
|
});
|
||||||
AddSkip(content);
|
AddSkip(content);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,7 +24,9 @@ void SetupConnectionType(
|
||||||
not_null<Main::Account*> account,
|
not_null<Main::Account*> account,
|
||||||
not_null<Ui::VerticalLayout*> container);
|
not_null<Ui::VerticalLayout*> container);
|
||||||
bool HasUpdate();
|
bool HasUpdate();
|
||||||
void SetupUpdate(not_null<Ui::VerticalLayout*> container);
|
void SetupUpdate(
|
||||||
|
not_null<Ui::VerticalLayout*> container,
|
||||||
|
Fn<void(Type)> showOther);
|
||||||
void SetupSystemIntegrationContent(
|
void SetupSystemIntegrationContent(
|
||||||
Window::SessionController *controller,
|
Window::SessionController *controller,
|
||||||
not_null<Ui::VerticalLayout*> container);
|
not_null<Ui::VerticalLayout*> container);
|
||||||
|
|
|
@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "settings/settings_privacy_security.h"
|
#include "settings/settings_privacy_security.h"
|
||||||
#include "settings/settings_folders.h"
|
#include "settings/settings_folders.h"
|
||||||
#include "settings/settings_calls.h"
|
#include "settings/settings_calls.h"
|
||||||
|
#include "settings/settings_experimental.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "ui/wrap/padding_wrap.h"
|
#include "ui/wrap/padding_wrap.h"
|
||||||
#include "ui/wrap/vertical_layout.h"
|
#include "ui/wrap/vertical_layout.h"
|
||||||
|
@ -59,6 +60,8 @@ object_ptr<Section> CreateSection(
|
||||||
return object_ptr<Chat>(parent, controller);
|
return object_ptr<Chat>(parent, controller);
|
||||||
case Type::Calls:
|
case Type::Calls:
|
||||||
return object_ptr<Calls>(parent, controller);
|
return object_ptr<Calls>(parent, controller);
|
||||||
|
case Type::Experimental:
|
||||||
|
return object_ptr<Experimental>(parent, controller);
|
||||||
}
|
}
|
||||||
Unexpected("Settings section type in Widget::createInnerWidget.");
|
Unexpected("Settings section type in Widget::createInnerWidget.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ enum class Type {
|
||||||
Chat,
|
Chat,
|
||||||
Folders,
|
Folders,
|
||||||
Calls,
|
Calls,
|
||||||
|
Experimental,
|
||||||
};
|
};
|
||||||
|
|
||||||
using Button = Ui::SettingsButton;
|
using Button = Ui::SettingsButton;
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
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_experimental.h"
|
||||||
|
|
||||||
|
#include "ui/wrap/vertical_layout.h"
|
||||||
|
#include "ui/widgets/buttons.h"
|
||||||
|
#include "ui/widgets/labels.h"
|
||||||
|
#include "chat_helpers/tabbed_panel.h"
|
||||||
|
#include "lang/lang_keys.h"
|
||||||
|
#include "styles/style_settings.h"
|
||||||
|
#include "styles/style_layers.h"
|
||||||
|
|
||||||
|
namespace Settings {
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
void SetupExperimental(
|
||||||
|
not_null<Window::SessionController*> controller,
|
||||||
|
not_null<Ui::VerticalLayout*> container) {
|
||||||
|
AddSkip(container, st::settingsCheckboxesSkip);
|
||||||
|
|
||||||
|
container->add(
|
||||||
|
object_ptr<Ui::FlatLabel>(
|
||||||
|
container,
|
||||||
|
tr::lng_settings_experimental_about(),
|
||||||
|
st::boxLabel),
|
||||||
|
st::settingsDividerLabelPadding);
|
||||||
|
|
||||||
|
AddDivider(container);
|
||||||
|
|
||||||
|
AddSkip(container, st::settingsCheckboxesSkip);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
Experimental::Experimental(
|
||||||
|
QWidget *parent,
|
||||||
|
not_null<Window::SessionController*> controller)
|
||||||
|
: Section(parent) {
|
||||||
|
setupContent(controller);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Experimental::setupContent(
|
||||||
|
not_null<Window::SessionController*> controller) {
|
||||||
|
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||||
|
|
||||||
|
SetupExperimental(controller, content);
|
||||||
|
|
||||||
|
Ui::ResizeFitChild(this, content);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Settings
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
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 "settings/settings_common.h"
|
||||||
|
|
||||||
|
namespace Settings {
|
||||||
|
|
||||||
|
class Experimental : public Section {
|
||||||
|
public:
|
||||||
|
Experimental(
|
||||||
|
QWidget *parent,
|
||||||
|
not_null<Window::SessionController*> controller);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void setupContent(not_null<Window::SessionController*> controller);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Settings
|
|
@ -69,7 +69,7 @@ object_ptr<Ui::RpWidget> CreateIntroSettings(
|
||||||
if (HasUpdate()) {
|
if (HasUpdate()) {
|
||||||
AddDivider(result);
|
AddDivider(result);
|
||||||
AddSkip(result);
|
AddSkip(result);
|
||||||
SetupUpdate(result);
|
SetupUpdate(result, nullptr);
|
||||||
AddSkip(result);
|
AddSkip(result);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue