mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Removed Ui::hideLayer from places that can be in non-primary windows.
This commit is contained in:
parent
1169c5e143
commit
43c0197445
10 changed files with 20 additions and 22 deletions
|
@ -397,7 +397,7 @@ void AddContactBox::save() {
|
|||
if (user->isContact() || user->session().supportMode()) {
|
||||
Ui::showPeerHistory(user, ShowAtTheEndMsgId);
|
||||
}
|
||||
Ui::hideLayer();
|
||||
getDelegate()->hideLayer();
|
||||
} else if (isBoxShown()) {
|
||||
hideChildren();
|
||||
_retrying = true;
|
||||
|
@ -593,7 +593,7 @@ void GroupInfoBox::createGroup(
|
|||
auto image = _photo->takeResultImage();
|
||||
const auto navigation = _navigation;
|
||||
|
||||
Ui::hideLayer(); // Destroys 'this'.
|
||||
getDelegate()->hideLayer(); // Destroys 'this'.
|
||||
ChatCreateDone(navigation, std::move(image), result);
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
const auto &type = error.type();
|
||||
|
@ -1253,7 +1253,7 @@ void SetupChannelBox::updateFail(UsernameResult result) {
|
|||
|
||||
void SetupChannelBox::checkFail(UsernameResult result) {
|
||||
if (result == UsernameResult::NA) {
|
||||
Ui::hideLayer();
|
||||
getDelegate()->hideLayer();
|
||||
} else if (result == UsernameResult::ChatsTooMuch) {
|
||||
if (_existing) {
|
||||
showRevokePublicLinkBoxForEdit();
|
||||
|
@ -1291,7 +1291,7 @@ void SetupChannelBox::showRevokePublicLinkBoxForEdit() {
|
|||
|
||||
void SetupChannelBox::firstCheckFail(UsernameResult result) {
|
||||
if (result == UsernameResult::NA) {
|
||||
Ui::hideLayer();
|
||||
getDelegate()->hideLayer();
|
||||
} else if (result == UsernameResult::ChatsTooMuch) {
|
||||
if (_existing) {
|
||||
showRevokePublicLinkBoxForEdit();
|
||||
|
|
|
@ -718,9 +718,9 @@ void Instance::requestPermissionOrFail(Platform::PermissionType type, Fn<void()>
|
|||
}
|
||||
Ui::show(Ui::MakeConfirmBox({
|
||||
.text = tr::lng_no_mic_permission(),
|
||||
.confirmed = crl::guard(this, [=] {
|
||||
.confirmed = crl::guard(this, [=](Fn<void()> &&close) {
|
||||
Platform::OpenSystemSettingsForPermission(type);
|
||||
Ui::hideLayer();
|
||||
close();
|
||||
}),
|
||||
.confirmText = tr::lng_menu_settings(),
|
||||
}));
|
||||
|
|
|
@ -3683,13 +3683,14 @@ void StickersListWidget::removeMegagroupSet(bool locally) {
|
|||
_removingSetId = Data::Stickers::MegagroupSetId;
|
||||
controller()->show(Ui::MakeConfirmBox({
|
||||
.text = tr::lng_stickers_remove_group_set(),
|
||||
.confirmed = crl::guard(this, [this, group = _megagroupSet] {
|
||||
.confirmed = crl::guard(this, [this, group = _megagroupSet](
|
||||
Fn<void()> &&close) {
|
||||
Expects(group->mgInfo != nullptr);
|
||||
|
||||
if (group->mgInfo->stickerSet) {
|
||||
session().api().setGroupStickerSet(group, {});
|
||||
}
|
||||
Ui::hideLayer();
|
||||
close();
|
||||
_removingSetId = 0;
|
||||
_checkForHide.fire({});
|
||||
}),
|
||||
|
|
|
@ -339,7 +339,7 @@ Widget::Widget(
|
|||
void Widget::showFilter() {
|
||||
_inner->showFilter([this](FilterValue &&filter) {
|
||||
applyFilter(std::move(filter));
|
||||
Ui::hideLayer();
|
||||
controller()->hideLayer();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -7026,7 +7026,7 @@ void HistoryWidget::cancelEdit() {
|
|||
}
|
||||
|
||||
void HistoryWidget::cancelFieldAreaState() {
|
||||
Ui::hideLayer();
|
||||
controller()->hideLayer();
|
||||
_replyForwardPressed = false;
|
||||
if (_previewData && _previewData->pendingTill >= 0) {
|
||||
_previewState = Data::PreviewState::Cancelled;
|
||||
|
@ -7292,10 +7292,10 @@ void HistoryWidget::escape() {
|
|||
&& PrepareEditText(_replyEditMsg) != _field->getTextWithTags()) {
|
||||
controller()->show(Ui::MakeConfirmBox({
|
||||
.text = tr::lng_cancel_edit_post_sure(),
|
||||
.confirmed = crl::guard(this, [this] {
|
||||
.confirmed = crl::guard(this, [this](Fn<void()> &&close) {
|
||||
if (_editMsgId) {
|
||||
cancelEdit();
|
||||
Ui::hideLayer();
|
||||
close();
|
||||
}
|
||||
}),
|
||||
.confirmText = tr::lng_cancel_edit_post_yes(),
|
||||
|
|
|
@ -18,7 +18,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "window/window_session_controller.h"
|
||||
#include "window/main_window.h"
|
||||
#include "main/main_session.h"
|
||||
#include "boxes/abstract_box.h"
|
||||
#include "core/application.h"
|
||||
#include "styles/style_info.h"
|
||||
#include "styles/style_window.h"
|
||||
|
@ -227,7 +226,7 @@ bool LayerWidget::showSectionInternal(
|
|||
const Window::SectionShow ¶ms) {
|
||||
if (_content && _content->showInternal(memento, params)) {
|
||||
if (params.activation != anim::activation::background) {
|
||||
Ui::hideLayer();
|
||||
_controller->parentController()->hideLayer();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -453,7 +453,7 @@ void WrapWidget::createTopBar() {
|
|||
}
|
||||
|
||||
void WrapWidget::checkBeforeClose(Fn<void()> close) {
|
||||
Ui::hideLayer();
|
||||
_controller->parentController()->hideLayer();
|
||||
close();
|
||||
}
|
||||
|
||||
|
|
|
@ -311,7 +311,7 @@ MainWidget::MainWidget(
|
|||
} else {
|
||||
Ui::showPeerHistory(history, ShowAtUnreadMsgId);
|
||||
}
|
||||
Ui::hideLayer();
|
||||
_controller->hideLayer();
|
||||
}
|
||||
}, lifetime());
|
||||
|
||||
|
@ -1644,7 +1644,7 @@ void MainWidget::showNewSection(
|
|||
saveInStack = false;
|
||||
} else if (auto layer = memento->createLayer(_controller, layerRect)) {
|
||||
if (params.activation != anim::activation::background) {
|
||||
Ui::hideLayer(anim::type::instant);
|
||||
_controller->hideLayer(anim::type::instant);
|
||||
}
|
||||
_controller->showSpecialLayer(std::move(layer));
|
||||
return;
|
||||
|
|
|
@ -1876,7 +1876,7 @@ void OverlayWidget::deleteMedia() {
|
|||
.text = tr::lng_delete_photo_sure(),
|
||||
.confirmed = crl::guard(_widget, [=] {
|
||||
session->api().peerPhoto().clear(photo);
|
||||
Ui::hideLayer();
|
||||
window->hideLayer();
|
||||
}),
|
||||
.confirmText = tr::lng_box_delete(),
|
||||
}),
|
||||
|
|
|
@ -34,8 +34,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "webrtc/webrtc_audio_input_tester.h"
|
||||
#include "webrtc/webrtc_create_adm.h" // Webrtc::Backend.
|
||||
#include "tgcalls/VideoCaptureInterface.h"
|
||||
#include "facades.h"
|
||||
#include "boxes/abstract_box.h" // Ui::hideLayer().
|
||||
#include "styles/style_layers.h"
|
||||
|
||||
namespace Settings {
|
||||
|
@ -343,10 +341,10 @@ void Calls::requestPermissionAndStartTestingMicrophone() {
|
|||
Platform::PermissionType::Microphone,
|
||||
startTestingChecked);
|
||||
} else {
|
||||
const auto showSystemSettings = [] {
|
||||
const auto showSystemSettings = [controller = _controller] {
|
||||
Platform::OpenSystemSettingsForPermission(
|
||||
Platform::PermissionType::Microphone);
|
||||
Ui::hideLayer();
|
||||
controller->hideLayer();
|
||||
};
|
||||
_controller->show(Ui::MakeConfirmBox({
|
||||
.text = tr::lng_no_mic_permission(),
|
||||
|
|
Loading…
Add table
Reference in a new issue