New option: "Show "View Profile" first"
This commit is contained in:
parent
a197245574
commit
1186494b91
5 changed files with 35 additions and 5 deletions
|
|
@ -270,5 +270,7 @@
|
||||||
"ktg_experimental_view_profile_context_menu_description": "Add \"View Profile\" to context menu in chats list",
|
"ktg_experimental_view_profile_context_menu_description": "Add \"View Profile\" to context menu in chats list",
|
||||||
"ktg_experimental_linux_nvidia_opengl": "Allow OpenGL on the NVIDIA drivers (Linux)",
|
"ktg_experimental_linux_nvidia_opengl": "Allow OpenGL on the NVIDIA drivers (Linux)",
|
||||||
"ktg_experimental_linux_nvidia_opengl_description": "Qt+OpenGL have problems on Linux with NVIDIA drivers.",
|
"ktg_experimental_linux_nvidia_opengl_description": "Qt+OpenGL have problems on Linux with NVIDIA drivers.",
|
||||||
|
"ktg_settings_view_profile_on_top": "Show \"View Profile\" first",
|
||||||
|
"ktg_settings_view_profile_on_top_about": "This option also enables \"Add \"View Profile\"\" from TDesktop's experimental settings.",
|
||||||
"dummy_last_string": ""
|
"dummy_last_string": ""
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -270,5 +270,7 @@
|
||||||
"ktg_experimental_view_profile_context_menu_description": "Добавить пункт \"Показать профиль\" в контекстное меню списка чатов.",
|
"ktg_experimental_view_profile_context_menu_description": "Добавить пункт \"Показать профиль\" в контекстное меню списка чатов.",
|
||||||
"ktg_experimental_linux_nvidia_opengl": "OpenGL на драйверах NVIDIA (Linux)",
|
"ktg_experimental_linux_nvidia_opengl": "OpenGL на драйверах NVIDIA (Linux)",
|
||||||
"ktg_experimental_linux_nvidia_opengl_description": "У Qt+OpenGL есть проблемы на Linux с драйверами NVIDIA.",
|
"ktg_experimental_linux_nvidia_opengl_description": "У Qt+OpenGL есть проблемы на Linux с драйверами NVIDIA.",
|
||||||
|
"ktg_settings_view_profile_on_top": "\"Показать профиль\" первым пунктом меню",
|
||||||
|
"ktg_settings_view_profile_on_top_about": "Эта настройка также включает \"Добавить \"Показать профиль\"\" из экспериментальных настроек TDesktop.",
|
||||||
"dummy_last_string": ""
|
"dummy_last_string": ""
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -460,6 +460,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap {
|
||||||
{ "remember_compress_images", {
|
{ "remember_compress_images", {
|
||||||
.type = SettingType::BoolSetting,
|
.type = SettingType::BoolSetting,
|
||||||
.defaultValue = false, }},
|
.defaultValue = false, }},
|
||||||
|
{ "view_profile_on_top", {
|
||||||
|
.type = SettingType::BoolSetting,
|
||||||
|
.defaultValue = false, }},
|
||||||
};
|
};
|
||||||
|
|
||||||
using OldOptionKey = QString;
|
using OldOptionKey = QString;
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ https://github.com/kotatogram/kotatogram-desktop/blob/dev/LEGAL
|
||||||
|
|
||||||
#include "kotato/kotato_lang.h"
|
#include "kotato/kotato_lang.h"
|
||||||
#include "kotato/kotato_settings.h"
|
#include "kotato/kotato_settings.h"
|
||||||
|
#include "base/options.h"
|
||||||
#include "base/platform/base_platform_info.h"
|
#include "base/platform/base_platform_info.h"
|
||||||
#include "settings/settings_common.h"
|
#include "settings/settings_common.h"
|
||||||
#include "settings/settings_chat.h"
|
#include "settings/settings_chat.h"
|
||||||
|
|
@ -26,6 +27,7 @@ https://github.com/kotatogram/kotatogram-desktop/blob/dev/LEGAL
|
||||||
#include "ui/boxes/confirm_box.h"
|
#include "ui/boxes/confirm_box.h"
|
||||||
#include "platform/platform_specific.h"
|
#include "platform/platform_specific.h"
|
||||||
#include "platform/platform_file_utilities.h"
|
#include "platform/platform_file_utilities.h"
|
||||||
|
#include "window/window_peer_menu.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "core/update_checker.h"
|
#include "core/update_checker.h"
|
||||||
|
|
@ -336,12 +338,30 @@ void SetupKotatoChats(
|
||||||
::Kotato::JsonSettings::Write();
|
::Kotato::JsonSettings::Write();
|
||||||
}, container->lifetime());
|
}, container->lifetime());
|
||||||
|
|
||||||
|
AddButton(
|
||||||
|
container,
|
||||||
|
rktr("ktg_settings_view_profile_on_top"),
|
||||||
|
st::settingsButton
|
||||||
|
)->toggleOn(
|
||||||
|
rpl::single(::Kotato::JsonSettings::GetBool("view_profile_on_top"))
|
||||||
|
)->toggledValue(
|
||||||
|
) | rpl::filter([](bool enabled) {
|
||||||
|
return (enabled != ::Kotato::JsonSettings::GetBool("view_profile_on_top"));
|
||||||
|
}) | rpl::start_with_next([](bool enabled) {
|
||||||
|
::Kotato::JsonSettings::Set("view_profile_on_top", enabled);
|
||||||
|
if (enabled) {
|
||||||
|
auto &option = ::base::options::lookup<bool>(Window::kOptionViewProfileInChatsListContextMenu);
|
||||||
|
option.set(true);
|
||||||
|
}
|
||||||
|
::Kotato::JsonSettings::Write();
|
||||||
|
}, container->lifetime());
|
||||||
|
|
||||||
|
AddSkip(container);
|
||||||
|
AddDividerText(container, rktr("ktg_settings_view_profile_on_top_about"));
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupKotatoMessages(not_null<Ui::VerticalLayout*> container) {
|
void SetupKotatoMessages(not_null<Ui::VerticalLayout*> container) {
|
||||||
AddDivider(container);
|
|
||||||
AddSkip(container);
|
|
||||||
AddSubsectionTitle(container, rktr("ktg_settings_messages"));
|
AddSubsectionTitle(container, rktr("ktg_settings_messages"));
|
||||||
|
|
||||||
const auto stickerHeightLabel = container->add(
|
const auto stickerHeightLabel = container->add(
|
||||||
|
|
|
||||||
|
|
@ -773,11 +773,15 @@ void Filler::fill() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Filler::fillChatsListActions() {
|
void Filler::fillChatsListActions() {
|
||||||
|
const auto profileEnabled = ViewProfileInChatsListContextMenu.value();
|
||||||
|
const auto profileOnTop = ::Kotato::JsonSettings::GetBool("view_profile_on_top");
|
||||||
addHidePromotion();
|
addHidePromotion();
|
||||||
addInfo();
|
if (profileEnabled && profileOnTop) {
|
||||||
|
addInfo();
|
||||||
|
}
|
||||||
addToggleArchive();
|
addToggleArchive();
|
||||||
addTogglePin();
|
addTogglePin();
|
||||||
if (ViewProfileInChatsListContextMenu.value()) {
|
if (profileEnabled && !profileOnTop) {
|
||||||
addInfo();
|
addInfo();
|
||||||
}
|
}
|
||||||
addToggleMute();
|
addToggleMute();
|
||||||
|
|
@ -794,7 +798,6 @@ void Filler::fillChatsListActions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Filler::fillHistoryActions() {
|
void Filler::fillHistoryActions() {
|
||||||
addInfo();
|
|
||||||
addToggleMute();
|
addToggleMute();
|
||||||
addSupportInfo();
|
addSupportInfo();
|
||||||
addHidePin();
|
addHidePin();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue