Fix Enter and Escape keys in tool dialogs (crop, red eye)
ClosedPublic

Authored by cfeck on May 12 2017, 4:05 PM.

Details

Summary

When cropping an image, an inline tool dialog bar is added to the view, allowing to accept or reject the current crop region. Users expect the Enter key to accept that dialog, see bug 313806. I also added the Escape key to reject this dialog.

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cfeck created this revision.May 12 2017, 4:05 PM
gateau requested changes to this revision.May 14 2017, 8:09 PM
gateau added inline comments.
app/viewmainpage.cpp
746

Maybe this could go in AbstractRasterImageViewTool as a bool onEnterPressed() method, which would return true if the tool has accepted the Enter key press?

762

Same here with a bool onEscapePressed() method

This revision now requires changes to proceed.May 14 2017, 8:09 PM
cfeck added a comment.EditedMay 28 2017, 5:32 PM

Just noticed that AbstractRasterImageViewTool already has a keyPressEvent() overload. Would you prefer using this?

Ah yes, using keyPressEvent() sounds like a good idea.

cfeck updated this revision to Diff 15029.May 31 2017, 7:33 PM
cfeck edited edge metadata.

Use the keyPressEvent() of the Tool to handle the Return/Escape keys. This allows each tool to individually decide what to do.

gateau accepted this revision.Jun 3 2017, 1:56 PM

Looks good!

This revision is now accepted and ready to land.Jun 3 2017, 1:56 PM
This revision was automatically updated to reflect the committed changes.