mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
chore: hide annoying gift button
This commit is contained in:
parent
451940e6a7
commit
ee0238bad8
2 changed files with 8 additions and 2 deletions
|
@ -1090,15 +1090,19 @@ void HistoryWidget::refreshJoinChannelText() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::refreshGiftToChannelShown() {
|
void HistoryWidget::refreshGiftToChannelShown() {
|
||||||
if (!_giftToChannelIn || !_giftToChannelOut) {
|
if (!_giftToChannelIn || !_giftToChannelOut || !_giftToChannelDiscuss) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// AyuGram: hide gift button almost everywhere
|
||||||
|
// still accessible via the menu in peer window
|
||||||
const auto channel = _peer->asChannel();
|
const auto channel = _peer->asChannel();
|
||||||
const auto shown = channel
|
const auto shown = channel
|
||||||
&& channel->isBroadcast()
|
&& channel->isBroadcast()
|
||||||
&& channel->stargiftsAvailable();
|
&& channel->stargiftsAvailable()
|
||||||
|
&& isExteraPeer(getBareID(channel));
|
||||||
_giftToChannelIn->setVisible(shown);
|
_giftToChannelIn->setVisible(shown);
|
||||||
_giftToChannelOut->setVisible(shown);
|
_giftToChannelOut->setVisible(shown);
|
||||||
|
_giftToChannelDiscuss->setVisible(shown);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::refreshTopBarActiveChat() {
|
void HistoryWidget::refreshTopBarActiveChat() {
|
||||||
|
@ -2144,6 +2148,7 @@ void HistoryWidget::setupGiftToChannelButton() {
|
||||||
};
|
};
|
||||||
_giftToChannelIn = setupButton(_muteUnmute);
|
_giftToChannelIn = setupButton(_muteUnmute);
|
||||||
_giftToChannelOut = setupButton(_joinChannel);
|
_giftToChannelOut = setupButton(_joinChannel);
|
||||||
|
_giftToChannelDiscuss = setupButton(_discuss);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::pushReplyReturn(not_null<HistoryItem*> item) {
|
void HistoryWidget::pushReplyReturn(not_null<HistoryItem*> item) {
|
||||||
|
|
|
@ -781,6 +781,7 @@ private:
|
||||||
object_ptr<Ui::FlatButton> _muteUnmute;
|
object_ptr<Ui::FlatButton> _muteUnmute;
|
||||||
QPointer<Ui::IconButton> _giftToChannelIn;
|
QPointer<Ui::IconButton> _giftToChannelIn;
|
||||||
QPointer<Ui::IconButton> _giftToChannelOut;
|
QPointer<Ui::IconButton> _giftToChannelOut;
|
||||||
|
QPointer<Ui::IconButton> _giftToChannelDiscuss;
|
||||||
object_ptr<Ui::FlatButton> _discuss;
|
object_ptr<Ui::FlatButton> _discuss;
|
||||||
object_ptr<Ui::FlatButton> _reportMessages;
|
object_ptr<Ui::FlatButton> _reportMessages;
|
||||||
struct {
|
struct {
|
||||||
|
|
Loading…
Add table
Reference in a new issue