mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Removed left button from short info box with self.
This commit is contained in:
parent
16117e56bb
commit
9a72b05117
3 changed files with 14 additions and 7 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ class RpWidget;
|
|||
} // namespace Ui
|
||||
|
||||
enum class PeerShortInfoType {
|
||||
Self,
|
||||
User,
|
||||
Group,
|
||||
Channel,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue