mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Improve video chat menu for forums.
This commit is contained in:
parent
0c514c4b0a
commit
cddb2a4bac
7 changed files with 40 additions and 14 deletions
BIN
Telegram/Resources/icons/menu/video_chat.png
Normal file
BIN
Telegram/Resources/icons/menu/video_chat.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 557 B |
BIN
Telegram/Resources/icons/menu/video_chat@2x.png
Normal file
BIN
Telegram/Resources/icons/menu/video_chat@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1,022 B |
BIN
Telegram/Resources/icons/menu/video_chat@3x.png
Normal file
BIN
Telegram/Resources/icons/menu/video_chat@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -2810,6 +2810,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_menu_start_group_call_scheduled" = "Schedule video chat";
|
"lng_menu_start_group_call_scheduled" = "Schedule video chat";
|
||||||
"lng_menu_start_group_call_with" = "Stream with...";
|
"lng_menu_start_group_call_with" = "Stream with...";
|
||||||
"lng_menu_start_group_call_join" = "Join video chat";
|
"lng_menu_start_group_call_join" = "Join video chat";
|
||||||
|
"lng_menu_start_group_call_options" = "Video chat";
|
||||||
"lng_menu_start_group_call_channel" = "Start live stream";
|
"lng_menu_start_group_call_channel" = "Start live stream";
|
||||||
"lng_menu_start_group_call_scheduled_channel" = "Schedule live stream";
|
"lng_menu_start_group_call_scheduled_channel" = "Schedule live stream";
|
||||||
"lng_menu_start_group_call_with_channel" = "Stream with...";
|
"lng_menu_start_group_call_with_channel" = "Stream with...";
|
||||||
|
|
|
@ -89,6 +89,9 @@ menuIconAddToFolder: icon {{ "menu/add_to_folder", menuIconColor }};
|
||||||
menuIconLeave: icon {{ "menu/leave", menuIconColor }};
|
menuIconLeave: icon {{ "menu/leave", menuIconColor }};
|
||||||
menuIconGiftPremium: icon {{ "menu/gift_premium", menuIconColor }};
|
menuIconGiftPremium: icon {{ "menu/gift_premium", menuIconColor }};
|
||||||
menuIconSearch: icon {{ "menu/search", menuIconColor }};
|
menuIconSearch: icon {{ "menu/search", menuIconColor }};
|
||||||
|
menuIconStartStream: icon {{ "menu/start_stream", menuIconColor }};
|
||||||
|
menuIconStartStreamWith: icon {{ "menu/start_stream_with", menuIconColor }};
|
||||||
|
menuIconVideoChat: icon {{ "menu/video_chat", menuIconColor }};
|
||||||
|
|
||||||
menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }};
|
menuIconTTLAny: icon {{ "menu/auto_delete_plain", menuIconColor }};
|
||||||
menuIconTTLAnyTextPosition: point(11px, 22px);
|
menuIconTTLAnyTextPosition: point(11px, 22px);
|
||||||
|
@ -110,9 +113,6 @@ mediaMenuIconShowAll: icon {{ "menu/all_media", mediaviewMenuFg }};
|
||||||
mediaMenuIconProfile: icon {{ "menu/profile", mediaviewMenuFg }};
|
mediaMenuIconProfile: icon {{ "menu/profile", mediaviewMenuFg }};
|
||||||
mediaMenuIconReport: icon {{ "menu/report", mediaviewMenuFg }};
|
mediaMenuIconReport: icon {{ "menu/report", mediaviewMenuFg }};
|
||||||
|
|
||||||
menuIconStartStream: icon {{ "menu/start_stream", menuIconColor }};
|
|
||||||
menuIconStartStreamWith: icon {{ "menu/start_stream_with", menuIconColor }};
|
|
||||||
|
|
||||||
menuIconDeleteAttention: icon {{ "menu/delete", menuIconAttentionColor }};
|
menuIconDeleteAttention: icon {{ "menu/delete", menuIconAttentionColor }};
|
||||||
menuIconLeaveAttention: icon {{ "menu/leave", menuIconAttentionColor }};
|
menuIconLeaveAttention: icon {{ "menu/leave", menuIconAttentionColor }};
|
||||||
menuIconDisableAttention: icon {{ "menu/disable", menuIconAttentionColor }};
|
menuIconDisableAttention: icon {{ "menu/disable", menuIconAttentionColor }};
|
||||||
|
|
|
@ -32,6 +32,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/text/text_utilities.h"
|
#include "ui/text/text_utilities.h"
|
||||||
#include "ui/widgets/labels.h"
|
#include "ui/widgets/labels.h"
|
||||||
#include "ui/widgets/checkbox.h"
|
#include "ui/widgets/checkbox.h"
|
||||||
|
#include "ui/widgets/popup_menu.h"
|
||||||
|
#include "ui/widgets/menu/menu_add_action_callback_factory.h"
|
||||||
#include "ui/layers/generic_box.h"
|
#include "ui/layers/generic_box.h"
|
||||||
#include "ui/toasts/common_toasts.h"
|
#include "ui/toasts/common_toasts.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
|
@ -220,10 +222,8 @@ void PeerMenuAddMuteSubmenuAction(
|
||||||
.icon = (notifySettings->sound(thread).none
|
.icon = (notifySettings->sound(thread).none
|
||||||
? &st::menuIconSilent
|
? &st::menuIconSilent
|
||||||
: &st::menuIconMute),
|
: &st::menuIconMute),
|
||||||
.fillSubmenu = [=](not_null<Ui::PopupMenu*> menu) {
|
.fillSubmenu = [&](not_null<Ui::PopupMenu*> menu) {
|
||||||
if (const auto strong = weak.get()) {
|
MuteMenu::FillMuteMenu(menu, thread, show);
|
||||||
MuteMenu::FillMuteMenu(menu, strong, show);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -302,6 +302,7 @@ private:
|
||||||
void addViewAsMessages();
|
void addViewAsMessages();
|
||||||
void addSearchTopics();
|
void addSearchTopics();
|
||||||
void addDeleteTopic();
|
void addDeleteTopic();
|
||||||
|
void addVideoChat();
|
||||||
|
|
||||||
not_null<SessionController*> _controller;
|
not_null<SessionController*> _controller;
|
||||||
Dialogs::EntryState _request;
|
Dialogs::EntryState _request;
|
||||||
|
@ -572,7 +573,7 @@ void Filler::addToggleFolder() {
|
||||||
.text = tr::lng_filters_menu_add(tr::now),
|
.text = tr::lng_filters_menu_add(tr::now),
|
||||||
.handler = nullptr,
|
.handler = nullptr,
|
||||||
.icon = &st::menuIconAddToFolder,
|
.icon = &st::menuIconAddToFolder,
|
||||||
.fillSubmenu = [=](not_null<Ui::PopupMenu*> menu) {
|
.fillSubmenu = [&](not_null<Ui::PopupMenu*> menu) {
|
||||||
FillChooseFilterMenu(controller, menu, history);
|
FillChooseFilterMenu(controller, menu, history);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -1085,13 +1086,13 @@ void Filler::fillChatsListActions() {
|
||||||
addCreateTopic();
|
addCreateTopic();
|
||||||
addInfo();
|
addInfo();
|
||||||
addViewAsMessages();
|
addViewAsMessages();
|
||||||
addManageChat();
|
|
||||||
FillVideoChatMenu(_controller, _request, _addAction);
|
|
||||||
addNewMembers();
|
|
||||||
const auto &all = _peer->forum()->topicsList()->indexed()->all();
|
const auto &all = _peer->forum()->topicsList()->indexed()->all();
|
||||||
if (all.size() > kTopicsSearchMinCount) {
|
if (all.size() > kTopicsSearchMinCount) {
|
||||||
addSearchTopics();
|
addSearchTopics();
|
||||||
}
|
}
|
||||||
|
addManageChat();
|
||||||
|
addNewMembers();
|
||||||
|
addVideoChat();
|
||||||
_addAction(PeerMenuCallback::Args{ .isSeparator = true });
|
_addAction(PeerMenuCallback::Args{ .isSeparator = true });
|
||||||
if (_peer->asChannel()->amIn()) {
|
if (_peer->asChannel()->amIn()) {
|
||||||
addLeaveChat();
|
addLeaveChat();
|
||||||
|
@ -1100,6 +1101,30 @@ void Filler::fillChatsListActions() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Filler::addVideoChat() {
|
||||||
|
auto test = Ui::PopupMenu(nullptr);
|
||||||
|
FillVideoChatMenu(
|
||||||
|
_controller,
|
||||||
|
_request,
|
||||||
|
Ui::Menu::CreateAddActionCallback(&test));
|
||||||
|
if (test.actions().size() < 2) {
|
||||||
|
FillVideoChatMenu(_controller, _request, _addAction);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const auto show = std::make_shared<Window::Show>(_controller);
|
||||||
|
_addAction(PeerMenuCallback::Args{
|
||||||
|
.text = tr::lng_menu_start_group_call_options(tr::now),
|
||||||
|
.handler = nullptr,
|
||||||
|
.icon = &st::menuIconVideoChat,
|
||||||
|
.fillSubmenu = [&](not_null<Ui::PopupMenu*> menu) {
|
||||||
|
FillVideoChatMenu(
|
||||||
|
_controller,
|
||||||
|
_request,
|
||||||
|
Ui::Menu::CreateAddActionCallback(menu));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void Filler::fillContextMenuActions() {
|
void Filler::fillContextMenuActions() {
|
||||||
addHidePromotion();
|
addHidePromotion();
|
||||||
addToggleArchive();
|
addToggleArchive();
|
||||||
|
@ -2017,14 +2042,14 @@ bool FillVideoChatMenu(
|
||||||
addAction(
|
addAction(
|
||||||
tr::lng_menu_start_group_call_join(tr::now),
|
tr::lng_menu_start_group_call_join(tr::now),
|
||||||
[=] { callback({}); },
|
[=] { callback({}); },
|
||||||
&st::menuIconStartStream);
|
&st::menuIconVideoChat);
|
||||||
} else if (manager) {
|
} else if (manager) {
|
||||||
addAction(
|
addAction(
|
||||||
(livestream
|
(livestream
|
||||||
? tr::lng_menu_start_group_call_channel
|
? tr::lng_menu_start_group_call_channel
|
||||||
: tr::lng_menu_start_group_call)(tr::now),
|
: tr::lng_menu_start_group_call)(tr::now),
|
||||||
[=] { callback({}); },
|
[=] { callback({}); },
|
||||||
&st::menuIconStartStream);
|
creator ? &st::menuIconStartStream : &st::menuIconVideoChat);
|
||||||
}
|
}
|
||||||
if (!has && creator) {
|
if (!has && creator) {
|
||||||
addAction(
|
addAction(
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 09e8850dfd9a531449afbb730072a206a0784f6e
|
Subproject commit c3616927ebfcbe98375189be87821bea202d9587
|
Loading…
Add table
Reference in a new issue