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