2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +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

@@ -13,7 +13,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/stickers_box.h"
#include "boxes/confirm_box.h"
#include "boxes/background_box.h"
#include "boxes/generic_box.h"
#include "boxes/background_preview_box.h"
#include "boxes/download_path_box.h"
#include "boxes/local_storage_box.h"
@@ -23,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/input_fields.h"
#include "ui/widgets/checkbox.h"
#include "ui/widgets/labels.h"
#include "ui/layers/generic_box.h"
#include "ui/effects/radial_animation.h"
#include "ui/toast/toast.h"
#include "ui/image/image.h"
@@ -50,7 +50,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "facades.h"
#include "app.h"
#include "styles/style_settings.h"
#include "styles/style_boxes.h"
#include "styles/style_layers.h"
namespace Settings {
namespace {

View File

@@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/wrap/padding_wrap.h"
#include "ui/wrap/vertical_layout.h"
#include "ui/widgets/labels.h"
#include "ui/widgets/box_content_divider.h"
#include "info/profile/info_profile_button.h"
#include "boxes/abstract_box.h"
#include "window/themes/window_theme_editor_box.h"
@@ -25,7 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "main/main_session.h"
#include "styles/style_boxes.h"
#include "styles/style_layers.h"
#include "styles/style_settings.h"
namespace Settings {
@@ -64,7 +65,7 @@ void AddSkip(not_null<Ui::VerticalLayout*> container, int skip) {
}
void AddDivider(not_null<Ui::VerticalLayout*> container) {
container->add(object_ptr<BoxContentDivider>(container));
container->add(object_ptr<Ui::BoxContentDivider>(container));
}
void AddDividerText(

View File

@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/buttons.h"
#include "ui/widgets/input_fields.h"
#include "ui/widgets/popup_menu.h"
#include "ui/widgets/box_content_divider.h"
#include "ui/special_buttons.h"
#include "chat_helpers/emoji_suggestions_widget.h"
#include "boxes/add_contact_box.h"
@@ -31,7 +32,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/file_utilities.h"
#include "facades.h"
#include "app.h"
#include "styles/style_boxes.h"
#include "styles/style_layers.h"
#include "styles/style_settings.h"
#include <QtGui/QGuiApplication>
@@ -46,7 +47,7 @@ void SetupPhoto(
not_null<Ui::VerticalLayout*> container,
not_null<Window::SessionController*> controller,
not_null<UserData*> self) {
const auto wrap = container->add(object_ptr<BoxContentDivider>(
const auto wrap = container->add(object_ptr<Ui::BoxContentDivider>(
container,
st::settingsInfoPhotoHeight));
const auto photo = Ui::CreateChild<Ui::UserpicButton>(

View File

@@ -22,7 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/abstract_box.h"
#include "app.h"
#include "styles/style_settings.h"
#include "styles/style_boxes.h"
#include "styles/style_layers.h"
#include "styles/style_info.h"
namespace Settings {

View File

@@ -7,7 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include "window/layer_widget.h"
#include "ui/layers/layer_widget.h"
namespace Ui {
class VerticalLayout;
@@ -21,7 +21,7 @@ namespace Settings {
class IntroWidget;
class LayerWidget : public Window::LayerWidget {
class LayerWidget : public Ui::LayerWidget {
public:
LayerWidget(QWidget*);

View File

@@ -300,7 +300,7 @@ void BlockedBoxController::BlockNewUser(
};
Ui::show(
Box<PeerListBox>(std::move(controller), std::move(initBox)),
LayerOption::KeepOther);
Ui::LayerOption::KeepOther);
}
bool BlockedBoxController::appendRow(not_null<UserData*> user) {
@@ -521,7 +521,7 @@ void LastSeenPrivacyController::confirmSave(
tr::lng_continue(tr::now),
tr::lng_cancel(tr::now),
std::move(callback));
*weakBox = Ui::show(std::move(box), LayerOption::KeepOther);
*weakBox = Ui::show(std::move(box), Ui::LayerOption::KeepOther);
} else {
saveCallback();
}

View File

@@ -504,7 +504,7 @@ bool CheckEditCloudPassword(not_null<::Main::Session*> session) {
return false;
}
object_ptr<BoxContent> EditCloudPasswordBox(not_null<Main::Session*> session) {
object_ptr<Ui::BoxContent> EditCloudPasswordBox(not_null<Main::Session*> session) {
const auto current = session->api().passwordStateCurrent();
Assert(current.has_value());
@@ -554,8 +554,8 @@ void RemoveCloudPassword(not_null<::Main::Session*> session) {
}, box->lifetime());
}
object_ptr<BoxContent> CloudPasswordAppOutdatedBox() {
auto box = std::make_shared<QPointer<BoxContent>>();
object_ptr<Ui::BoxContent> CloudPasswordAppOutdatedBox() {
auto box = std::make_shared<QPointer<Ui::BoxContent>>();
const auto callback = [=] {
Core::UpdateApplication();
if (*box) (*box)->closeBox();
@@ -589,7 +589,7 @@ void AddPrivacyButton(
) | rpl::start_with_next([=](const Privacy &value) {
Ui::show(
Box<EditPrivacyBox>(controller, controllerFactory(), value),
LayerOption::KeepOther);
Ui::LayerOption::KeepOther);
});
});
}

View File

@@ -11,17 +11,20 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "apiwrap.h"
class EditPrivacyController;
namespace Ui {
class BoxContent;
} // namespace Ui
namespace Settings {
int ExceptionUsersCount(const std::vector<not_null<PeerData*>> &exceptions);
bool CheckEditCloudPassword(not_null<::Main::Session*> session);
object_ptr<BoxContent> EditCloudPasswordBox(
object_ptr<Ui::BoxContent> EditCloudPasswordBox(
not_null<::Main::Session*> session);
void RemoveCloudPassword(not_null<::Main::Session*> session);
object_ptr<BoxContent> CloudPasswordAppOutdatedBox();
object_ptr<Ui::BoxContent> CloudPasswordAppOutdatedBox();
void AddPrivacyButton(
not_null<Window::SessionController*> controller,