mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added button highlighting for flipped image to photo editor.
This commit is contained in:
parent
1a7d5b7c95
commit
183408cb2d
3 changed files with 18 additions and 2 deletions
|
@ -57,7 +57,10 @@ PhotoEditor::PhotoEditor(
|
||||||
_modifications,
|
_modifications,
|
||||||
_undoController,
|
_undoController,
|
||||||
std::move(data)))
|
std::move(data)))
|
||||||
, _controls(base::make_unique_q<PhotoEditorControls>(this, _undoController))
|
, _controls(base::make_unique_q<PhotoEditorControls>(
|
||||||
|
this,
|
||||||
|
_undoController,
|
||||||
|
_modifications))
|
||||||
, _colorPicker(std::make_unique<ColorPicker>(
|
, _colorPicker(std::make_unique<ColorPicker>(
|
||||||
this,
|
this,
|
||||||
Deserialize(Core::App().settings().photoEditorBrush()))) {
|
Deserialize(Core::App().settings().photoEditorBrush()))) {
|
||||||
|
|
|
@ -135,6 +135,7 @@ void HorizontalContainer::updateChildrenPosition() {
|
||||||
PhotoEditorControls::PhotoEditorControls(
|
PhotoEditorControls::PhotoEditorControls(
|
||||||
not_null<Ui::RpWidget*> parent,
|
not_null<Ui::RpWidget*> parent,
|
||||||
std::shared_ptr<UndoController> undoController,
|
std::shared_ptr<UndoController> undoController,
|
||||||
|
const PhotoModifications modifications,
|
||||||
bool doneControls)
|
bool doneControls)
|
||||||
: RpWidget(parent)
|
: RpWidget(parent)
|
||||||
, _bg(st::mediaviewSaveMsgBg)
|
, _bg(st::mediaviewSaveMsgBg)
|
||||||
|
@ -173,7 +174,8 @@ PhotoEditorControls::PhotoEditorControls(
|
||||||
false,
|
false,
|
||||||
_bg,
|
_bg,
|
||||||
st::lightButtonFg,
|
st::lightButtonFg,
|
||||||
st::photoEditorRotateButton.ripple)) {
|
st::photoEditorRotateButton.ripple))
|
||||||
|
, _flipped(modifications.flipped) {
|
||||||
|
|
||||||
_transformButtons->updateChildrenPosition();
|
_transformButtons->updateChildrenPosition();
|
||||||
_paintButtons->updateChildrenPosition();
|
_paintButtons->updateChildrenPosition();
|
||||||
|
@ -241,6 +243,14 @@ PhotoEditorControls::PhotoEditorControls(
|
||||||
: &st::photoEditorRedoButtonInactive);
|
: &st::photoEditorRedoButtonInactive);
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
|
_flipButton->clicks(
|
||||||
|
) | rpl::start_with_next([=] {
|
||||||
|
_flipped = !_flipped;
|
||||||
|
_flipButton->setIconOverride(_flipped
|
||||||
|
? &st::photoEditorFlipButton.iconOver
|
||||||
|
: nullptr);
|
||||||
|
}, _flipButton->lifetime());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<int> PhotoEditorControls::rotateRequests() const {
|
rpl::producer<int> PhotoEditorControls::rotateRequests() const {
|
||||||
|
|
|
@ -26,6 +26,7 @@ public:
|
||||||
PhotoEditorControls(
|
PhotoEditorControls(
|
||||||
not_null<Ui::RpWidget*> parent,
|
not_null<Ui::RpWidget*> parent,
|
||||||
std::shared_ptr<UndoController> undoController,
|
std::shared_ptr<UndoController> undoController,
|
||||||
|
const PhotoModifications modifications,
|
||||||
bool doneControls = true);
|
bool doneControls = true);
|
||||||
|
|
||||||
[[nodiscard]] rpl::producer<int> rotateRequests() const;
|
[[nodiscard]] rpl::producer<int> rotateRequests() const;
|
||||||
|
@ -53,6 +54,8 @@ private:
|
||||||
const base::unique_qptr<EdgeButton> _cancel;
|
const base::unique_qptr<EdgeButton> _cancel;
|
||||||
const base::unique_qptr<EdgeButton> _done;
|
const base::unique_qptr<EdgeButton> _done;
|
||||||
|
|
||||||
|
bool _flipped;
|
||||||
|
|
||||||
rpl::variable<PhotoEditorMode> _mode;
|
rpl::variable<PhotoEditorMode> _mode;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue