mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
parent
0192edbe84
commit
aa3357eee1
6 changed files with 32 additions and 3 deletions
|
@ -1706,6 +1706,11 @@ void Widget::updateControlsGeometry() {
|
|||
putBottomButton(_updateTelegram);
|
||||
putBottomButton(_downloadBar);
|
||||
putBottomButton(_loadMoreChats);
|
||||
const auto bottomSkip = (height() - scrollTop) - scrollHeight;
|
||||
if (_connecting) {
|
||||
_connecting->setBottomSkip(bottomSkip);
|
||||
}
|
||||
controller()->setConnectingBottomSkip(bottomSkip);
|
||||
auto wasScrollHeight = _scroll->height();
|
||||
_scroll->setGeometry(0, scrollTop, width(), scrollHeight);
|
||||
_inner->resize(width(), _inner->height());
|
||||
|
|
|
@ -391,6 +391,10 @@ void MainWidget::setupConnectingWidget() {
|
|||
this,
|
||||
&session().account(),
|
||||
_controller->adaptive().oneColumnValue() | rpl::map(!_1));
|
||||
_controller->connectingBottomSkipValue(
|
||||
) | rpl::start_with_next([=](int skip) {
|
||||
_connecting->setBottomSkip(skip);
|
||||
}, lifetime());
|
||||
}
|
||||
|
||||
not_null<Media::Player::FloatDelegate*> MainWidget::floatPlayerDelegate() {
|
||||
|
|
|
@ -243,11 +243,12 @@ void ConnectionState::createWidget() {
|
|||
|
||||
rpl::combine(
|
||||
visibility(),
|
||||
_parent->heightValue()
|
||||
) | rpl::start_with_next([=](float64 visible, int height) {
|
||||
_parent->heightValue(),
|
||||
_bottomSkip.value()
|
||||
) | rpl::start_with_next([=](float64 visible, int height, int skip) {
|
||||
_widget->moveToLeft(0, anim::interpolate(
|
||||
height - st::connectingMargin.top(),
|
||||
height - _widget->height(),
|
||||
height - _widget->height() - skip,
|
||||
visible));
|
||||
}, _widget->lifetime());
|
||||
|
||||
|
@ -281,6 +282,10 @@ void ConnectionState::setForceHidden(bool hidden) {
|
|||
}
|
||||
}
|
||||
|
||||
void ConnectionState::setBottomSkip(int skip) {
|
||||
_bottomSkip = skip;
|
||||
}
|
||||
|
||||
void ConnectionState::refreshState() {
|
||||
using Checker = Core::UpdateChecker;
|
||||
const auto state = [&]() -> State {
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
|
||||
void raise();
|
||||
void setForceHidden(bool hidden);
|
||||
void setBottomSkip(int skip);
|
||||
|
||||
rpl::lifetime &lifetime() {
|
||||
return _lifetime;
|
||||
|
@ -78,6 +79,7 @@ private:
|
|||
|
||||
const not_null<Main::Account*> _account;
|
||||
not_null<Ui::RpWidget*> _parent;
|
||||
rpl::variable<int> _bottomSkip;
|
||||
base::unique_qptr<Widget> _widget;
|
||||
bool _forceHidden = false;
|
||||
base::Timer _refreshTimer;
|
||||
|
|
|
@ -1500,6 +1500,14 @@ Window::Adaptive &SessionController::adaptive() const {
|
|||
return _window->adaptive();
|
||||
}
|
||||
|
||||
void SessionController::setConnectingBottomSkip(int skip) {
|
||||
_connectingBottomSkip = skip;
|
||||
}
|
||||
|
||||
rpl::producer<int> SessionController::connectingBottomSkipValue() const {
|
||||
return _connectingBottomSkip.value();
|
||||
}
|
||||
|
||||
QPointer<Ui::BoxContent> SessionController::show(
|
||||
object_ptr<Ui::BoxContent> content,
|
||||
Ui::LayerOptions options,
|
||||
|
|
|
@ -287,6 +287,9 @@ public:
|
|||
return _selectingPeer;
|
||||
}
|
||||
|
||||
void setConnectingBottomSkip(int skip);
|
||||
rpl::producer<int> connectingBottomSkipValue() const;
|
||||
|
||||
QPointer<Ui::BoxContent> show(
|
||||
object_ptr<Ui::BoxContent> content,
|
||||
Ui::LayerOptions options = Ui::LayerOption::KeepOther,
|
||||
|
@ -541,6 +544,8 @@ private:
|
|||
|
||||
rpl::variable<FilterId> _activeChatsFilter;
|
||||
|
||||
rpl::variable<int> _connectingBottomSkip;
|
||||
|
||||
PeerData *_showEditPeer = nullptr;
|
||||
rpl::variable<Data::Folder*> _openedFolder;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue