/* 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