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

multi select in media overview done properly

This commit is contained in:
John Preston
2014-08-20 23:13:00 +04:00
parent dfb4d01015
commit db7fa9ba2f
10 changed files with 127 additions and 59 deletions

View File

@@ -242,18 +242,7 @@ void AddParticipantInner::chooseParticipant() {
changeCheckState(row);
PeerData *peer = row->history->peer;
updateFilter();
for (_sel = _contacts->list.begin; _sel != _contacts->list.end; _sel = _sel->next) {
if (_sel->history->peer == peer) {
break;
}
}
if (_sel == _contacts->list.end) {
_sel = 0;
} else {
emit mustScrollTo(_sel->pos * rh, (_sel->pos + 1) * rh);
}
emit selectAllQuery();
}
parentWidget()->update();
}
@@ -530,6 +519,7 @@ AddParticipantBox::AddParticipantBox(ChatData *chat) :
connect(&_filter, SIGNAL(changed()), this, SLOT(onFilterUpdate()));
connect(&_filter, SIGNAL(cancelled()), this, SIGNAL(onClose()));
connect(&_inner, SIGNAL(mustScrollTo(int,int)), &_scroll, SLOT(scrollToY(int,int)));
connect(&_inner, SIGNAL(selectAllQuery()), &_filter, SLOT(selectAll()));
showAll();
_cache = myGrab(this, rect());

View File

@@ -50,6 +50,7 @@ public:
signals:
void mustScrollTo(int ymin, int ymax);
void selectAllQuery();
public slots:

View File

@@ -233,18 +233,7 @@ void NewGroupInner::chooseParticipant() {
changeCheckState(row);
PeerData *peer = row->history->peer;
updateFilter();
for (_sel = _contacts->list.begin; _sel != _contacts->list.end; _sel = _sel->next) {
if (_sel->history->peer == peer) {
break;
}
}
if (_sel == _contacts->list.end) {
_sel = 0;
} else {
emit mustScrollTo(_sel->pos * rh, (_sel->pos + 1) * rh);
}
emit selectAllQuery();
}
parentWidget()->update();
@@ -469,6 +458,7 @@ NewGroupBox::NewGroupBox() : _scroll(this, st::newGroupScroll), _inner(),
connect(&_filter, SIGNAL(changed()), this, SLOT(onFilterUpdate()));
connect(&_filter, SIGNAL(cancelled()), this, SIGNAL(onClose()));
connect(&_inner, SIGNAL(mustScrollTo(int,int)), &_scroll, SLOT(scrollToY(int,int)));
connect(&_inner, SIGNAL(selectAllQuery()), &_filter, SLOT(selectAll()));
showAll();
_cache = myGrab(this, rect());

View File

@@ -50,6 +50,7 @@ public:
signals:
void mustScrollTo(int ymin, int ymax);
void selectAllQuery();
public slots: