Removed display of right buttons in message field while editing message.

This commit is contained in:
23rd 2023-07-24 17:14:15 +03:00
parent 4e109e0517
commit 39f494eadd
3 changed files with 34 additions and 10 deletions

View File

@ -2852,10 +2852,10 @@ void HistoryWidget::updateControlsVisibility() {
_silent->setVisible(!_editMsgId);
}
if (_scheduled) {
_scheduled->show();
_scheduled->setVisible(!_editMsgId);
}
if (_ttlInfo) {
_ttlInfo->show();
_ttlInfo->setVisible(!_editMsgId);
}
if (_sendAs) {
_sendAs->show();
@ -5010,19 +5010,33 @@ void HistoryWidget::moveFieldControls() {
}
void HistoryWidget::updateFieldSize() {
auto kbShowShown = _history && !_kbShown && _keyboard->hasMarkup();
const auto kbShowShown = _history && !_kbShown && _keyboard->hasMarkup();
auto fieldWidth = width()
- _attachToggle->width()
- st::historySendRight
- _send->width()
- _tabbedSelectorToggle->width();
if (_botMenuButton) fieldWidth -= st::historyBotMenuSkip + _botMenuButton->width();
if (_sendAs) fieldWidth -= _sendAs->width();
if (kbShowShown) fieldWidth -= _botKeyboardShow->width();
if (_cmdStartShown) fieldWidth -= _botCommandStart->width();
if (_silent && !_silent->isHidden()) fieldWidth -= _silent->width();
if (_scheduled) fieldWidth -= _scheduled->width();
if (_ttlInfo) fieldWidth -= _ttlInfo->width();
if (_botMenuButton) {
fieldWidth -= st::historyBotMenuSkip + _botMenuButton->width();
}
if (_sendAs) {
fieldWidth -= _sendAs->width();
}
if (kbShowShown) {
fieldWidth -= _botKeyboardShow->width();
}
if (_cmdStartShown) {
fieldWidth -= _botCommandStart->width();
}
if (_silent && _silent->isVisible()) {
fieldWidth -= _silent->width();
}
if (_scheduled && _scheduled->isVisible()) {
fieldWidth -= _scheduled->width();
}
if (_ttlInfo && _ttlInfo->isVisible()) {
fieldWidth -= _ttlInfo->width();
}
if (_fieldDisabled) {
_fieldDisabled->resize(fieldWidth, fieldHeight());

View File

@ -50,6 +50,14 @@ void TTLButton::hide() {
_button.hide();
}
void TTLButton::setVisible(bool visible) {
_button.setVisible(visible);
}
bool TTLButton::isVisible() const {
return _button.isVisible();
}
void TTLButton::move(int x, int y) {
_button.move(x, y);
}

View File

@ -28,6 +28,8 @@ public:
void show();
void hide();
void setVisible(bool visible);
[[nodiscard]] bool isVisible() const;
void move(int x, int y);
[[nodiscard]] int width() const;