[Libreoffice-ux-advise] [LibreOffice] find ctrl-g/ctrl-shift-g accelerator patch

Jan Holesovsky kendy at suse.cz
Tue Mar 6 02:20:02 PST 2012


Hi Cameron,

This is some good research, I hope you don't mind if I CC: the devel
mailing list, and the UX advise list too? :-)

On 2012-03-05 at 16:41 -0500, Cameron Paul wrote:

> It turns out I was mistaken. I was only able to move .uno:RepeatSearch
> to ctrl-g. Using .uno:DownSearch or .uno:UpSearch did nothing. I
> suspect this is because those events need some data source telling
> them what to search for, and that data isn't present when the find bar
> is closed. I have attached a patch that simply moves .uno:RepeatSearch
> from F_SHIFT_MOD1 to G_MOD1. This does cause some inconsistent
> behavior though since ctrl-g will be RepeatSearch when the document is
> selected and DownSearch when the toolbar is selected.

Yes, this is not ideal.

> I think an ideal solution would be one where RepeatSearch could remain
> at F_SHIFT_MOD1, and DownSearch/UpSearch simply be added to
> G_MOD1/G_SHIFT_MOD1. This would allow us to keep all 3 functions bound
> to shortcuts and avoid confusing anyone who already knows the
> ctrl-shift-f shortcut. Unfortunately it is not immediately obvious to
> me how to implement it like this.

I think this is actually a good question for the UX advise list :-)  My
proposal would be to get rid of the RepeatSearch functionality (and
consequently of Ctrl-Shift-f), and let only DownSearch and UpSearch -
more consistency, and more control for the user.  RepeatSearch it is not
accessible from the menu, so I'd expect that not that many people will
know that - but of course some hard data would be good here.

So - if the UX advise guys agree, I'd try to make DownSearch and
UpSearch working even without the toolbar active.  The code for
RepeatSearch is here:

sw/source/ui/uiview/viewsrch.cxx

The code for Up/DownSearch here:

svx/source/tbxctrls/tbunosearchcontrollers.cxx
[DownSearchToolboxController::execute()]

I'd try to look if the control flow gets to the ::execute() when you
bind Ctrl-g to .uno:DownSearch and use it in the document.  If yes, then
it might be only a matter of checking why exactly it does nothing.  Of
course, if the control flow does not get there at all, it is for deeper
investigation - I'd then try to spot differences between what is
happening in the .uno:RepeatSearch and .uno:DownSearch case.  If it gets
more complicated, please let me know; but hopefully it'll be OK.

> As for the accelerators not working when a text area in a menu bar is
> selected, I think that might be a bigger problem. For example, this
> also prevents things like ctrl-s saving a document, which could
> potentially lead to data loss if someone doesn't know their work is
> not being saved. I don't know what changing that would actually
> involve, but I would be happy to work on it if people want that
> modification.

Good point!  I have just checked, and it is a more general problem -
when you try that in eg. the 'Font size' combobox, you cannot do Ctrl-s
either.  Should I file an easy hack for that, or will you try to
investigate this one too? :-)

All the best,
Kendy



More information about the Libreoffice-ux-advise mailing list