D6679: Treat Button/ToolButton labels as plaintext
This revision was automatically updated to reflect the committed changes. fvogt marked an inline comment as done. Closed by commit R242:48a8245db4d8: Treat Button/ToolButton labels as plaintext (authored by fvogt). REPOSITORY R242 Plasma Framework (Library) CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D6679?vs=16649=17174 REVISION DETAIL https://phabricator.kde.org/D6679 AFFECTED FILES src/declarativeimports/plasmastyle/ButtonStyle.qml src/declarativeimports/plasmastyle/ToolButtonStyle.qml src/declarativeimports/plasmastyle/private/Util.js To: fvogt, #plasma, broulik, davidedmundson Cc: plasma-devel, #frameworks, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
D6679: Treat Button/ToolButton labels as plaintext
davidedmundson accepted this revision. This revision is now accepted and ready to land. REPOSITORY R242 Plasma Framework (Library) BRANCH master REVISION DETAIL https://phabricator.kde.org/D6679 To: fvogt, #plasma, broulik, davidedmundson Cc: plasma-devel, #frameworks, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
D6679: Treat Button/ToolButton labels as plaintext
fvogt marked an inline comment as done. fvogt added inline comments. INLINE COMMENTS > broulik wrote in ToolButtonStyle.qml:100 > `Text.StyledText` I think the priority queue in my brain is somehow backwards REPOSITORY R242 Plasma Framework (Library) REVISION DETAIL https://phabricator.kde.org/D6679 To: fvogt, #plasma, broulik Cc: plasma-devel, #frameworks, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
D6679: Treat Button/ToolButton labels as plaintext
fvogt updated this revision to Diff 16649. fvogt added a comment. Fix typo in ToolButtonStyle REPOSITORY R242 Plasma Framework (Library) CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D6679?vs=16648=16649 BRANCH master REVISION DETAIL https://phabricator.kde.org/D6679 AFFECTED FILES src/declarativeimports/plasmastyle/ButtonStyle.qml src/declarativeimports/plasmastyle/ToolButtonStyle.qml src/declarativeimports/plasmastyle/private/Util.js To: fvogt, #plasma, broulik Cc: plasma-devel, #frameworks, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
D6679: Treat Button/ToolButton labels as plaintext
broulik added a comment. +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) INLINE COMMENTS > ToolButtonStyle.qml:100 > +text: > Util.stylizeEscapedMnemonics(Util.toHtmlEscaped(control.text)) > +textFormat: Text.styledText > font: control.font || theme.defaultFont `Text.StyledText` REPOSITORY R242 Plasma Framework (Library) REVISION DETAIL https://phabricator.kde.org/D6679 To: fvogt, #plasma, broulik Cc: plasma-devel, #frameworks, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
D6679: Treat Button/ToolButton labels as plaintext
fvogt created this revision. Restricted Application added projects: Plasma, Frameworks. Restricted Application added a subscriber: Frameworks. REVISION SUMMARY 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. TEST PLAN Ran a modified knotificationdbustest with "&" and "actio" as actions. Result: http://i.imgur.com/xHifDBu.png REPOSITORY R242 Plasma Framework (Library) BRANCH master REVISION DETAIL https://phabricator.kde.org/D6679 AFFECTED FILES src/declarativeimports/plasmastyle/ButtonStyle.qml src/declarativeimports/plasmastyle/ToolButtonStyle.qml src/declarativeimports/plasmastyle/private/Util.js To: fvogt, #plasma, broulik Cc: plasma-devel, #frameworks, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas