mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 22:27:20 +02:00
Added ability to open photo editor with saved modifications.
This commit is contained in:
parent
4d72d20398
commit
85c21ba0e4
4 changed files with 15 additions and 6 deletions
|
@ -15,9 +15,14 @@ namespace Editor {
|
|||
|
||||
PhotoEditor::PhotoEditor(
|
||||
not_null<Ui::RpWidget*> parent,
|
||||
std::shared_ptr<QPixmap> photo)
|
||||
std::shared_ptr<QPixmap> photo,
|
||||
PhotoModifications modifications)
|
||||
: RpWidget(parent)
|
||||
, _content(base::make_unique_q<PhotoEditorContent>(this, photo))
|
||||
, _modifications(modifications)
|
||||
, _content(base::make_unique_q<PhotoEditorContent>(
|
||||
this,
|
||||
photo,
|
||||
modifications))
|
||||
, _controls(base::make_unique_q<PhotoEditorControls>(this)) {
|
||||
sizeValue(
|
||||
) | rpl::start_with_next([=](const QSize &size) {
|
||||
|
|
|
@ -22,7 +22,8 @@ class PhotoEditor final : public Ui::RpWidget {
|
|||
public:
|
||||
PhotoEditor(
|
||||
not_null<Ui::RpWidget*> parent,
|
||||
std::shared_ptr<QPixmap> photo);
|
||||
std::shared_ptr<QPixmap> photo,
|
||||
PhotoModifications modifications);
|
||||
|
||||
void save();
|
||||
rpl::producer<PhotoModifications> done() const;
|
||||
|
|
|
@ -13,8 +13,10 @@ namespace Editor {
|
|||
|
||||
PhotoEditorContent::PhotoEditorContent(
|
||||
not_null<Ui::RpWidget*> parent,
|
||||
std::shared_ptr<QPixmap> photo)
|
||||
: RpWidget(parent) {
|
||||
std::shared_ptr<QPixmap> photo,
|
||||
PhotoModifications modifications)
|
||||
: RpWidget(parent)
|
||||
, _modifications(modifications) {
|
||||
|
||||
rpl::combine(
|
||||
_modifications.value(),
|
||||
|
|
|
@ -17,7 +17,8 @@ class PhotoEditorContent final : public Ui::RpWidget {
|
|||
public:
|
||||
PhotoEditorContent(
|
||||
not_null<Ui::RpWidget*> parent,
|
||||
std::shared_ptr<QPixmap> photo);
|
||||
std::shared_ptr<QPixmap> photo,
|
||||
PhotoModifications modifications);
|
||||
|
||||
void applyModifications(PhotoModifications modifications);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue