Plasma style: Remove hardcoded textFormat

Authored by jbbgameich on Sep 9 2018, 1:49 AM.


Group Reviewers

This fixes all texts being displayed as Text.PlainText if not explicitly overriden.

Diff Detail

R242 Plasma Framework (Library)
Lint Skipped
Unit Tests Skipped
jbbgameich created this revision.Sep 9 2018, 1:49 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 9 2018, 1:49 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
jbbgameich requested review of this revision.Sep 9 2018, 1:49 AM
ngraham added a subscriber: ngraham.

Is there a reason for this change, or a bug report that it fixes? How have you tested this? Do any visual changes result from this patch? If so, are they all desirable? Etc. Some more information would be nice.

I think it is undesireable to change the default, because all users are now used to having it PlainText, so they are now dumping things-that-looks-like-html into it and expecting it to be plaintext.

so all users of Label that don't have textFormat set now needs to go add this line to their files.

I also remember some discussions about the default to AutoText might have been wrong on Qt Text things (items and widgets) but can't be changed because people rely on the defaults.

So please, no.

@ngraham I noticed the issue when using the QtQuickControls 2 style. All other styles I know don't require setting the textFormat, only the Plasma Style. Of course all QQC2 applications could just set the textFormat, but it's not possible in all cases. For example I don't think you can set the textFormat for a tooltip.

Without this patch the tooltip looks like this:

afterwards like this:

Maybe there's a better way to fix it than what I did here though ....

What app/plasmoid/widget is that a screenshot from? It might make more sense to just set the text format there, rather than universally.

P.S. you can attach screenshots to comments here so they appear inline.

@ngraham The screenshot is from Kaidan. It's using QtQuickControls 2 with the Plasma Style, so not PlasmaComponents direcltly. I don't think it's possible to set the textFormat for this tooltip in QtQuickControls 2 unfortunately.

@svuorela So it seems like applications using Plasma components directly could break with this patch and the existing QtQuickControls 2 applications are broken without it...

Should Applications really be using Plasma style and components? I think they probably should be using desktop QQC2 style via Kirigami instead.

On Plasma Mobile all applications use the Plasma Style for QtQuickControls 2. (kaidan is also a Plasma Mobile application)

davidedmundson accepted this revision.Sep 9 2018, 4:40 PM
davidedmundson added a subscriber: davidedmundson.

You're absolutely right this is wrong.


It is a crap default, but it shouldn't change per theme when a user is using Qqc2 directly. They might develop for this and then switch to desktop and then we have a big problem.

Fortunately few use this class yet.

Should Applications really be using Plasma style and components? I think they probably should be using desktop QQC2 style via Kirigami instead.

Kirigami doesn't wrap qqc. One still uses qqc directly. On the phone that means this component.

This revision is now accepted and ready to land.Sep 9 2018, 4:40 PM

@davidedmundson I'm not yet used to the KDE Phabricator workfolow... do I need to do anything else to get this patch landed / included?

I thought we did that consciously and intentionally since we could break compat here and the AutoText which tries to guess from the contents and even allows injecting img was something we wanted to avoid?

jbbgameich closed this revision.Nov 12 2019, 12:11 PM

I think this was fixed in another way already.