mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-02 04:20:56 +00:00
Added view-profile-in-chats-list-context-menu option.
This commit is contained in:
parent
74416568d6
commit
37cd4f51eb
@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "base/options.h"
|
||||
#include "chat_helpers/tabbed_panel.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "window/window_peer_menu.h"
|
||||
#include "styles/style_settings.h"
|
||||
#include "styles/style_layers.h"
|
||||
|
||||
@ -62,6 +63,10 @@ void SetupExperimental(
|
||||
addToggle(ChatHelpers::kOptionTabbedPanelShowOnClick);
|
||||
|
||||
AddSkip(container, st::settingsCheckboxesSkip);
|
||||
|
||||
addToggle(Window::kOptionViewProfileInChatsListContextMenu);
|
||||
|
||||
AddSkip(container, st::settingsCheckboxesSkip);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "api/api_chat_participants.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "base/options.h"
|
||||
#include "boxes/delete_messages_box.h"
|
||||
#include "boxes/max_invite_box.h"
|
||||
#include "boxes/mute_settings_box.h"
|
||||
@ -69,11 +70,21 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <QAction>
|
||||
|
||||
namespace Window {
|
||||
|
||||
const char kOptionViewProfileInChatsListContextMenu[] =
|
||||
"view-profile-in-chats-list-context-menu";
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr auto kArchivedToastDuration = crl::time(5000);
|
||||
constexpr auto kMaxUnreadWithoutConfirmation = 10000;
|
||||
|
||||
base::options::toggle ViewProfileInChatsListContextMenu({
|
||||
.id = kOptionViewProfileInChatsListContextMenu,
|
||||
.name = "Add \"View Profile\"",
|
||||
.description = "Add \"View Profile\" to context menu in chats list",
|
||||
});
|
||||
|
||||
void SetActionText(not_null<QAction*> action, rpl::producer<QString> &&text) {
|
||||
const auto lifetime = Ui::CreateChild<rpl::lifetime>(action.get());
|
||||
std::move(
|
||||
@ -736,6 +747,9 @@ void Filler::fillChatsListActions() {
|
||||
addHidePromotion();
|
||||
addToggleArchive();
|
||||
addTogglePin();
|
||||
if (ViewProfileInChatsListContextMenu.value()) {
|
||||
addInfo();
|
||||
}
|
||||
addToggleMute();
|
||||
addToggleUnreadMark();
|
||||
// addToFolder();
|
||||
|
@ -35,6 +35,8 @@ class Controller;
|
||||
class SessionController;
|
||||
class SessionNavigation;
|
||||
|
||||
extern const char kOptionViewProfileInChatsListContextMenu[];
|
||||
|
||||
using PeerMenuCallback = Fn<QAction*(
|
||||
const QString &text,
|
||||
Fn<void()> handler,
|
||||
|
Loading…
Reference in New Issue
Block a user