mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-08 08:04:08 +02:00
Disabled drag'n'drop area when user is recording voice message.
This commit is contained in:
parent
ad4bf9b5c8
commit
57eb4f8234
5 changed files with 9 additions and 4 deletions
|
@ -368,7 +368,7 @@ HistoryWidget::HistoryWidget(
|
||||||
_attachDragAreas = DragArea::SetupDragAreaToContainer(
|
_attachDragAreas = DragArea::SetupDragAreaToContainer(
|
||||||
this,
|
this,
|
||||||
crl::guard(this, [=](not_null<const QMimeData*> d) {
|
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, [=](bool f) { _field->setAcceptDrops(f); }),
|
||||||
crl::guard(this, [=] { updateControlsGeometry(); }));
|
crl::guard(this, [=] { updateControlsGeometry(); }));
|
||||||
|
|
|
@ -580,7 +580,7 @@ int ComposeControls::heightCurrent() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ComposeControls::focus() {
|
bool ComposeControls::focus() {
|
||||||
if (_voiceRecordBar->isRecording()) {
|
if (isRecording()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_field->setFocus();
|
_field->setFocus();
|
||||||
|
@ -1345,4 +1345,8 @@ rpl::producer<bool> ComposeControls::lockShowStarts() const {
|
||||||
return _voiceRecordBar->lockShowStarts();
|
return _voiceRecordBar->lockShowStarts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ComposeControls::isRecording() const {
|
||||||
|
return _voiceRecordBar->isRecording();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace HistoryView
|
} // namespace HistoryView
|
||||||
|
|
|
@ -137,6 +137,7 @@ public:
|
||||||
|
|
||||||
[[nodiscard]] rpl::producer<bool> lockShowStarts() const;
|
[[nodiscard]] rpl::producer<bool> lockShowStarts() const;
|
||||||
[[nodiscard]] bool isLockPresent() const;
|
[[nodiscard]] bool isLockPresent() const;
|
||||||
|
[[nodiscard]] bool isRecording() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum class TextUpdateEvent {
|
enum class TextUpdateEvent {
|
||||||
|
|
|
@ -1761,7 +1761,7 @@ void RepliesWidget::clearSelected() {
|
||||||
void RepliesWidget::setupDragArea() {
|
void RepliesWidget::setupDragArea() {
|
||||||
const auto areas = DragArea::SetupDragAreaToContainer(
|
const auto areas = DragArea::SetupDragAreaToContainer(
|
||||||
this,
|
this,
|
||||||
[=](not_null<const QMimeData*> d) { return _history; },
|
[=](auto d) { return _history && !_composeControls->isRecording(); },
|
||||||
nullptr,
|
nullptr,
|
||||||
[=] { updateControlsGeometry(); });
|
[=] { updateControlsGeometry(); });
|
||||||
|
|
||||||
|
|
|
@ -1188,7 +1188,7 @@ void ScheduledWidget::clearSelected() {
|
||||||
void ScheduledWidget::setupDragArea() {
|
void ScheduledWidget::setupDragArea() {
|
||||||
const auto areas = DragArea::SetupDragAreaToContainer(
|
const auto areas = DragArea::SetupDragAreaToContainer(
|
||||||
this,
|
this,
|
||||||
[=](not_null<const QMimeData*> d) { return _history; },
|
[=](auto d) { return _history && !_composeControls->isRecording(); },
|
||||||
nullptr,
|
nullptr,
|
||||||
[=] { updateControlsGeometry(); });
|
[=] { updateControlsGeometry(); });
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue