mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Started work on settings
This commit is contained in:
BIN
Telegram/Resources/icons/settings_kotato.png
Normal file
BIN
Telegram/Resources/icons/settings_kotato.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
Telegram/Resources/icons/settings_kotato@2x.png
Normal file
BIN
Telegram/Resources/icons/settings_kotato@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
Telegram/Resources/icons/settings_kotato@3x.png
Normal file
BIN
Telegram/Resources/icons/settings_kotato@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
@@ -2253,4 +2253,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
|
|
||||||
"ktg_profile_subscribers_section" = "Subscribers";
|
"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
|
// Keys finished
|
||||||
|
@@ -26,5 +26,10 @@
|
|||||||
"many": "{count} подписчиков",
|
"many": "{count} подписчиков",
|
||||||
"other": "{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": "Всегда показывать отложенные"
|
||||||
}
|
}
|
||||||
|
@@ -631,6 +631,8 @@ rpl::producer<QString> TitleValue(
|
|||||||
return tr::lng_settings_section_chat_settings();
|
return tr::lng_settings_section_chat_settings();
|
||||||
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::Kotato:
|
||||||
|
return tr::ktg_settings_kotato();
|
||||||
}
|
}
|
||||||
Unexpected("Bad settings type in Info::TitleValue()");
|
Unexpected("Bad settings type in Info::TitleValue()");
|
||||||
}
|
}
|
||||||
|
@@ -60,6 +60,7 @@ settingsIconFaq: icon {{ "settings_faq", menuIconFg }};
|
|||||||
settingsIconStickers: icon {{ "settings_stickers", menuIconFg }};
|
settingsIconStickers: icon {{ "settings_stickers", menuIconFg }};
|
||||||
settingsIconEmoji: icon {{ "settings_emoji", menuIconFg }};
|
settingsIconEmoji: icon {{ "settings_emoji", menuIconFg }};
|
||||||
settingsIconThemes: icon {{ "settings_themes", menuIconFg }};
|
settingsIconThemes: icon {{ "settings_themes", menuIconFg }};
|
||||||
|
settingsIconKotato: icon {{ "settings_kotato", menuIconFg }};
|
||||||
|
|
||||||
settingsSetPhotoSkip: 7px;
|
settingsSetPhotoSkip: 7px;
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
#include "settings/settings_notifications.h"
|
#include "settings/settings_notifications.h"
|
||||||
#include "settings/settings_privacy_security.h"
|
#include "settings/settings_privacy_security.h"
|
||||||
#include "settings/settings_calls.h"
|
#include "settings/settings_calls.h"
|
||||||
|
#include "settings/settings_kotato.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"
|
||||||
#include "ui/widgets/labels.h"
|
#include "ui/widgets/labels.h"
|
||||||
@@ -51,6 +52,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::Kotato:
|
||||||
|
return object_ptr<Kotato>(parent, controller);
|
||||||
}
|
}
|
||||||
Unexpected("Settings section type in Widget::createInnerWidget.");
|
Unexpected("Settings section type in Widget::createInnerWidget.");
|
||||||
}
|
}
|
||||||
|
@@ -43,6 +43,7 @@ enum class Type {
|
|||||||
Advanced,
|
Advanced,
|
||||||
Chat,
|
Chat,
|
||||||
Calls,
|
Calls,
|
||||||
|
Kotato,
|
||||||
};
|
};
|
||||||
|
|
||||||
using Button = Info::Profile::Button;
|
using Button = Info::Profile::Button;
|
||||||
|
116
Telegram/SourceFiles/settings/settings_kotato.cpp
Normal file
116
Telegram/SourceFiles/settings/settings_kotato.cpp
Normal file
@@ -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<Ui::VerticalLayout*> container) {
|
||||||
|
AddSkip(container);
|
||||||
|
AddSubsectionTitle(container, tr::ktg_settings_chats());
|
||||||
|
|
||||||
|
const auto stickerHeightLabel = container->add(
|
||||||
|
object_ptr<Ui::LabelSimple>(
|
||||||
|
container,
|
||||||
|
st::settingsAudioVolumeLabel),
|
||||||
|
st::settingsAudioVolumeLabelPadding);
|
||||||
|
const auto stickerHeightSlider = container->add(
|
||||||
|
object_ptr<Ui::MediaSlider>(
|
||||||
|
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<Window::SessionController*> controller)
|
||||||
|
: Section(parent) {
|
||||||
|
setupContent(controller);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Kotato::setupContent(not_null<Window::SessionController*> controller) {
|
||||||
|
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||||
|
|
||||||
|
SetupKotatoChats(content);
|
||||||
|
//SetupKotatoFonts(content);
|
||||||
|
//SetupKotatoNetwork(content);
|
||||||
|
//SetupKotatoOther(content);
|
||||||
|
|
||||||
|
Ui::ResizeFitChild(this, content);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Settings
|
30
Telegram/SourceFiles/settings/settings_kotato.h
Normal file
30
Telegram/SourceFiles/settings/settings_kotato.h
Normal file
@@ -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<Ui::VerticalLayout*> container);
|
||||||
|
//void SetupKotatoFonts(not_null<Ui::VerticalLayout*> container);
|
||||||
|
//void SetupKotatoNetwork(not_null<Ui::VerticalLayout*> container);
|
||||||
|
//void SetupKotatoOther(not_null<Ui::VerticalLayout*> container);
|
||||||
|
|
||||||
|
class Kotato : public Section {
|
||||||
|
public:
|
||||||
|
Kotato(
|
||||||
|
QWidget *parent,
|
||||||
|
not_null<Window::SessionController*> controller);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void setupContent(not_null<Window::SessionController*> controller);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Settings
|
@@ -104,6 +104,10 @@ void SetupSections(
|
|||||||
tr::lng_settings_advanced(),
|
tr::lng_settings_advanced(),
|
||||||
Type::Advanced,
|
Type::Advanced,
|
||||||
&st::settingsIconGeneral);
|
&st::settingsIconGeneral);
|
||||||
|
addSection(
|
||||||
|
tr::ktg_settings_kotato(),
|
||||||
|
Type::Kotato,
|
||||||
|
&st::settingsIconKotato);
|
||||||
|
|
||||||
SetupLanguageButton(container);
|
SetupLanguageButton(container);
|
||||||
|
|
||||||
|
@@ -699,6 +699,8 @@
|
|||||||
<(src_loc)/settings/settings_information.h
|
<(src_loc)/settings/settings_information.h
|
||||||
<(src_loc)/settings/settings_intro.cpp
|
<(src_loc)/settings/settings_intro.cpp
|
||||||
<(src_loc)/settings/settings_intro.h
|
<(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.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
|
||||||
|
Reference in New Issue
Block a user