[KCM] Port to QQC2
ClosedPublic

Authored by ngraham on Sep 5 2018, 11:33 PM.

Details

Reviewers
drosca
Group Reviewers
Plasma
Maniphest Tasks
T7255: Audio Volume
Commits
R115:00026cee9ec8: [KCM] Port to QQC2
Summary

This patch ports the KCM to QQC2, which has the side effect of working around https://bugreports.qt.io/browse/QTBUG-70481 and improving the presentation for people using fractional Qt scale factors.

BUG: 397954
FIXED-IN: 5.16.0

Test Plan

All functionality tested still worked. No visual changes at 1x scale. With a fractional scale factor, it now looks good:

Diff Detail

Repository
R115 Plasma Audio Volume Applet
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
There are a very large number of changes, so older changes are hidden. Show Older Changes
ngraham requested review of this revision.Sep 5 2018, 11:33 PM
ngraham edited the test plan for this revision. (Show Details)Sep 5 2018, 11:35 PM
drosca added a comment.Sep 6 2018, 6:24 AM

I'd prefer to port it completely to QQC2. As it is now, in some files you just changed Labels with QQC2 import and in others you changed QQC1->QQC2 import while there are also other QQC items.

s/fix/work round/
Please use the commit message from one of the other patches that does this.

I repeatedly have to correct this meme spreading that QQC2 has any relevance to fractional scaling. It leads to other incorrect changes.

The only relevance is the text renderType which could be either on either QQC versions.
Our QQC2 desktop style happens to have a workaround.

ngraham updated this revision to Diff 42329.Sep 25 2018, 8:54 PM

Port (almost) entirely to QQC2

ngraham retitled this revision from [KCM] Port label-bearing controls to QQC2 to fix fractional scaling support to [KCM] Port (almost) entirely to QQC2.Sep 25 2018, 8:57 PM
ngraham edited the summary of this revision. (Show Details)
drosca requested changes to this revision.Sep 26 2018, 2:56 PM

There is ScrollView in QQC2 (since Qt 5.9), so please use it.
Also as @davidedmundson said, please edit the commit message.

This revision now requires changes to proceed.Sep 26 2018, 2:56 PM
ngraham planned changes to this revision.Sep 26 2018, 3:22 PM

There is ScrollView in QQC2 (since Qt 5.9), so please use it.

Ah, I see now that it's only available in QQC 2.2 and later. Will do.

Also as @davidedmundson said, please edit the commit message.

The commit message from from the patch title, which is now [KCM] Port (almost) entirely to QQC2. Does that still need adjustment?

ngraham updated this revision to Diff 42388.Sep 26 2018, 7:37 PM

Use QQC2 ScrollView and PlasmaCore iconItem

ngraham edited the summary of this revision. (Show Details)Sep 26 2018, 7:39 PM
ngraham edited the test plan for this revision. (Show Details)
drosca added inline comments.Sep 27 2018, 7:42 AM
src/kcm/package/contents/ui/CardListItem.qml
32–33

Plasma items should not be used in KCM.

Plasma items should not be used in KCM.

Hmm, what you you recommend then for showing an icon item? The old QIconItem breaks for fractional scale factors. Kirigami has a nice icon, but then we'd need to import Kirigami.

Plasma items should not be used in KCM.

Hmm, what you you recommend then for showing an icon item? The old QIconItem breaks for fractional scale factors. Kirigami has a nice icon, but then we'd need to import Kirigami.

I suggest to fix QIconItem, as it is used in other places too.

ngraham updated this revision to Diff 42512.Sep 28 2018, 5:51 PM
  • Rebase on master
  • Use Kirigami Icon instead of PlasmaCore IconItem
ngraham planned changes to this revision.Sep 28 2018, 5:54 PM
ngraham marked an inline comment as done.

Scrollviews in the tabs are now broken, investigating.

huftis added a subscriber: huftis.Oct 28 2018, 11:09 AM
ngraham updated this revision to Diff 49855.Jan 19 2019, 12:12 AM

Port entirely away from QQC1 by adopting the QQC2 TabBar

ngraham planned changes to this revision.Jan 19 2019, 12:13 AM
ngraham retitled this revision from [KCM] Port (almost) entirely to QQC2 to [KCM] Port to QQC2.
ngraham edited the summary of this revision. (Show Details)
ngraham edited the test plan for this revision. (Show Details)
ngraham retitled this revision from [KCM] Port to QQC2 to [WIP] [KCM] Port to QQC2.
ngraham edited the summary of this revision. (Show Details)
ngraham updated this revision to Diff 49859.Jan 19 2019, 3:13 AM
drosca requested changes to this revision.Jan 22 2019, 2:29 PM
drosca added inline comments.
src/kcm/package/contents/ui/Advanced.qml
32

