Save last used crop ratio settings
Summary:
The crop tool currently remembers if you have Advanced settings enabled.
This patch similarly remembers the Restrict to image ratio option
(Basic view) and the chosen Ratio (Advanced view).
Given how we store the ratios, and allow custom ratios using the same
combobox, we need to store both the current index of the combobox and
the ratio values.
I have removed CropTool::onWidgetSlidedIn because all it did was
ensure the crop rect was set, and we now always load a crop ratio
triggering the rect to update. If we leave it in, it actually resets
the rect after the saved ratio is loaded.
Note that if you enable the crop tool, then go to next image, any
changes will not be saved, including Advanced settings. This is
because the config is only saved when the tool is deactivated,
which is not triggered in this case.
Depends on D11202
BUG: 391757
Reimplement function now needed again, fix bug, add const
Save blank ratio combobox instead of last chosen ratio (if it's blank)
Crop ratio combobox is now saved properly
Test Plan:
Change ratio constraint with checkbox in Basic or the combobox
in Advanced. Ensure changes are saved after closing the crop tool
and closing Gwenview entirely.
Reviewers: Gwenview, rkflx
Reviewed By: Gwenview, rkflx
Differential Revision: https://phabricator.kde.org/D11378