mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
parent
0ce7e402ed
commit
b96e09534d
2 changed files with 20 additions and 9 deletions
|
@ -30,7 +30,8 @@ Blocked::Blocked(
|
|||
QWidget *parent,
|
||||
not_null<Window::SessionController*> controller)
|
||||
: Section(parent)
|
||||
, _controller(controller) {
|
||||
, _controller(controller)
|
||||
, _container(Ui::CreateChild<Ui::VerticalLayout>(this)) {
|
||||
|
||||
setupContent();
|
||||
|
||||
|
@ -117,12 +118,11 @@ QPointer<Ui::RpWidget> Blocked::createPinnedToTop(not_null<QWidget*> parent) {
|
|||
|
||||
void Blocked::setupContent() {
|
||||
using namespace rpl::mappers;
|
||||
const auto container = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||
|
||||
const auto listWrap = container->add(
|
||||
const auto listWrap = _container->add(
|
||||
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
||||
container,
|
||||
object_ptr<Ui::VerticalLayout>(container)));
|
||||
_container,
|
||||
object_ptr<Ui::VerticalLayout>(_container)));
|
||||
listWrap->toggleOn(
|
||||
_emptinessChanges.events_starting_with(true) | rpl::map(!_1),
|
||||
anim::type::instant);
|
||||
|
@ -152,10 +152,10 @@ void Blocked::setupContent() {
|
|||
_countBlocked = content->fullRowsCount();
|
||||
}
|
||||
|
||||
const auto emptyWrap = container->add(
|
||||
const auto emptyWrap = _container->add(
|
||||
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
|
||||
container,
|
||||
object_ptr<Ui::VerticalLayout>(container)));
|
||||
_container,
|
||||
object_ptr<Ui::VerticalLayout>(_container)));
|
||||
emptyWrap->toggleOn(
|
||||
_emptinessChanges.events_starting_with(false),
|
||||
anim::type::instant);
|
||||
|
@ -200,7 +200,7 @@ void Blocked::setupContent() {
|
|||
AddSkip(content, st::blockedUsersListIconPadding.top());
|
||||
}
|
||||
|
||||
Ui::ResizeFitChild(this, container);
|
||||
Ui::ResizeFitChild(this, _container);
|
||||
}
|
||||
|
||||
void Blocked::checkTotal(int total) {
|
||||
|
@ -208,6 +208,10 @@ void Blocked::checkTotal(int total) {
|
|||
_emptinessChanges.fire(total <= 0);
|
||||
}
|
||||
|
||||
void Blocked::visibleTopBottomUpdated(int visibleTop, int visibleBottom) {
|
||||
setChildVisibleTopBottom(_container, visibleTop, visibleBottom);
|
||||
}
|
||||
|
||||
void Blocked::showFinished() {
|
||||
_showFinished.fire({});
|
||||
}
|
||||
|
|
|
@ -9,6 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "settings/settings_common.h"
|
||||
|
||||
namespace Ui {
|
||||
class VerticalLayout;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Window {
|
||||
class Controller;
|
||||
} // namespace Window
|
||||
|
@ -32,7 +36,10 @@ private:
|
|||
void setupContent();
|
||||
void checkTotal(int total);
|
||||
|
||||
void visibleTopBottomUpdated(int visibleTop, int visibleBottom) override;
|
||||
|
||||
const not_null<Window::SessionController*> _controller;
|
||||
const not_null<Ui::VerticalLayout*> _container;
|
||||
|
||||
base::unique_qptr<Ui::RpWidget> _loading;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue