The label text gets treated as RichText/StyledText, which is required
to display mnemonics underlined. Therefore it is necessary to manually
HTML escape the label text, which unfortunately breaks mnemonics as
escaped HTML contains ampersands.
This commit fixes that by introducing a custom function to stylize
mnemonics in HTML escaped text.
Details
Details
- Reviewers
broulik davidedmundson - Group Reviewers
Plasma - Commits
- R242:48a8245db4d8: Treat Button/ToolButton labels as plaintext
Ran a modified knotificationdbustest with "<h1>&&a&ction</h1>" and
"actio&n2" as actions. Result: http://i.imgur.com/xHifDBu.png
Diff Detail
Diff Detail
- Repository
- R242 Plasma Framework (Library)
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
+1
(for others reading this: Explicitly turning it into StyledText prevents Qt's AutoText from deciding to use PlainText in some cases which will then again look broken. Note that StyledText uses a basic string parser so it's nowhere near as heavy as RichText and should be fine)
Also note that QtQuick Controls Desktop style does not support HTML styling, so while this is a behavior change, I think it's fine and people shouldn't be using HTML formatting in buttons anyway.
src/declarativeimports/plasmastyle/ToolButtonStyle.qml | ||
---|---|---|
100 | Text.StyledText |
src/declarativeimports/plasmastyle/ToolButtonStyle.qml | ||
---|---|---|
100 | I think the priority queue in my brain is somehow backwards |