- Use QFontMetrics::horizontalAdvance(text) instead of QFontMetrics::boundingRect(text).width(), since it obtains a more precise value over the width of a text.
- Allow word wrap in section titles.
Details
- Reviewers
cullmann dhaumann - Group Reviewers
KTextEditor - Commits
- R39:11ebecd1f795: KateModeMenuList: improve word wrap
Diff Detail
- Repository
- R39 KTextEditor
- Branch
- improve-word-wrap
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 18225 Build 18243: arc lint + arc unit
It's hard to review all the pixel changes with no screenshots. It's even unclear to me what problem exactly is fixed at hand. Given it's all your code, I trust you know what you are doing...
QFontMetrics::boundingRect(text).width() doesn't deliver an exact value of the text width, since I detected that in some translations and some desktop themes the text goes below the scroll bar. This problem doesn't exist with QFontMetrics::horizontalAdvance(text).
For example, in the "Fusion" application style, with Portuguese language, it may be incorrectly seen:
Before / After
Good, fine with me.
Related: Maybe the translation should also be shorter, but the general possible problem persists. Please go ahead.
- Increase the menu size according to the font size, to improve the display
This achieves a better visualization if the user increases the font size in the Plasma preferences.