Fix bug: select browse tool after trim select
Currently, there is the following bug: If we use "Trim To Selection" and make a selection, we get the correctly trimmed page, but the cursor is still in a "Trim To Selection" state.
The reason seems to be the following: After the selection is done, d->aMouseNormal->trigger();
is called (https://invent.kde.org/graphics/okular/-/blob/master/part/pageview.cpp#L2654). However, d->aMouseNormal
is still checked
, since the trim tool is not in the d->mouseModeActionGroup
(it just changes d->mouseMode
). Hence, the toggled()
signal is not called.
I am not sure, what is the best way to fix this bug. Also, Okular::Settings::EnumMouseMode::TrimSelect
is the only mouse mode, which does not correspond to an action in d->mouseModeActionGroup
. Maybe one should add such an action?
Btw, there seem to be several other issues in pageview.cpp
:
-
d->aPrevAction
is only set if we right-drag in the browse-mode to make a selection. Hence, many points in the code (e.g., https://invent.kde.org/graphics/okular/-/blob/master/part/pageview.cpp#L2651 or https://invent.kde.org/graphics/okular/-/blob/master/part/pageview.cpp#L2035 cannot be reached. -
d->aMouseNormal
is the only mouse-action whosetoggled
-signal is connected. However, since these actions belong to an exclusiveActionGroup
it might be more reasonable to usetriggered
?