mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Don't duplicate Update Telegram / Download Bar.
This commit is contained in:
parent
1ff53eb585
commit
c200263f2e
1 changed files with 46 additions and 20 deletions
|
@ -397,11 +397,12 @@ Widget::Widget(
|
||||||
|
|
||||||
updateJumpToDateVisibility(true);
|
updateJumpToDateVisibility(true);
|
||||||
updateSearchFromVisibility(true);
|
updateSearchFromVisibility(true);
|
||||||
setupConnectingWidget();
|
|
||||||
setupSupportMode();
|
setupSupportMode();
|
||||||
setupScrollUpButton();
|
setupScrollUpButton();
|
||||||
|
|
||||||
if (_layout != Layout::Child) {
|
if (_layout != Layout::Child) {
|
||||||
|
setupConnectingWidget();
|
||||||
|
|
||||||
changeOpenedFolder(
|
changeOpenedFolder(
|
||||||
controller->openedFolder().current(),
|
controller->openedFolder().current(),
|
||||||
anim::type::instant);
|
anim::type::instant);
|
||||||
|
@ -424,9 +425,9 @@ Widget::Widget(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
}
|
|
||||||
|
|
||||||
setupDownloadBar();
|
setupDownloadBar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::chosenRow(const ChosenRow &row) {
|
void Widget::chosenRow(const ChosenRow &row) {
|
||||||
|
@ -540,6 +541,10 @@ void Widget::setupScrollUpButton() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::setupDownloadBar() {
|
void Widget::setupDownloadBar() {
|
||||||
|
if (_layout == Layout::Child) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Data::MakeDownloadBarContent(
|
Data::MakeDownloadBarContent(
|
||||||
) | rpl::start_with_next([=](Ui::DownloadBarContent &&content) {
|
) | rpl::start_with_next([=](Ui::DownloadBarContent &&content) {
|
||||||
const auto create = (content.count && !_downloadBar);
|
const auto create = (content.count && !_downloadBar);
|
||||||
|
@ -745,7 +750,9 @@ void Widget::updateControlsVisibility(bool fast) {
|
||||||
updateJumpToDateVisibility(fast);
|
updateJumpToDateVisibility(fast);
|
||||||
updateSearchFromVisibility(fast);
|
updateSearchFromVisibility(fast);
|
||||||
}
|
}
|
||||||
_connecting->setForceHidden(false);
|
if (_connecting) {
|
||||||
|
_connecting->setForceHidden(false);
|
||||||
|
}
|
||||||
if (_childList) {
|
if (_childList) {
|
||||||
_childList->show();
|
_childList->show();
|
||||||
_childListShadow->show();
|
_childListShadow->show();
|
||||||
|
@ -770,7 +777,9 @@ void Widget::changeOpenedSubsection(
|
||||||
? Window::SlideDirection::FromRight
|
? Window::SlideDirection::FromRight
|
||||||
: Window::SlideDirection::FromLeft;
|
: Window::SlideDirection::FromLeft;
|
||||||
if (animated == anim::type::normal) {
|
if (animated == anim::type::normal) {
|
||||||
_connecting->setForceHidden(true);
|
if (_connecting) {
|
||||||
|
_connecting->setForceHidden(true);
|
||||||
|
}
|
||||||
oldContentCache = grabForFolderSlideAnimation();
|
oldContentCache = grabForFolderSlideAnimation();
|
||||||
}
|
}
|
||||||
_showAnimation = nullptr;
|
_showAnimation = nullptr;
|
||||||
|
@ -780,9 +789,13 @@ void Widget::changeOpenedSubsection(
|
||||||
_peerSearchRequest = 0;
|
_peerSearchRequest = 0;
|
||||||
_api.request(base::take(_topicSearchRequest)).cancel();
|
_api.request(base::take(_topicSearchRequest)).cancel();
|
||||||
if (animated == anim::type::normal) {
|
if (animated == anim::type::normal) {
|
||||||
_connecting->setForceHidden(true);
|
if (_connecting) {
|
||||||
|
_connecting->setForceHidden(true);
|
||||||
|
}
|
||||||
auto newContentCache = grabForFolderSlideAnimation();
|
auto newContentCache = grabForFolderSlideAnimation();
|
||||||
_connecting->setForceHidden(false);
|
if (_connecting) {
|
||||||
|
_connecting->setForceHidden(false);
|
||||||
|
}
|
||||||
startSlideAnimation(
|
startSlideAnimation(
|
||||||
std::move(oldContentCache),
|
std::move(oldContentCache),
|
||||||
std::move(newContentCache),
|
std::move(newContentCache),
|
||||||
|
@ -954,7 +967,7 @@ QPixmap Widget::grabForFolderSlideAnimation() {
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
width(),
|
width(),
|
||||||
_updateTelegram ? _updateTelegram->y() : height());
|
_scroll->y() + _scroll->height());
|
||||||
auto result = Ui::GrabWidget(this, rect);
|
auto result = Ui::GrabWidget(this, rect);
|
||||||
|
|
||||||
if (!hidden) {
|
if (!hidden) {
|
||||||
|
@ -966,6 +979,10 @@ QPixmap Widget::grabForFolderSlideAnimation() {
|
||||||
void Widget::checkUpdateStatus() {
|
void Widget::checkUpdateStatus() {
|
||||||
Expects(!Core::UpdaterDisabled());
|
Expects(!Core::UpdaterDisabled());
|
||||||
|
|
||||||
|
if (_layout == Layout::Child) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
using Checker = Core::UpdateChecker;
|
using Checker = Core::UpdateChecker;
|
||||||
if (Checker().state() == Checker::State::Ready) {
|
if (Checker().state() == Checker::State::Ready) {
|
||||||
if (_updateTelegram) {
|
if (_updateTelegram) {
|
||||||
|
@ -1112,7 +1129,9 @@ void Widget::showAnimated(
|
||||||
if (_updateTelegram) {
|
if (_updateTelegram) {
|
||||||
_updateTelegram->hide();
|
_updateTelegram->hide();
|
||||||
}
|
}
|
||||||
_connecting->setForceHidden(true);
|
if (_connecting) {
|
||||||
|
_connecting->setForceHidden(true);
|
||||||
|
}
|
||||||
if (_childList) {
|
if (_childList) {
|
||||||
_childList->hide();
|
_childList->hide();
|
||||||
_childListShadow->hide();
|
_childListShadow->hide();
|
||||||
|
@ -1215,6 +1234,10 @@ void Widget::submit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::refreshLoadMoreButton(bool mayBlock, bool isBlocked) {
|
void Widget::refreshLoadMoreButton(bool mayBlock, bool isBlocked) {
|
||||||
|
if (_layout == Layout::Child) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!mayBlock) {
|
if (!mayBlock) {
|
||||||
if (_loadMoreChats) {
|
if (_loadMoreChats) {
|
||||||
_loadMoreChats.destroy();
|
_loadMoreChats.destroy();
|
||||||
|
@ -2359,24 +2382,24 @@ void Widget::updateControlsGeometry() {
|
||||||
right -= _jumpToDate->width(); _jumpToDate->moveToLeft(right, _filter->y());
|
right -= _jumpToDate->width(); _jumpToDate->moveToLeft(right, _filter->y());
|
||||||
right -= _chooseFromUser->width(); _chooseFromUser->moveToLeft(right, _filter->y());
|
right -= _chooseFromUser->width(); _chooseFromUser->moveToLeft(right, _filter->y());
|
||||||
|
|
||||||
const auto usew = _childList ? _narrowWidth : width();
|
const auto barw = width();
|
||||||
if (_forumTopShadow) {
|
if (_forumTopShadow) {
|
||||||
_forumTopShadow->setGeometry(
|
_forumTopShadow->setGeometry(
|
||||||
0,
|
0,
|
||||||
filterAreaTop + filterAreaHeight,
|
filterAreaTop + filterAreaHeight,
|
||||||
usew,
|
barw,
|
||||||
st::lineWidth);
|
st::lineWidth);
|
||||||
}
|
}
|
||||||
const auto forumGroupCallTop = filterAreaTop + filterAreaHeight;
|
const auto forumGroupCallTop = filterAreaTop + filterAreaHeight;
|
||||||
if (_forumGroupCallBar) {
|
if (_forumGroupCallBar) {
|
||||||
_forumGroupCallBar->move(0, forumGroupCallTop);
|
_forumGroupCallBar->move(0, forumGroupCallTop);
|
||||||
_forumGroupCallBar->resizeToWidth(usew);
|
_forumGroupCallBar->resizeToWidth(barw);
|
||||||
}
|
}
|
||||||
const auto forumRequestsTop = forumGroupCallTop
|
const auto forumRequestsTop = forumGroupCallTop
|
||||||
+ (_forumGroupCallBar ? _forumGroupCallBar->height() : 0);
|
+ (_forumGroupCallBar ? _forumGroupCallBar->height() : 0);
|
||||||
if (_forumRequestsBar) {
|
if (_forumRequestsBar) {
|
||||||
_forumRequestsBar->move(0, forumRequestsTop);
|
_forumRequestsBar->move(0, forumRequestsTop);
|
||||||
_forumRequestsBar->resizeToWidth(usew);
|
_forumRequestsBar->resizeToWidth(barw);
|
||||||
}
|
}
|
||||||
const auto forumReportTop = forumRequestsTop
|
const auto forumReportTop = forumRequestsTop
|
||||||
+ (_forumRequestsBar ? _forumRequestsBar->height() : 0);
|
+ (_forumRequestsBar ? _forumRequestsBar->height() : 0);
|
||||||
|
@ -2394,7 +2417,7 @@ void Widget::updateControlsGeometry() {
|
||||||
button->setGeometry(
|
button->setGeometry(
|
||||||
0,
|
0,
|
||||||
scrollTop + scrollHeight,
|
scrollTop + scrollHeight,
|
||||||
usew,
|
barw,
|
||||||
buttonHeight);
|
buttonHeight);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2406,9 +2429,11 @@ void Widget::updateControlsGeometry() {
|
||||||
_connecting->setBottomSkip(bottomSkip);
|
_connecting->setBottomSkip(bottomSkip);
|
||||||
}
|
}
|
||||||
controller()->setConnectingBottomSkip(bottomSkip);
|
controller()->setConnectingBottomSkip(bottomSkip);
|
||||||
auto wasScrollHeight = _scroll->height();
|
|
||||||
_scroll->setGeometry(0, scrollTop, usew, scrollHeight);
|
const auto scrollw = _childList ? _narrowWidth : barw;
|
||||||
_inner->resize(usew, _inner->height());
|
const auto wasScrollHeight = _scroll->height();
|
||||||
|
_scroll->setGeometry(0, scrollTop, scrollw, scrollHeight);
|
||||||
|
_inner->resize(scrollw, _inner->height());
|
||||||
if (scrollHeight != wasScrollHeight) {
|
if (scrollHeight != wasScrollHeight) {
|
||||||
controller()->floatPlayerAreaUpdated();
|
controller()->floatPlayerAreaUpdated();
|
||||||
}
|
}
|
||||||
|
@ -2422,11 +2447,12 @@ void Widget::updateControlsGeometry() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_childList) {
|
if (_childList) {
|
||||||
const auto childw = std::max(_narrowWidth, width() - usew);
|
const auto childw = std::max(_narrowWidth, width() - scrollw);
|
||||||
|
const auto childh = scrollTop + scrollHeight;
|
||||||
_childList->setGeometryWithTopMoved(
|
_childList->setGeometryWithTopMoved(
|
||||||
{ width() - childw, 0, childw, height() },
|
{ width() - childw, 0, childw, childh },
|
||||||
_topDelta);
|
_topDelta);
|
||||||
_childListShadow->setGeometry(0, 0, (width() - childw), height());
|
_childListShadow->setGeometry(0, 0, (width() - childw), childh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue