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

Add TabbedSection which uses the TabbedSelector.

This commit is contained in:
John Preston
2017-04-09 21:06:06 +03:00
parent 647ea44881
commit 891d200e2d
33 changed files with 713 additions and 405 deletions

View File

@@ -74,7 +74,8 @@ struct DialogsInner::PeerSearchResult {
Dialogs::RippleRow row;
};
DialogsInner::DialogsInner(QWidget *parent, QWidget *main) : SplittedWidget(parent)
DialogsInner::DialogsInner(QWidget *parent, gsl::not_null<Window::Controller*> controller, QWidget *main) : SplittedWidget(parent)
, _controller(controller)
, _dialogs(std::make_unique<Dialogs::IndexedList>(Dialogs::SortMode::Date))
, _contactsNoDialogs(std::make_unique<Dialogs::IndexedList>(Dialogs::SortMode::Name))
, _contacts(std::make_unique<Dialogs::IndexedList>(Dialogs::SortMode::Name))
@@ -1674,7 +1675,7 @@ void DialogsInner::refresh(bool toTop) {
emit mustScrollTo(0, 0);
loadPeerPhotos();
}
Global::RefDialogsListDisplayForced().set(_searchInPeer || !_filter.isEmpty(), true);
_controller->dialogsListDisplayForced().set(_searchInPeer || !_filter.isEmpty(), true);
update();
}
@@ -1722,7 +1723,7 @@ void DialogsInner::searchInPeer(PeerData *peer) {
} else {
_cancelSearchInPeer->hide();
}
Global::RefDialogsListDisplayForced().set(_searchInPeer || !_filter.isEmpty(), true);
_controller->dialogsListDisplayForced().set(_searchInPeer || !_filter.isEmpty(), true);
}
void DialogsInner::clearFilter() {
@@ -2274,7 +2275,7 @@ DialogsWidget::DialogsWidget(QWidget *parent, gsl::not_null<Window::Controller*>
, _cancelSearch(this, st::dialogsCancelSearch)
, _lockUnlock(this, st::dialogsLock)
, _scroll(this, st::dialogsScroll) {
_inner = _scroll->setOwnedWidget(object_ptr<DialogsInner>(this, parent));
_inner = _scroll->setOwnedWidget(object_ptr<DialogsInner>(this, _controller, parent));
connect(_inner, SIGNAL(draggingScrollDelta(int)), this, SLOT(onDraggingScrollDelta(int)));
connect(_inner, SIGNAL(mustScrollTo(int,int)), _scroll, SLOT(scrollToY(int,int)));
connect(_inner, SIGNAL(dialogMoved(int,int)), this, SLOT(onDialogMoved(int,int)));