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