2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Playlist appearance added to the new media player.

Also itemRemoved() now is fired as a global observable.
This commit is contained in:
John Preston
2016-10-14 20:10:15 +03:00
parent 4f0cff5467
commit 31a847fb9d
38 changed files with 677 additions and 271 deletions

View File

@@ -132,6 +132,9 @@ HistoryInner::HistoryInner(HistoryWidget *historyWidget, ScrollArea *scroll, His
notifyIsBotChanged();
setMouseTracking(true);
subscribe(Global::RefItemRemoved(), [this](HistoryItem *item) {
itemRemoved(item);
});
}
void HistoryInner::messagesReceived(PeerData *peer, const QVector<MTPMessage> &messages) {
@@ -969,7 +972,11 @@ void HistoryInner::onDragExec() {
}
void HistoryInner::itemRemoved(HistoryItem *item) {
SelectedItems::iterator i = _selected.find(item);
if (_history != item->history() && _migrated != item->history()) {
return;
}
auto i = _selected.find(item);
if (i != _selected.cend()) {
_selected.erase(i);
_widget->updateTopBarSelection();
@@ -3130,7 +3137,10 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent)
connect(&_updateEditTimeLeftDisplay, SIGNAL(timeout()), this, SLOT(updateField()));
subscribe(Adaptive::Changed(), [this]() { update(); });
subscribe(Adaptive::Changed(), [this] { update(); });
subscribe(Global::RefItemRemoved(), [this](HistoryItem *item) {
itemRemoved(item);
});
}
void HistoryWidget::start() {
@@ -7044,7 +7054,6 @@ void HistoryWidget::resizeEvent(QResizeEvent *e) {
}
void HistoryWidget::itemRemoved(HistoryItem *item) {
if (_list) _list->itemRemoved(item);
if (item == _replyEditMsg) {
if (_editMsgId) {
cancelEdit();