mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
parent
cd506dfff5
commit
6ccd53689d
1 changed files with 34 additions and 29 deletions
|
@ -649,36 +649,41 @@ void ListWidget::restart() {
|
|||
}
|
||||
|
||||
void ListWidget::itemRemoved(not_null<const HistoryItem*> item) {
|
||||
if (isMyItem(item)) {
|
||||
auto id = GetUniversalId(item);
|
||||
|
||||
auto sectionIt = findSectionByItem(id);
|
||||
if (sectionIt != _sections.end()) {
|
||||
if (sectionIt->removeItem(id)) {
|
||||
auto top = sectionIt->top();
|
||||
if (sectionIt->empty()) {
|
||||
_sections.erase(sectionIt);
|
||||
}
|
||||
refreshHeight();
|
||||
}
|
||||
}
|
||||
|
||||
if (isItemLayout(item, _overLayout)) {
|
||||
_overLayout = nullptr;
|
||||
}
|
||||
|
||||
if (const auto i = _layouts.find(id); i != _layouts.end()) {
|
||||
_heavyLayouts.remove(i->second.item.get());
|
||||
_layouts.erase(i);
|
||||
}
|
||||
_dragSelected.remove(id);
|
||||
|
||||
if (const auto i = _selected.find(id); i != _selected.cend()) {
|
||||
removeItemSelection(i);
|
||||
}
|
||||
|
||||
mouseActionUpdate(_mousePosition);
|
||||
if (!isMyItem(item)) {
|
||||
return;
|
||||
}
|
||||
auto id = GetUniversalId(item);
|
||||
|
||||
auto needHeightRefresh = false;
|
||||
auto sectionIt = findSectionByItem(id);
|
||||
if (sectionIt != _sections.end()) {
|
||||
if (sectionIt->removeItem(id)) {
|
||||
auto top = sectionIt->top();
|
||||
if (sectionIt->empty()) {
|
||||
_sections.erase(sectionIt);
|
||||
}
|
||||
needHeightRefresh = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isItemLayout(item, _overLayout)) {
|
||||
_overLayout = nullptr;
|
||||
}
|
||||
|
||||
if (const auto i = _layouts.find(id); i != _layouts.end()) {
|
||||
_heavyLayouts.remove(i->second.item.get());
|
||||
_layouts.erase(i);
|
||||
}
|
||||
_dragSelected.remove(id);
|
||||
|
||||
if (const auto i = _selected.find(id); i != _selected.cend()) {
|
||||
removeItemSelection(i);
|
||||
}
|
||||
|
||||
if (needHeightRefresh) {
|
||||
refreshHeight();
|
||||
}
|
||||
mouseActionUpdate(_mousePosition);
|
||||
}
|
||||
|
||||
FullMsgId ListWidget::computeFullId(
|
||||
|
|
Loading…
Add table
Reference in a new issue