This should be set where this item is used (main.qml).

40

anchors.fill: parent ?

src/kcm/package/contents/ui/main.qml
47

I don't really like those hardcodes, are you sure it won't break when using different QWidget style?

This revision now requires changes to proceed.Jan 22 2019, 2:29 PM
ngraham updated this revision to Diff 50066.Jan 22 2019, 3:06 PM
ngraham marked 2 inline comments as done.

Address some review comments

ngraham added inline comments.Jan 22 2019, 3:06 PM
src/kcm/package/contents/ui/main.qml
47

I don't like them either, but the only way we can get rid of them without making the presentation really ugly is if we fix the bugs listed in the comments, or else stick with the QQC1 TabView.

drosca accepted this revision.Jan 22 2019, 3:10 PM
This revision is now accepted and ready to land.Jan 22 2019, 3:10 PM
ngraham planned changes to this revision.Jan 22 2019, 3:21 PM

Thanks for the approval, but the scrollviews still don't actually scroll when the window is too small to fit all the content! I haven't been able to figure out why this is yet, so help would be appreciated if you have the time. :)

Thanks for the approval, but the scrollviews still don't actually scroll when the window is too small to fit all the content! I haven't been able to figure out why this is yet, so help would be appreciated if you have the time. :)

Right, sorry.

So first, revert the change where I suggested to replace width binding with anchors.fill: parent, that's wrong.
Second, try to set ScrollView.contentWidth to width of ColumnLayout and same for the height.

ngraham updated this revision to Diff 50088.Jan 23 2019, 3:21 AM

Make the scrollviews finally work!

This revision is now accepted and ready to land.Jan 23 2019, 3:21 AM
ngraham retitled this revision from [WIP] [KCM] Port to QQC2 to [KCM] Port to QQC2.Jan 23 2019, 3:22 AM
ngraham edited the summary of this revision. (Show Details)
ngraham edited the test plan for this revision. (Show Details)

@drosca, wanna do a final check to make sure you're good with everything?

ngraham updated this revision to Diff 50328.Jan 26 2019, 3:34 PM
ngraham edited the summary of this revision. (Show Details)

Update workaround comments to reflect the actual bugs

drosca accepted this revision.Jan 26 2019, 3:37 PM

I don't really like that this port became full of workarounds to be honest, but if it works and there's no other way then fine.

I understand and agree. We definitely need to fix https://bugs.kde.org/show_bug.cgi?id=394295 and https://bugs.kde.org/show_bug.cgi?id=394296 to make the QQC2 TabBar actually usable without all these client workarounds.

I'm okay with committing this now and removing the workarounds once those bugs are fixed, or waiting for those to get fixes first (provided it doesn't delay landing this patch forever). Your call.

apol added a subscriber: apol.Jan 27 2019, 4:21 AM

(Catching up with e-mail) did this fall through?

ngraham updated this revision to Diff 50385.Jan 27 2019, 4:44 PM

Correct comment again

This is working and ready to land, but there's still an option question regarding whether we want to commit it now with the hacky workarounds for https://bugs.kde.org/show_bug.cgi?id=394296, or fix those first and remove the workarounds before committing.

ngraham updated this revision to Diff 51556.Feb 12 2019, 10:12 PM

Remove all the hacks and do this right, once and for all

ngraham edited the test plan for this revision. (Show Details)Feb 12 2019, 10:12 PM
ngraham updated this revision to Diff 51557.Feb 12 2019, 10:17 PM

Remove more hacks and now-unnecessary changes

ngraham marked 2 inline comments as done.Feb 12 2019, 10:20 PM

OK, I think this is finally ready to land. No more hacks. @drosca and/or @davidedmundson, could you confirm?

drosca accepted this revision.Feb 13 2019, 7:42 AM

Looks good now!

This revision was automatically updated to reflect the committed changes.
victorr added a subscriber: victorr.EditedFeb 14 2019, 1:41 AM

Sorry.
Error.

What you're looking at was not touched in this patch. This patch only changed the category below it.

victorr added a comment.EditedFeb 14 2019, 3:29 AM

Sorry.
The build lost localization files.