Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable short info box #334

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Telegram/Resources/langs/rewrites/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,6 @@
"ktg_settings_view_profile_on_top_about": "This option also enables \"Add \"View Profile\"\" from TDesktop's experimental settings.",
"ktg_settings_emoji_sidebar": "Enable emoji sidebar",
"ktg_settings_emoji_sidebar_right_click": "Emoji sidebar on right click",
"ktg_settings_disable_short_info_box": "Disable short info box",
"dummy_last_string": ""
}
3 changes: 2 additions & 1 deletion Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ For license and copyright information please follow this link:
*/
#include "boxes/peers/edit_participants_box.h"

#include "kotato/kotato_settings.h"
#include "kotato/kotato_lang.h"
#include "api/api_chat_participants.h"
#include "boxes/peer_list_controllers.h"
Expand Down Expand Up @@ -1495,7 +1496,7 @@ void ParticipantsBoxController::rowClicked(not_null<PeerListRow*> row) {
showRestricted(user);
} else {
Assert(_navigation != nullptr);
if (_role != Role::Profile) {
if (_role != Role::Profile && !::Kotato::JsonSettings::GetBool("disable_short_info_box")) {
_navigation->parentController()->show(PrepareShortInfoBox(
participant,
_navigation));
Expand Down
5 changes: 5 additions & 0 deletions Telegram/SourceFiles/boxes/peers/edit_peer_requests_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ For license and copyright information please follow this link:
*/
#include "boxes/peers/edit_peer_requests_box.h"

#include "kotato/kotato_settings.h"
#include "ui/effects/ripple_animation.h"
#include "boxes/peer_list_controllers.h"
#include "boxes/peers/edit_participants_box.h" // SubscribeToMigration
Expand Down Expand Up @@ -355,6 +356,10 @@ void RequestsBoxController::refreshDescription() {
}

void RequestsBoxController::rowClicked(not_null<PeerListRow*> row) {
if (::Kotato::JsonSettings::GetBool("disable_short_info_box")) {
_navigation->showPeerInfo(row->peer());
return;
}
_navigation->parentController()->show(PrepareShortInfoBox(
row->peer(),
_navigation));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ For license and copyright information please follow this link:
*/
#include "history/view/reactions/message_reactions_list.h"

#include "kotato/kotato_settings.h"
#include "history/view/reactions/message_reactions_selector.h"
#include "boxes/peer_list_box.h"
#include "boxes/peers/prepare_short_info_box.h"
Expand Down Expand Up @@ -284,6 +285,10 @@ void Controller::rowClicked(not_null<PeerListRow*> row) {
const auto window = _window;
const auto peer = row->peer();
crl::on_main(window, [=] {
if (::Kotato::JsonSettings::GetBool("disable_short_info_box")) {
window->showPeerInfo(peer);
return;
}
window->show(PrepareShortInfoBox(peer, window));
});
}
Expand Down
3 changes: 3 additions & 0 deletions Telegram/SourceFiles/kotato/kotato_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap {
{ "emoji_sidebar_right_click", {
.type = SettingType::BoolSetting,
.defaultValue = false, }},
{ "disable_short_info_box", {
.type = SettingType::BoolSetting,
.defaultValue = false, }},
};

using OldOptionKey = QString;
Expand Down
1 change: 1 addition & 0 deletions Telegram/SourceFiles/kotato/kotato_settings_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ void SetupKotatoOther(
});

SettingsMenuJsonSwitch(ktg_settings_call_confirm, confirm_before_calls);
SettingsMenuJsonSwitch(ktg_settings_disable_short_info_box, disable_short_info_box);
SettingsMenuJsonSwitch(ktg_settings_remember_compress_images, remember_compress_images);
AddButton(
container,
Expand Down