diff --git a/Telegram/Resources/icons/settings_kotato.png b/Telegram/Resources/icons/settings_kotato.png new file mode 100644 index 000000000..972896188 Binary files /dev/null and b/Telegram/Resources/icons/settings_kotato.png differ diff --git a/Telegram/Resources/icons/settings_kotato@2x.png b/Telegram/Resources/icons/settings_kotato@2x.png new file mode 100644 index 000000000..39f327c83 Binary files /dev/null and b/Telegram/Resources/icons/settings_kotato@2x.png differ diff --git a/Telegram/Resources/icons/settings_kotato@3x.png b/Telegram/Resources/icons/settings_kotato@3x.png new file mode 100644 index 000000000..6aed3ff98 Binary files /dev/null and b/Telegram/Resources/icons/settings_kotato@3x.png differ diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 0f8fda7a6..9b845e9a0 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2253,4 +2253,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ktg_profile_subscribers_section" = "Subscribers"; +"ktg_settings_kotato" = "Kotatogram Settings"; +"ktg_settings_chats" = "Chats"; +"ktg_settings_sticker_height" = "Sticker height: {pixels}px"; +"ktg_settings_emoji_outline" = "Big emoji outline"; +"ktg_settings_always_show_scheduled" = "Always show scheduled"; + // Keys finished diff --git a/Telegram/Resources/langs/rewrites/ru.json b/Telegram/Resources/langs/rewrites/ru.json index c057df716..1e491f531 100644 --- a/Telegram/Resources/langs/rewrites/ru.json +++ b/Telegram/Resources/langs/rewrites/ru.json @@ -26,5 +26,10 @@ "many": "{count} подписчиков", "other": "{count} подписчиков" }, - "ktg_profile_subscribers_section": "Подписчики" + "ktg_profile_subscribers_section": "Подписчики", + "ktg_settings_kotato": "Настройки Kotatogram", + "ktg_settings_chats": "Чаты", + "ktg_settings_sticker_height": "Высота стикеров: {pixels} пикс.", + "ktg_settings_emoji_outline": "Обводка у больших эмодзи", + "ktg_settings_always_show_scheduled": "Всегда показывать отложенные" } diff --git a/Telegram/SourceFiles/info/info_top_bar.cpp b/Telegram/SourceFiles/info/info_top_bar.cpp index bd2fe793e..4c124d283 100644 --- a/Telegram/SourceFiles/info/info_top_bar.cpp +++ b/Telegram/SourceFiles/info/info_top_bar.cpp @@ -631,6 +631,8 @@ rpl::producer TitleValue( return tr::lng_settings_section_chat_settings(); case Section::SettingsType::Calls: return tr::lng_settings_section_call_settings(); + case Section::SettingsType::Kotato: + return tr::ktg_settings_kotato(); } Unexpected("Bad settings type in Info::TitleValue()"); } diff --git a/Telegram/SourceFiles/settings/settings.style b/Telegram/SourceFiles/settings/settings.style index fc9e71d41..48226f549 100644 --- a/Telegram/SourceFiles/settings/settings.style +++ b/Telegram/SourceFiles/settings/settings.style @@ -60,6 +60,7 @@ settingsIconFaq: icon {{ "settings_faq", menuIconFg }}; settingsIconStickers: icon {{ "settings_stickers", menuIconFg }}; settingsIconEmoji: icon {{ "settings_emoji", menuIconFg }}; settingsIconThemes: icon {{ "settings_themes", menuIconFg }}; +settingsIconKotato: icon {{ "settings_kotato", menuIconFg }}; settingsSetPhotoSkip: 7px; diff --git a/Telegram/SourceFiles/settings/settings_common.cpp b/Telegram/SourceFiles/settings/settings_common.cpp index 8044e0505..8b44eb630 100644 --- a/Telegram/SourceFiles/settings/settings_common.cpp +++ b/Telegram/SourceFiles/settings/settings_common.cpp @@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "settings/settings_notifications.h" #include "settings/settings_privacy_security.h" #include "settings/settings_calls.h" +#include "settings/settings_kotato.h" #include "ui/wrap/padding_wrap.h" #include "ui/wrap/vertical_layout.h" #include "ui/widgets/labels.h" @@ -51,6 +52,8 @@ object_ptr
CreateSection( return object_ptr(parent, controller); case Type::Calls: return object_ptr(parent, controller); + case Type::Kotato: + return object_ptr(parent, controller); } Unexpected("Settings section type in Widget::createInnerWidget."); } diff --git a/Telegram/SourceFiles/settings/settings_common.h b/Telegram/SourceFiles/settings/settings_common.h index 1e0d57dea..7635b7613 100644 --- a/Telegram/SourceFiles/settings/settings_common.h +++ b/Telegram/SourceFiles/settings/settings_common.h @@ -43,6 +43,7 @@ enum class Type { Advanced, Chat, Calls, + Kotato, }; using Button = Info::Profile::Button; diff --git a/Telegram/SourceFiles/settings/settings_kotato.cpp b/Telegram/SourceFiles/settings/settings_kotato.cpp new file mode 100644 index 000000000..979d0c3a4 --- /dev/null +++ b/Telegram/SourceFiles/settings/settings_kotato.cpp @@ -0,0 +1,116 @@ +/* +This file is part of Kotatogram Desktop, +the unofficial app based on Telegram Desktop. + +For license and copyright information please follow this link: +https://github.com/kotatogram/kotatogram-desktop/blob/dev/LEGAL +*/ +#include "settings/settings_kotato.h" + +#include "settings/settings_common.h" +#include "settings/settings_chat.h" +#include "ui/wrap/vertical_layout.h" +#include "ui/wrap/slide_wrap.h" +#include "ui/widgets/labels.h" +#include "ui/widgets/checkbox.h" +#include "ui/widgets/continuous_sliders.h" +#include "ui/text/text_utilities.h" // Ui::Text::ToUpper +#include "boxes/connection_box.h" +#include "boxes/about_box.h" +#include "boxes/confirm_box.h" +#include "info/profile/info_profile_button.h" +#include "platform/platform_specific.h" +#include "platform/platform_info.h" +#include "window/window_session_controller.h" +#include "lang/lang_keys.h" +#include "core/update_checker.h" +#include "core/application.h" +#include "storage/localstorage.h" +#include "data/data_session.h" +#include "main/main_session.h" +#include "layout.h" +#include "facades.h" +#include "app.h" +#include "styles/style_settings.h" + +namespace Settings { + +void SetupKotatoChats(not_null container) { + AddSkip(container); + AddSubsectionTitle(container, tr::ktg_settings_chats()); + + const auto stickerHeightLabel = container->add( + object_ptr( + container, + st::settingsAudioVolumeLabel), + st::settingsAudioVolumeLabelPadding); + const auto stickerHeightSlider = container->add( + object_ptr( + container, + st::settingsAudioVolumeSlider), + st::settingsAudioVolumeSliderPadding); + const auto updateStickerHeightLabel = [=](int value) { + const auto pixels = QString::number(value); + stickerHeightLabel->setText( + tr::ktg_settings_sticker_height(tr::now, lt_pixels, pixels)); + }; + const auto updateStickerHeight = [=](int value) { + updateStickerHeightLabel(value); + cSetStickerHeight(value); + }; + stickerHeightSlider->resize(st::settingsAudioVolumeSlider.seekSize); + stickerHeightSlider->setPseudoDiscrete( + 129, + [](int val) { return val + 128; }, + cStickerHeight(), + updateStickerHeight); + updateStickerHeightLabel(cStickerHeight()); + + AddButton( + container, + tr::ktg_settings_emoji_outline(), + st::settingsButton + )->toggleOn( + rpl::single(cBigEmojiOutline()) + )->toggledValue( + ) | rpl::filter([](bool enabled) { + return (enabled != cBigEmojiOutline()); + }) | rpl::start_with_next([](bool enabled) { + cSetBigEmojiOutline(enabled); + }, container->lifetime()); + + AddButton( + container, + tr::ktg_settings_always_show_scheduled(), + st::settingsButton + )->toggleOn( + rpl::single(cAlwaysShowScheduled()) + )->toggledValue( + ) | rpl::filter([](bool enabled) { + return (enabled != cAlwaysShowScheduled()); + }) | rpl::start_with_next([](bool enabled) { + cSetAlwaysShowScheduled(enabled); + }, container->lifetime()); + + AddSkip(container); +} + +Kotato::Kotato( + QWidget *parent, + not_null controller) +: Section(parent) { + setupContent(controller); +} + +void Kotato::setupContent(not_null controller) { + const auto content = Ui::CreateChild(this); + + SetupKotatoChats(content); + //SetupKotatoFonts(content); + //SetupKotatoNetwork(content); + //SetupKotatoOther(content); + + Ui::ResizeFitChild(this, content); +} + +} // namespace Settings diff --git a/Telegram/SourceFiles/settings/settings_kotato.h b/Telegram/SourceFiles/settings/settings_kotato.h new file mode 100644 index 000000000..a490c3f2f --- /dev/null +++ b/Telegram/SourceFiles/settings/settings_kotato.h @@ -0,0 +1,30 @@ +/* +This file is part of Kotatogram Desktop, +the unofficial app based on Telegram Desktop. + +For license and copyright information please follow this link: +https://github.com/kotatogram/kotatogram-desktop/blob/dev/LEGAL +*/ +#pragma once + +#include "settings/settings_common.h" + +namespace Settings { + +void SetupKotatoChats(not_null container); +//void SetupKotatoFonts(not_null container); +//void SetupKotatoNetwork(not_null container); +//void SetupKotatoOther(not_null container); + +class Kotato : public Section { +public: + Kotato( + QWidget *parent, + not_null controller); + +private: + void setupContent(not_null controller); + +}; + +} // namespace Settings diff --git a/Telegram/SourceFiles/settings/settings_main.cpp b/Telegram/SourceFiles/settings/settings_main.cpp index 9794a14c9..0fe486e2c 100644 --- a/Telegram/SourceFiles/settings/settings_main.cpp +++ b/Telegram/SourceFiles/settings/settings_main.cpp @@ -104,6 +104,10 @@ void SetupSections( tr::lng_settings_advanced(), Type::Advanced, &st::settingsIconGeneral); + addSection( + tr::ktg_settings_kotato(), + Type::Kotato, + &st::settingsIconKotato); SetupLanguageButton(container); diff --git a/Telegram/gyp/telegram/sources.txt b/Telegram/gyp/telegram/sources.txt index 143adcca5..a47ea1e61 100644 --- a/Telegram/gyp/telegram/sources.txt +++ b/Telegram/gyp/telegram/sources.txt @@ -699,6 +699,8 @@ <(src_loc)/settings/settings_information.h <(src_loc)/settings/settings_intro.cpp <(src_loc)/settings/settings_intro.h +<(src_loc)/settings/settings_kotato.cpp +<(src_loc)/settings/settings_kotato.h <(src_loc)/settings/settings_main.cpp <(src_loc)/settings/settings_main.h <(src_loc)/settings/settings_notifications.cpp