From 300e55e610fda6cb77c181563de5af27f8e52ff9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 28 Nov 2017 19:16:28 +0400 Subject: [PATCH] Fix delete button in shared media selections. --- Telegram/SourceFiles/info/info_top_bar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/info/info_top_bar.cpp b/Telegram/SourceFiles/info/info_top_bar.cpp index 026c7213c..6d1ff625f 100644 --- a/Telegram/SourceFiles/info/info_top_bar.cpp +++ b/Telegram/SourceFiles/info/info_top_bar.cpp @@ -403,7 +403,7 @@ void TopBar::updateSelectionState() { _canDelete = computeCanDelete(); _selectionText->entity()->setValue(generateSelectedText()); - _delete->entity()->setVisible(_canDelete); + _delete->toggle(_canDelete, anim::type::instant); updateSelectionControlsGeometry(width()); } @@ -446,6 +446,9 @@ void TopBar::createSelectionControls() { this, object_ptr(this, _st.mediaDelete), st::infoTopBarScale)); + registerToggleControlCallback( + _delete.data(), + [this] { return selectionMode() && _canDelete; }); _delete->setDuration(st::infoTopBarDuration); _delete->entity()->addClickHandler([this] { performDelete(); }); _delete->entity()->setVisible(_canDelete);