Disabled ability to use hotkeys when selecting color in photo editor.

This commit is contained in:
23rd 2021-05-08 18:21:07 +03:00
parent 9dacf69d41
commit 8420b7dc17
3 changed files with 9 additions and 1 deletions

View file

@ -321,4 +321,9 @@ int ColorPicker::colorToPosition(const QColor &color) const {
return 0; return 0;
} }
bool ColorPicker::preventHandleKeyPress() const {
return _canvasForCircle->isVisible()
&& (_circleAnimation.animating() || _down.pressed);
}
} // namespace Editor } // namespace Editor

View file

@ -29,6 +29,7 @@ public:
void moveLine(const QPoint &position); void moveLine(const QPoint &position);
void setVisible(bool visible); void setVisible(bool visible);
bool preventHandleKeyPress() const;
rpl::producer<Brush> saveBrushRequests() const; rpl::producer<Brush> saveBrushRequests() const;

View file

@ -166,7 +166,9 @@ PhotoEditor::PhotoEditor(
} }
void PhotoEditor::handleKeyPress(not_null<QKeyEvent*> e) { void PhotoEditor::handleKeyPress(not_null<QKeyEvent*> e) {
_content->handleKeyPress(e) || _controls->handleKeyPress(e); if (!_colorPicker->preventHandleKeyPress()) {
_content->handleKeyPress(e) || _controls->handleKeyPress(e);
}
} }
void PhotoEditor::save() { void PhotoEditor::save() {