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