mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Added new action button for chat management to profile top bar.
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 606 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -1694,6 +1694,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_profile_action_short_report" = "Report";
|
||||
"lng_profile_action_short_leave" = "Leave";
|
||||
"lng_profile_action_short_more" = "More";
|
||||
"lng_profile_action_short_manage" = "Manage";
|
||||
|
||||
"lng_media_type_photos" = "Photos";
|
||||
"lng_media_type_gifs" = "GIFs";
|
||||
|
||||
@@ -453,6 +453,7 @@ infoProfileTopBarActionJoin: icon{{ "profile/join-23x23", windowBoldFg }};
|
||||
infoProfileTopBarActionReport: icon{{ "profile/report-23x23", windowBoldFg }};
|
||||
infoProfileTopBarActionLeave: icon{{ "profile/leave-23x23", windowBoldFg }};
|
||||
infoProfileTopBarActionMore: icon{{ "profile/profile_more", windowBoldFg }};
|
||||
infoProfileTopBarActionManage: icon{{ "profile/profile_manage", windowBoldFg }};
|
||||
|
||||
infoProfileTopBarTopicStatusButton: RoundButton(defaultTableSmallButton) {
|
||||
radius: 4px;
|
||||
|
||||
@@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "base/timer_rpl.h"
|
||||
#include "base/timer.h"
|
||||
#include "base/unixtime.h"
|
||||
#include "boxes/peers/edit_peer_info_box.h" // EditPeerInfoBox::Available.
|
||||
#include "boxes/moderate_messages_box.h"
|
||||
#include "boxes/report_messages_box.h"
|
||||
#include "boxes/star_gift_box.h"
|
||||
@@ -793,6 +794,20 @@ void TopBar::setupActions(not_null<Window::SessionController*> controller) {
|
||||
if (chechMax()) {
|
||||
return;
|
||||
}
|
||||
if (EditPeerInfoBox::Available(peer)) {
|
||||
const auto manage = Ui::CreateChild<TopBarActionButton>(
|
||||
this,
|
||||
tr::lng_profile_action_short_manage(tr::now),
|
||||
st::infoProfileTopBarActionManage);
|
||||
manage->setClickedCallback([=, window = controller] {
|
||||
window->showEditPeerBox(peer);
|
||||
});
|
||||
buttons.push_back(manage);
|
||||
_actions->add(manage);
|
||||
}
|
||||
if (chechMax()) {
|
||||
return;
|
||||
}
|
||||
{
|
||||
const auto channel = peer->asBroadcast();
|
||||
if (!user && !channel) {
|
||||
|
||||
Reference in New Issue
Block a user