mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Display export progress.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user