mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-12 06:33:59 +00:00
Hide Expand button while editing a media caption
This commit is contained in:
@@ -2790,6 +2790,7 @@ bool HistoryWidget::applyDraft(FieldHistoryAction fieldHistoryAction) {
|
||||
if (!_replyEditMsg) {
|
||||
requestMessageData(_editMsgId);
|
||||
}
|
||||
updateExpandButtonVisibility();
|
||||
if (editDraft && editDraft->suggest) {
|
||||
using namespace HistoryView;
|
||||
applySuggestOptions(editDraft->suggest, SuggestMode::Change);
|
||||
@@ -7062,6 +7063,10 @@ void HistoryWidget::updateExpandButtonVisibility() {
|
||||
|| _voiceRecordBar->isActive()
|
||||
|| !hasEnoughLinesForExpand()
|
||||
|| (textExceedsMaxSize() && !editingMessage())
|
||||
|| (_editMsgId
|
||||
&& _replyEditMsg
|
||||
&& _replyEditMsg->media()
|
||||
&& !_replyEditMsg->media()->webpage())
|
||||
|| !Iv::Editor::CanAuthorRichMessages(&session());
|
||||
if (_expand->isHidden() != hidden) {
|
||||
_expand->setVisible(!hidden);
|
||||
|
||||
@@ -4159,11 +4159,16 @@ void ComposeControls::updateAiButtonVisibility() {
|
||||
}
|
||||
|
||||
void ComposeControls::updateExpandButtonVisibility() {
|
||||
const auto item = (_history && isEditingMessage())
|
||||
? _history->owner().message(_header->editMsgId())
|
||||
: nullptr;
|
||||
const auto media = item ? item->media() : nullptr;
|
||||
const auto hidden = !_wrap->isVisible()
|
||||
|| _recording.current()
|
||||
|| !_field->isVisible()
|
||||
|| !hasEnoughLinesForExpand()
|
||||
|| textExceedsMaxSize()
|
||||
|| (media && !media->webpage())
|
||||
|| !Iv::Editor::CanAuthorRichMessages(&_show->session());
|
||||
if (_expand->isHidden() != hidden) {
|
||||
_expand->setVisible(!hidden);
|
||||
|
||||
Reference in New Issue
Block a user