mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
parent
8bb3b7fada
commit
c6f66e83ee
2 changed files with 16 additions and 8 deletions
|
@ -732,6 +732,7 @@ void ComposeControls::showStarted() {
|
||||||
_tabbedPanel->hideFast();
|
_tabbedPanel->hideFast();
|
||||||
}
|
}
|
||||||
_wrap->hide();
|
_wrap->hide();
|
||||||
|
_writeRestricted->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComposeControls::showFinished() {
|
void ComposeControls::showFinished() {
|
||||||
|
@ -741,7 +742,7 @@ void ComposeControls::showFinished() {
|
||||||
if (_tabbedPanel) {
|
if (_tabbedPanel) {
|
||||||
_tabbedPanel->hideFast();
|
_tabbedPanel->hideFast();
|
||||||
}
|
}
|
||||||
_wrap->show();
|
updateWrappingVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComposeControls::showForGrab() {
|
void ComposeControls::showForGrab() {
|
||||||
|
@ -1078,15 +1079,22 @@ void ComposeControls::initWriteRestriction() {
|
||||||
}, _wrap->lifetime());
|
}, _wrap->lifetime());
|
||||||
|
|
||||||
_writeRestriction.value(
|
_writeRestriction.value(
|
||||||
) | rpl::start_with_next([=](const std::optional<QString> &error) {
|
) | rpl::filter([=] {
|
||||||
_writeRestricted->setVisible(error.has_value());
|
return _wrap->isHidden() || _writeRestricted->isHidden();
|
||||||
_wrap->setVisible(!error.has_value());
|
}) | rpl::start_with_next([=] {
|
||||||
if (!error.has_value()) {
|
updateWrappingVisibility();
|
||||||
_wrap->raise();
|
|
||||||
}
|
|
||||||
}, _wrap->lifetime());
|
}, _wrap->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ComposeControls::updateWrappingVisibility() {
|
||||||
|
const auto restricted = _writeRestriction.current().has_value();
|
||||||
|
_writeRestricted->setVisible(restricted);
|
||||||
|
_wrap->setVisible(!restricted);
|
||||||
|
if (!restricted) {
|
||||||
|
_wrap->raise();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ComposeControls::updateSendButtonType() {
|
void ComposeControls::updateSendButtonType() {
|
||||||
using Type = Ui::SendButton::Type;
|
using Type = Ui::SendButton::Type;
|
||||||
const auto type = [&] {
|
const auto type = [&] {
|
||||||
|
|
|
@ -163,6 +163,7 @@ private:
|
||||||
void initWriteRestriction();
|
void initWriteRestriction();
|
||||||
void updateSendButtonType();
|
void updateSendButtonType();
|
||||||
void updateHeight();
|
void updateHeight();
|
||||||
|
void updateWrappingVisibility();
|
||||||
void updateControlsVisibility();
|
void updateControlsVisibility();
|
||||||
void updateControlsGeometry(QSize size);
|
void updateControlsGeometry(QSize size);
|
||||||
void updateOuterGeometry(QRect rect);
|
void updateOuterGeometry(QRect rect);
|
||||||
|
@ -176,7 +177,6 @@ private:
|
||||||
|
|
||||||
void setTextFromEditingMessage(not_null<HistoryItem*> item);
|
void setTextFromEditingMessage(not_null<HistoryItem*> item);
|
||||||
|
|
||||||
void recordError();
|
|
||||||
void recordUpdated(quint16 level, int samples);
|
void recordUpdated(quint16 level, int samples);
|
||||||
void recordDone(QByteArray result, VoiceWaveform waveform, int samples);
|
void recordDone(QByteArray result, VoiceWaveform waveform, int samples);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue