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