2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Use layers and boxes from lib_ui.

This commit is contained in:
John Preston
2019-09-18 14:19:05 +03:00
parent 860353824b
commit a6c84c36c0
209 changed files with 586 additions and 3349 deletions

View File

@@ -12,7 +12,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/mute_settings_box.h"
#include "boxes/add_contact_box.h"
#include "boxes/report_box.h"
#include "boxes/generic_box.h"
#include "boxes/create_poll_box.h"
#include "boxes/peers/add_participants_box.h"
#include "boxes/peers/edit_contact_box.h"
@@ -20,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/text/text_utilities.h"
#include "ui/widgets/labels.h"
#include "ui/widgets/checkbox.h"
#include "ui/layers/generic_box.h"
#include "main/main_session.h"
#include "apiwrap.h"
#include "mainwidget.h"
@@ -47,6 +47,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "dialogs/dialogs_key.h"
#include "boxes/peers/edit_peer_info_box.h"
#include "facades.h"
#include "styles/style_layers.h"
#include "styles/style_boxes.h"
#include "styles/style_window.h" // st::windowMinWidth
@@ -669,7 +670,7 @@ void PeerMenuShareContactBox(
if (!peer->canWrite()) {
Ui::show(Box<InformBox>(
tr::lng_forward_share_cant(tr::now)),
LayerOption::KeepOther);
Ui::LayerOption::KeepOther);
return;
} else if (peer->isSelf()) {
auto action = Api::SendAction(peer->owner().history(peer));
@@ -693,7 +694,7 @@ void PeerMenuShareContactBox(
auto action = Api::SendAction(history);
action.clearDraft = false;
user->session().api().shareContact(user, action);
}), LayerOption::KeepOther);
}), Ui::LayerOption::KeepOther);
};
*weak = Ui::show(Box<PeerListBox>(
std::make_unique<ChooseRecipientBoxController>(
@@ -736,7 +737,7 @@ void PeerMenuCreatePoll(not_null<PeerData*> peer) {
}
void PeerMenuBlockUserBox(
not_null<GenericBox*> box,
not_null<Ui::GenericBox*> box,
not_null<Window::Controller*> window,
not_null<UserData*> user,
bool suggestClearChat) {
@@ -859,7 +860,7 @@ QPointer<Ui::RpWidget> ShowForwardMessagesBox(
std::make_unique<ChooseRecipientBoxController>(
navigation,
std::move(callback)),
std::move(initBox)), LayerOption::KeepOther);
std::move(initBox)), Ui::LayerOption::KeepOther);
return weak->data();
}
@@ -885,7 +886,7 @@ QPointer<Ui::RpWidget> ShowSendNowMessagesBox(
Ui::Toast::Show(config);
return { nullptr };
}
const auto box = std::make_shared<QPointer<BoxContent>>();
const auto box = std::make_shared<QPointer<Ui::BoxContent>>();
auto done = [
=,
list = std::move(items),
@@ -915,7 +916,7 @@ QPointer<Ui::RpWidget> ShowSendNowMessagesBox(
};
*box = Ui::show(
Box<ConfirmBox>(text, tr::lng_send_button(tr::now), std::move(done)),
LayerOption::KeepOther);
Ui::LayerOption::KeepOther);
return box->data();
}
@@ -926,7 +927,7 @@ void PeerMenuAddChannelMembers(
&& channel->membersCount() >= Global::ChatSizeMax()) {
Ui::show(
Box<MaxInviteBox>(channel),
LayerOption::KeepOther);
Ui::LayerOption::KeepOther);
return;
}
const auto api = &channel->session().api();
@@ -1008,13 +1009,17 @@ void ToggleHistoryArchived(not_null<History*> history, bool archived) {
Fn<void()> ClearHistoryHandler(not_null<PeerData*> peer) {
return [=] {
Ui::show(Box<DeleteMessagesBox>(peer, true), LayerOption::KeepOther);
Ui::show(
Box<DeleteMessagesBox>(peer, true),
Ui::LayerOption::KeepOther);
};
}
Fn<void()> DeleteAndLeaveHandler(not_null<PeerData*> peer) {
return [=] {
Ui::show(Box<DeleteMessagesBox>(peer, false), LayerOption::KeepOther);
Ui::show(
Box<DeleteMessagesBox>(peer, false),
Ui::LayerOption::KeepOther);
};
}