mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Added report button to action buttons in profile top bar.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<path d="M12,2.833C17.063,2.833 21.167,6.937 21.167,12C21.167,17.063 17.063,21.167 12,21.167C6.937,21.167 2.833,17.063 2.833,12C2.833,6.937 6.937,2.833 12,2.833ZM12,14.444C11.347,14.444 10.813,14.957 10.779,15.602L10.778,15.689C10.778,16.364 11.325,16.911 12,16.911C12.653,16.911 13.187,16.398 13.221,15.754L13.222,15.667C13.222,14.992 12.675,14.444 12,14.444ZM12,7.111C11.404,7.111 10.922,7.594 10.922,8.19L10.922,11.995C10.922,12.591 11.404,13.074 12,13.074C12.596,13.074 13.078,12.591 13.078,11.995L13.078,8.19C13.078,7.594 12.596,7.111 12,7.111Z" fill="#FFFFFF" fill-rule="evenodd"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 680 B |
@@ -1677,6 +1677,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_profile_action_short_discuss" = "Discuss";
|
||||
"lng_profile_action_short_gift" = "Gift";
|
||||
"lng_profile_action_short_join" = "Join";
|
||||
"lng_profile_action_short_report" = "Report";
|
||||
|
||||
"lng_media_type_photos" = "Photos";
|
||||
"lng_media_type_gifs" = "GIFs";
|
||||
|
||||
@@ -417,6 +417,7 @@ infoProfileTopBarActionUnmute: icon{{ "profile/unmute-22x22", premiumButtonFg }}
|
||||
infoProfileTopBarActionCall: icon{{ "profile/call-22x22", premiumButtonFg }};
|
||||
infoProfileTopBarActionGift: icon{{ "profile/gift-22x22", premiumButtonFg }};
|
||||
infoProfileTopBarActionJoin: icon{{ "profile/join-22x22", premiumButtonFg }};
|
||||
infoProfileTopBarActionReport: icon{{ "profile/report-22x22", premiumButtonFg }};
|
||||
|
||||
infoMinimalWidth: 324px;
|
||||
infoDesiredWidth: 392px;
|
||||
|
||||
@@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "base/timer_rpl.h"
|
||||
#include "base/timer.h"
|
||||
#include "base/unixtime.h"
|
||||
#include "boxes/report_messages_box.h"
|
||||
#include "boxes/star_gift_box.h"
|
||||
#include "calls/calls_instance.h"
|
||||
#include "chat_helpers/stickers_lottie.h"
|
||||
@@ -20,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "data/components/recent_shared_media_gifts.h"
|
||||
#include "data/data_changes.h"
|
||||
#include "data/data_channel.h"
|
||||
#include "data/data_chat.h"
|
||||
#include "data/data_document_media.h"
|
||||
#include "data/data_document.h"
|
||||
#include "data/data_emoji_statuses.h"
|
||||
@@ -551,6 +553,20 @@ void TopBar::setupActions(not_null<Controller*> controller) {
|
||||
buttons.push_back(giftButton);
|
||||
}
|
||||
}
|
||||
if (!topic
|
||||
&& ((chat && !chat->amCreator())
|
||||
|| (channel && !channel->amCreator()))) {
|
||||
const auto show = controller->parentController()->uiShow();
|
||||
const auto reportButton = Ui::CreateChild<TopBarActionButton>(
|
||||
this,
|
||||
tr::lng_profile_action_short_report(tr::now),
|
||||
st::infoProfileTopBarActionReport);
|
||||
reportButton->setClickedCallback([=] {
|
||||
ShowReportMessageBox(show, peer, {}, {});
|
||||
});
|
||||
_actions->add(reportButton);
|
||||
buttons.push_back(reportButton);
|
||||
}
|
||||
_edgeColor.value() | rpl::map(mapped) | rpl::start_with_next([=](
|
||||
QColor c) {
|
||||
for (const auto &button : buttons) {
|
||||
|
||||
Reference in New Issue
Block a user