Skip to content
Commit c1e227f1 authored by Huon Imberger's avatar Huon Imberger
Browse files

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 {nav Basic} or the combobox
in {nav 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
parent 576cfa68
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment