mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Merge tag 'v6.1.3' into dev
This commit is contained in:
@@ -912,10 +912,12 @@ void Controller::showWebviewError() {
|
||||
}
|
||||
|
||||
void Controller::showWebviewError(TextWithEntities text) {
|
||||
auto error = Ui::CreateChild<Ui::PaddingWrap<Ui::FlatLabel>>(
|
||||
_container,
|
||||
const auto wrap = Ui::CreateChild<Ui::RpWidget>(_container);
|
||||
|
||||
const auto error = Ui::CreateChild<Ui::PaddingWrap<Ui::FlatLabel>>(
|
||||
wrap,
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
_container,
|
||||
wrap,
|
||||
rpl::single(text),
|
||||
st::paymentsCriticalError),
|
||||
st::paymentsCriticalErrorPadding);
|
||||
@@ -929,10 +931,16 @@ void Controller::showWebviewError(TextWithEntities text) {
|
||||
File::OpenUrl(entity.data);
|
||||
return false;
|
||||
});
|
||||
error->show();
|
||||
wrap->show();
|
||||
|
||||
wrap->widthValue() | rpl::start_with_next([=](int width) {
|
||||
error->resizeToWidth(width);
|
||||
wrap->resize(width, error->height());
|
||||
}, wrap->lifetime());
|
||||
|
||||
_container->sizeValue() | rpl::start_with_next([=](QSize size) {
|
||||
error->setGeometry(0, 0, size.width(), size.height() * 2 / 3);
|
||||
}, error->lifetime());
|
||||
wrap->setGeometry(0, 0, size.width(), size.height() * 2 / 3);
|
||||
}, wrap->lifetime());
|
||||
}
|
||||
|
||||
void Controller::showInWindow(
|
||||
@@ -1105,7 +1113,7 @@ void Controller::showMenu() {
|
||||
}
|
||||
_menu->setDestroyedCallback(crl::guard(_window.get(), [
|
||||
this,
|
||||
weakButton = Ui::MakeWeak(_menuToggle.data()),
|
||||
weakButton = base::make_weak(_menuToggle.data()),
|
||||
menu = _menu.get()] {
|
||||
if (_menu == menu && weakButton) {
|
||||
weakButton->setForceRippled(false);
|
||||
|
||||
@@ -315,11 +315,11 @@ ShareBoxResult Shown::shareBox(ShareBoxDescriptor &&descriptor) {
|
||||
};
|
||||
const auto state = wrap->lifetime().make_state<State>();
|
||||
|
||||
const auto weak = QPointer<Ui::RpWidget>(wrap);
|
||||
const auto weak = base::make_weak(wrap);
|
||||
const auto lookup = crl::guard(weak, [state] { return state->stack; });
|
||||
const auto layer = Ui::CreateChild<Ui::LayerStackWidget>(
|
||||
wrap.get(),
|
||||
[=] { return std::make_shared<Show>(weak.data(), lookup); });
|
||||
[=] { return std::make_shared<Show>(weak.get(), lookup); });
|
||||
state->stack = layer;
|
||||
const auto show = layer->showFactory()();
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#include "base/flat_map.h"
|
||||
#include "base/flat_set.h"
|
||||
#include "base/weak_qptr.h"
|
||||
|
||||
#include "ui/qt_object_factory.h"
|
||||
#include "ui/qt_weak_factory.h"
|
||||
|
||||
#include "scheme.h"
|
||||
#include "logs.h"
|
||||
|
||||
Reference in New Issue
Block a user