mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Added delay to button for media replacement in compose control.
This commit is contained in:
parent
b017cc07ce
commit
40ff71b2cd
2 changed files with 17 additions and 10 deletions
|
@ -2600,12 +2600,15 @@ bool HistoryWidget::updateReplaceMediaButton() {
|
|||
return false;
|
||||
}
|
||||
_replaceMedia.create(this, st::historyReplaceMedia);
|
||||
const auto hideDuration = st::historyReplaceMedia.ripple.hideDuration;
|
||||
_replaceMedia->setClickedCallback([=] {
|
||||
EditCaptionBox::StartMediaReplace(
|
||||
controller(),
|
||||
{ _history->peer->id, _editMsgId },
|
||||
_field->getTextWithTags(),
|
||||
crl::guard(_list, [=] { cancelEdit(); }));
|
||||
base::call_delayed(hideDuration, this, [=] {
|
||||
EditCaptionBox::StartMediaReplace(
|
||||
controller(),
|
||||
{ _history->peer->id, _editMsgId },
|
||||
_field->getTextWithTags(),
|
||||
crl::guard(_list, [=] { cancelEdit(); }));
|
||||
});
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#include "history/view/controls/history_view_compose_controls.h"
|
||||
|
||||
#include "base/call_delayed.h"
|
||||
#include "base/event_filter.h"
|
||||
#include "base/platform/base_platform_info.h"
|
||||
#include "base/qt_signal_producer.h"
|
||||
|
@ -2692,12 +2693,15 @@ bool ComposeControls::updateReplaceMediaButton() {
|
|||
_replaceMedia = std::make_unique<Ui::IconButton>(
|
||||
_wrap.get(),
|
||||
st::historyReplaceMedia);
|
||||
const auto hideDuration = st::historyReplaceMedia.ripple.hideDuration;
|
||||
_replaceMedia->setClickedCallback([=] {
|
||||
EditCaptionBox::StartMediaReplace(
|
||||
_regularWindow,
|
||||
_editingId,
|
||||
_field->getTextWithTags(),
|
||||
crl::guard(_wrap.get(), [=] { cancelEditMessage(); }));
|
||||
base::call_delayed(hideDuration, _wrap.get(), [=] {
|
||||
EditCaptionBox::StartMediaReplace(
|
||||
_regularWindow,
|
||||
_editingId,
|
||||
_field->getTextWithTags(),
|
||||
crl::guard(_wrap.get(), [=] { cancelEditMessage(); }));
|
||||
});
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue