mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix delete button in shared media selections.
This commit is contained in:
parent
f716041073
commit
300e55e610
1 changed files with 4 additions and 1 deletions
|
@ -403,7 +403,7 @@ void TopBar::updateSelectionState() {
|
||||||
|
|
||||||
_canDelete = computeCanDelete();
|
_canDelete = computeCanDelete();
|
||||||
_selectionText->entity()->setValue(generateSelectedText());
|
_selectionText->entity()->setValue(generateSelectedText());
|
||||||
_delete->entity()->setVisible(_canDelete);
|
_delete->toggle(_canDelete, anim::type::instant);
|
||||||
|
|
||||||
updateSelectionControlsGeometry(width());
|
updateSelectionControlsGeometry(width());
|
||||||
}
|
}
|
||||||
|
@ -446,6 +446,9 @@ void TopBar::createSelectionControls() {
|
||||||
this,
|
this,
|
||||||
object_ptr<Ui::IconButton>(this, _st.mediaDelete),
|
object_ptr<Ui::IconButton>(this, _st.mediaDelete),
|
||||||
st::infoTopBarScale));
|
st::infoTopBarScale));
|
||||||
|
registerToggleControlCallback(
|
||||||
|
_delete.data(),
|
||||||
|
[this] { return selectionMode() && _canDelete; });
|
||||||
_delete->setDuration(st::infoTopBarDuration);
|
_delete->setDuration(st::infoTopBarDuration);
|
||||||
_delete->entity()->addClickHandler([this] { performDelete(); });
|
_delete->entity()->addClickHandler([this] { performDelete(); });
|
||||||
_delete->entity()->setVisible(_canDelete);
|
_delete->entity()->setVisible(_canDelete);
|
||||||
|
|
Loading…
Add table
Reference in a new issue