[KMessageBox] Only allow selecting text in the dialog box using the mouse
ClosedPublic

Authored by ngraham on Tue, Jan 14, 3:00 AM.

Details

Summary

Right now, when you select text in the dialog box, an insertion point appears. It never
disappears. This looks odd:

The insertion point allows you to navigate the text using the keyboard. But this is kind
of pointless since you have to use the mouse to make the insertion point appear in the
text in the first place, so you might as well just use the mouse to make the selection.

This patch makes the text only mouse-selectable. Dolphin recently did the same thing
for its Information Panel labels in D25241 for the same reason.

BUG: 416204
FIXED-IN: 5.67

Test Plan

Try to open 6 items at once in Dolphin and click-and-drag in the message box text.
Test is still selectable, but an insertion point is no longer created that cannot be
removed.

Diff Detail

Repository
R236 KWidgetsAddons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ngraham created this revision.Tue, Jan 14, 3:00 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptTue, Jan 14, 3:00 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ngraham requested review of this revision.Tue, Jan 14, 3:00 AM
ndavis accepted this revision.Tue, Jan 14, 4:08 AM
This revision is now accepted and ready to land.Tue, Jan 14, 4:08 AM

So you can't tab around to end up focusing the text field?

ndavis added a comment.EditedTue, Jan 14, 2:30 PM

So you can't tab around to end up focusing the text field?

You currently aren't able to, but after you click with the mouse on the text, you can use the arrow keys to move an I beam around in the text. This patch disables keyboard control after clicking with the mouse since it looks weird and is pretty pointless.

So you can't tab around to end up focusing the text field?

As Noah said, you already can't. This doesn't change anything about what you can focus with the tab key.

This revision was automatically updated to reflect the committed changes.

IMHO the proper fix is to make tabbing work, and to fix Qt not to show a caret when the label gets the focus via a mouse click.

Hmm, I'm not totally sure I agree. If the text becomes focusable by tabbing, then I think that just clutters up the focus chain with non-interactive UI elements that nobody is actually going to care about doing something with 99% of the time.