mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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;
|
return false;
|
||||||
}
|
}
|
||||||
_replaceMedia.create(this, st::historyReplaceMedia);
|
_replaceMedia.create(this, st::historyReplaceMedia);
|
||||||
|
const auto hideDuration = st::historyReplaceMedia.ripple.hideDuration;
|
||||||
_replaceMedia->setClickedCallback([=] {
|
_replaceMedia->setClickedCallback([=] {
|
||||||
EditCaptionBox::StartMediaReplace(
|
base::call_delayed(hideDuration, this, [=] {
|
||||||
controller(),
|
EditCaptionBox::StartMediaReplace(
|
||||||
{ _history->peer->id, _editMsgId },
|
controller(),
|
||||||
_field->getTextWithTags(),
|
{ _history->peer->id, _editMsgId },
|
||||||
crl::guard(_list, [=] { cancelEdit(); }));
|
_field->getTextWithTags(),
|
||||||
|
crl::guard(_list, [=] { cancelEdit(); }));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include "history/view/controls/history_view_compose_controls.h"
|
#include "history/view/controls/history_view_compose_controls.h"
|
||||||
|
|
||||||
|
#include "base/call_delayed.h"
|
||||||
#include "base/event_filter.h"
|
#include "base/event_filter.h"
|
||||||
#include "base/platform/base_platform_info.h"
|
#include "base/platform/base_platform_info.h"
|
||||||
#include "base/qt_signal_producer.h"
|
#include "base/qt_signal_producer.h"
|
||||||
|
@ -2692,12 +2693,15 @@ bool ComposeControls::updateReplaceMediaButton() {
|
||||||
_replaceMedia = std::make_unique<Ui::IconButton>(
|
_replaceMedia = std::make_unique<Ui::IconButton>(
|
||||||
_wrap.get(),
|
_wrap.get(),
|
||||||
st::historyReplaceMedia);
|
st::historyReplaceMedia);
|
||||||
|
const auto hideDuration = st::historyReplaceMedia.ripple.hideDuration;
|
||||||
_replaceMedia->setClickedCallback([=] {
|
_replaceMedia->setClickedCallback([=] {
|
||||||
EditCaptionBox::StartMediaReplace(
|
base::call_delayed(hideDuration, _wrap.get(), [=] {
|
||||||
_regularWindow,
|
EditCaptionBox::StartMediaReplace(
|
||||||
_editingId,
|
_regularWindow,
|
||||||
_field->getTextWithTags(),
|
_editingId,
|
||||||
crl::guard(_wrap.get(), [=] { cancelEditMessage(); }));
|
_field->getTextWithTags(),
|
||||||
|
crl::guard(_wrap.get(), [=] { cancelEditMessage(); }));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue