Force hide pinned message by Ctrl+click
This commit is contained in:
parent
ccc0054227
commit
7da62db8c3
2 changed files with 8 additions and 4 deletions
|
|
@ -5738,7 +5738,11 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() {
|
||||||
_pinnedBar->shadow->show();
|
_pinnedBar->shadow->show();
|
||||||
}
|
}
|
||||||
_pinnedBar->cancel->addClickHandler([=] {
|
_pinnedBar->cancel->addClickHandler([=] {
|
||||||
hidePinnedMessage();
|
if (_pinnedBar->cancel->clickModifiers() & Qt::ControlModifier) {
|
||||||
|
hidePinnedMessage(true);
|
||||||
|
} else {
|
||||||
|
hidePinnedMessage();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
orderWidgets();
|
orderWidgets();
|
||||||
|
|
||||||
|
|
@ -6004,7 +6008,7 @@ void HistoryWidget::unpinDone(const MTPUpdates &updates) {
|
||||||
session().api().applyUpdates(updates);
|
session().api().applyUpdates(updates);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::hidePinnedMessage() {
|
void HistoryWidget::hidePinnedMessage(bool force) {
|
||||||
const auto pinnedId = _peer ? _peer->pinnedMessageId() : MsgId(0);
|
const auto pinnedId = _peer ? _peer->pinnedMessageId() : MsgId(0);
|
||||||
if (!pinnedId) {
|
if (!pinnedId) {
|
||||||
if (pinnedMsgVisibilityUpdated()) {
|
if (pinnedMsgVisibilityUpdated()) {
|
||||||
|
|
@ -6014,7 +6018,7 @@ void HistoryWidget::hidePinnedMessage() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_peer->canPinMessages()) {
|
if (_peer->canPinMessages() && !force) {
|
||||||
unpinMessage(FullMsgId(
|
unpinMessage(FullMsgId(
|
||||||
_peer->isChannel() ? peerToChannel(_peer->id) : NoChannel,
|
_peer->isChannel() ? peerToChannel(_peer->id) : NoChannel,
|
||||||
pinnedId));
|
pinnedId));
|
||||||
|
|
|
||||||
|
|
@ -389,7 +389,7 @@ private:
|
||||||
void toggleMuteUnmute();
|
void toggleMuteUnmute();
|
||||||
void toggleKeyboard(bool manual = true);
|
void toggleKeyboard(bool manual = true);
|
||||||
void startBotCommand();
|
void startBotCommand();
|
||||||
void hidePinnedMessage();
|
void hidePinnedMessage(bool force = false);
|
||||||
void cancelFieldAreaState();
|
void cancelFieldAreaState();
|
||||||
void unblockUser();
|
void unblockUser();
|
||||||
void sendBotStartCommand();
|
void sendBotStartCommand();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue