Removed left button from short info box with self.

This commit is contained in:
23rd 2023-07-24 22:15:51 +03:00
parent 16117e56bb
commit 9a72b05117
3 changed files with 14 additions and 7 deletions

View File

@ -685,12 +685,16 @@ rpl::producer<int> PeerShortInfoBox::moveRequests() const {
void PeerShortInfoBox::prepare() {
addButton(tr::lng_close(), [=] { closeBox(); });
// Perhaps a new lang key should be added for opening a group.
addLeftButton((_type == PeerShortInfoType::User)
? tr::lng_profile_send_message()
: (_type == PeerShortInfoType::Group)
? tr::lng_view_button_group()
: tr::lng_profile_view_channel(), [=] { _openRequests.fire({}); });
if (_type != PeerShortInfoType::Self) {
// Perhaps a new lang key should be added for opening a group.
addLeftButton(
(_type == PeerShortInfoType::User)
? tr::lng_profile_send_message()
: (_type == PeerShortInfoType::Group)
? tr::lng_view_button_group()
: tr::lng_profile_view_channel(),
[=] { _openRequests.fire({}); });
}
prepareRows();

View File

@ -28,6 +28,7 @@ class RpWidget;
} // namespace Ui
enum class PeerShortInfoType {
Self,
User,
Group,
Channel,

View File

@ -431,7 +431,9 @@ object_ptr<Ui::BoxContent> PrepareShortInfoBox(
Fn<void()> open,
Fn<bool()> videoPaused,
const style::ShortInfoBox *stOverride) {
const auto type = peer->isUser()
const auto type = peer->isSelf()
? PeerShortInfoType::Self
: peer->isUser()
? PeerShortInfoType::User
: peer->isBroadcast()
? PeerShortInfoType::Channel