mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fix drag area in comments appearance.
This commit is contained in:
parent
bb900c195c
commit
3573b84e8b
2 changed files with 20 additions and 2 deletions
|
@ -511,7 +511,16 @@ HistoryWidget::HistoryWidget(
|
|||
_attachDragAreas = DragArea::SetupDragAreaToContainer(
|
||||
this,
|
||||
crl::guard(this, [=](not_null<const QMimeData*> d) {
|
||||
return _history && _canSendMessages && !isRecording();
|
||||
if (!_peer || isRecording()) {
|
||||
return false;
|
||||
}
|
||||
const auto replyTo = (_replyToId && !_editMsgId)
|
||||
? _replyEditMsg
|
||||
: 0;
|
||||
const auto topic = replyTo ? replyTo->topic() : nullptr;
|
||||
return topic
|
||||
? Data::CanSendAnyOf(topic, Data::FilesSendRestrictions())
|
||||
: Data::CanSendAnyOf(_peer, Data::FilesSendRestrictions());
|
||||
}),
|
||||
crl::guard(this, [=](bool f) { _field->setAcceptDrops(f); }),
|
||||
crl::guard(this, [=] { updateControlsGeometry(); }));
|
||||
|
|
|
@ -2616,9 +2616,18 @@ void RepliesWidget::clearSelected() {
|
|||
}
|
||||
|
||||
void RepliesWidget::setupDragArea() {
|
||||
const auto filter = [=](const auto &d) {
|
||||
if (!_history || _composeControls->isRecording()) {
|
||||
return false;
|
||||
}
|
||||
const auto peer = _history->peer;
|
||||
return _topic
|
||||
? Data::CanSendAnyOf(_topic, Data::FilesSendRestrictions())
|
||||
: Data::CanSendAnyOf(peer, Data::FilesSendRestrictions());
|
||||
};
|
||||
const auto areas = DragArea::SetupDragAreaToContainer(
|
||||
this,
|
||||
[=](auto d) { return _history && !_composeControls->isRecording(); },
|
||||
filter,
|
||||
nullptr,
|
||||
[=] { updateControlsGeometry(); });
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue