Disabled drag'n'drop area when user is recording voice message.
This commit is contained in:
parent
ad4bf9b5c8
commit
57eb4f8234
|
@ -368,7 +368,7 @@ HistoryWidget::HistoryWidget(
|
|||
_attachDragAreas = DragArea::SetupDragAreaToContainer(
|
||||
this,
|
||||
crl::guard(this, [=](not_null<const QMimeData*> d) {
|
||||
return _history && _canSendMessages;
|
||||
return _history && _canSendMessages && !isRecording();
|
||||
}),
|
||||
crl::guard(this, [=](bool f) { _field->setAcceptDrops(f); }),
|
||||
crl::guard(this, [=] { updateControlsGeometry(); }));
|
||||
|
|
|
@ -580,7 +580,7 @@ int ComposeControls::heightCurrent() const {
|
|||
}
|
||||
|
||||
bool ComposeControls::focus() {
|
||||
if (_voiceRecordBar->isRecording()) {
|
||||
if (isRecording()) {
|
||||
return false;
|
||||
}
|
||||
_field->setFocus();
|
||||
|
@ -1345,4 +1345,8 @@ rpl::producer<bool> ComposeControls::lockShowStarts() const {
|
|||
return _voiceRecordBar->lockShowStarts();
|
||||
}
|
||||
|
||||
bool ComposeControls::isRecording() const {
|
||||
return _voiceRecordBar->isRecording();
|
||||
}
|
||||
|
||||
} // namespace HistoryView
|
||||
|
|
|
@ -137,6 +137,7 @@ public:
|
|||
|
||||
[[nodiscard]] rpl::producer<bool> lockShowStarts() const;
|
||||
[[nodiscard]] bool isLockPresent() const;
|
||||
[[nodiscard]] bool isRecording() const;
|
||||
|
||||
private:
|
||||
enum class TextUpdateEvent {
|
||||
|
|
|
@ -1761,7 +1761,7 @@ void RepliesWidget::clearSelected() {
|
|||
void RepliesWidget::setupDragArea() {
|
||||
const auto areas = DragArea::SetupDragAreaToContainer(
|
||||
this,
|
||||
[=](not_null<const QMimeData*> d) { return _history; },
|
||||
[=](auto d) { return _history && !_composeControls->isRecording(); },
|
||||
nullptr,
|
||||
[=] { updateControlsGeometry(); });
|
||||
|
||||
|
|
|
@ -1188,7 +1188,7 @@ void ScheduledWidget::clearSelected() {
|
|||
void ScheduledWidget::setupDragArea() {
|
||||
const auto areas = DragArea::SetupDragAreaToContainer(
|
||||
this,
|
||||
[=](not_null<const QMimeData*> d) { return _history; },
|
||||
[=](auto d) { return _history && !_composeControls->isRecording(); },
|
||||
nullptr,
|
||||
[=] { updateControlsGeometry(); });
|
||||
|
||||
|
|
Loading…
Reference in New Issue