[Task Manager] Elide context menu entries
ClosedPublic

Authored by broulik on Aug 7 2017, 12:45 PM.

Details

Summary

QMenu doesn't really support maximumWidth. The window's size would be limited but its content just cut off rather than nicely elided.
Instead, we manually elide in a crude way using TextMetrics.

Test Plan

Superseds D4281

Opened a file with a super long file name in kwrite, no longer caused the menu to become huge

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Aug 7 2017, 12:45 PM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 7 2017, 12:45 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
hein requested changes to this revision.Aug 8 2017, 7:19 PM
hein added inline comments.
applets/taskmanager/package/contents/ui/ContextMenu.qml
126

We can't hard-code "...". Different locales use different characters for text elision (e.g. an actual ellipsis, not three dots).

This revision now requires changes to proceed.Aug 8 2017, 7:19 PM
hein added a comment.Oct 24 2017, 7:12 AM

Kai, ping?

This revision was not accepted when it landed; it landed in state Needs Revision.Apr 24 2018, 10:14 PM
This revision was automatically updated to reflect the committed changes.