Display export progress.

This commit is contained in:
John Preston
2018-06-19 19:31:30 +01:00
parent 5f01751660
commit 4115d3d13d
13 changed files with 544 additions and 78 deletions
@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "ui/widgets/labels.h"
#include "ui/widgets/buttons.h"
#include "ui/wrap/vertical_layout.h"
#include "platform/platform_specific.h"
#include "styles/style_widgets.h"
@@ -24,6 +25,8 @@ DoneWidget::DoneWidget(QWidget *parent)
}
void DoneWidget::setupContent() {
initFooter();
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
const auto label = content->add(
@@ -47,5 +50,38 @@ rpl::producer<> DoneWidget::showClicks() const {
return _showClicks.events();
}
rpl::producer<> DoneWidget::closeClicks() const {
return _close->clicks();
}
void DoneWidget::initFooter() {
const auto buttonsPadding = st::boxButtonPadding;
const auto buttonsHeight = buttonsPadding.top()
+ st::defaultBoxButton.height
+ buttonsPadding.bottom();
const auto buttons = Ui::CreateChild<Ui::FixedHeightWidget>(
this,
buttonsHeight);
sizeValue(
) | rpl::start_with_next([=](QSize size) {
buttons->resizeToWidth(size.width());
buttons->moveToLeft(0, size.height() - buttons->height());
}, lifetime());
_close = Ui::CreateChild<Ui::RoundButton>(
buttons,
langFactory(lng_close),
st::defaultBoxButton);
_close->show();
buttons->widthValue(
) | rpl::start_with_next([=] {
const auto right = st::boxButtonPadding.right();
const auto top = st::boxButtonPadding.top();
_close->moveToRight(right, top);
}, _close->lifetime());
}
} // namespace View
} // namespace Export