mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 14:08:41 +00:00
Replaced callback for box showing with dedicated class in photo editor.
This commit is contained in:
@@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#include "editor/controllers/stickers_panel_controller.h"
|
||||
#include "editor/controllers/undo_controller.h"
|
||||
#include "ui/layers/box_content.h"
|
||||
#include "ui/layers/show.h"
|
||||
|
||||
namespace Editor {
|
||||
|
||||
@@ -17,17 +17,17 @@ struct Controllers final {
|
||||
Controllers(
|
||||
std::unique_ptr<StickersPanelController> stickersPanelController,
|
||||
std::unique_ptr<UndoController> undoController,
|
||||
Fn<void(object_ptr<Ui::BoxContent>)> showBox)
|
||||
std::shared_ptr<Ui::Show> show)
|
||||
: stickersPanelController(std::move(stickersPanelController))
|
||||
, undoController(std::move(undoController))
|
||||
, showBox(std::move(showBox)) {
|
||||
, show(std::move(show)) {
|
||||
}
|
||||
~Controllers() {
|
||||
};
|
||||
|
||||
const std::unique_ptr<StickersPanelController> stickersPanelController;
|
||||
const std::unique_ptr<UndoController> undoController;
|
||||
const Fn<void(object_ptr<Ui::BoxContent>)> showBox;
|
||||
const std::shared_ptr<Ui::Show> show;
|
||||
};
|
||||
|
||||
} // namespace Editor
|
||||
|
@@ -190,7 +190,7 @@ void Paint::handleMimeData(const QMimeData *data) {
|
||||
return;
|
||||
}
|
||||
if (!Ui::ValidateThumbDimensions(image.width(), image.height())) {
|
||||
_controllers->showBox(
|
||||
_controllers->show->showBox(
|
||||
Ui::MakeInformBox(tr::lng_edit_media_invalid_file()));
|
||||
return;
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "editor/photo_editor_content.h"
|
||||
#include "editor/photo_editor_controls.h"
|
||||
#include "window/window_controller.h"
|
||||
#include "window/window_session_controller.h"
|
||||
#include "styles/style_editor.h"
|
||||
|
||||
namespace Editor {
|
||||
@@ -59,7 +60,7 @@ PhotoEditor::PhotoEditor(
|
||||
controller->sessionController())
|
||||
: nullptr,
|
||||
std::make_unique<UndoController>(),
|
||||
[=] (object_ptr<Ui::BoxContent> c) { controller->show(std::move(c)); }))
|
||||
std::make_shared<Window::Show>(controller)))
|
||||
, _content(base::make_unique_q<PhotoEditorContent>(
|
||||
this,
|
||||
photo,
|
||||
|
Submodule Telegram/lib_ui updated: 4befce5a29...b178a5d15f
Reference in New Issue
Block a user