Systemmonitor: use different label format when the applet is on a vertical panel
ClosedPublic

Authored by miklosm on May 13 2018, 11:12 PM.

Details

Summary

When the applet is on a vertical panel, its horizontal size is limited, and the speedLabel clashes with the name label. I fixed that by moving the speed values below the sensor name in this case.

I also added some cleanups unintentionally (the first three hunks), as I couldn't find a way to change the diff after it's submitted. They remove an unneeded import, and fix some uninitialized variable warnings. Feel free to ignore them.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
miklosm created this revision.May 13 2018, 11:12 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 13 2018, 11:12 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
miklosm requested review of this revision.May 13 2018, 11:12 PM
mart accepted this revision.May 16 2018, 10:14 AM
mart added a subscriber: mart.

ship it with a minor change

applets/systemmonitor/cpu/contents/ui/cpu.qml
45

CPU usage should be removed from the context as this is now used for different things?

This revision is now accepted and ready to land.May 16 2018, 10:14 AM
miklosm added inline comments.Jun 4 2018, 12:50 PM
applets/systemmonitor/cpu/contents/ui/cpu.qml
45

It's used for the same things as before. The only change is that this function no longer formats the whole label, just returns the string that goes into the label.

The other widgets don't specify this much info in the context, so it can be trimmed. I don't know how many translations need to be updated though.

Screenshots of how the network monitor looks like on a vertical panel:
Before:


After:

Do you need someone to land this for you, Miklós?

Do you need someone to land this for you, Miklós?

Yes, please.

This doesn't apply for me (conflict in Applet.qml); could you rebase on master?

miklosm updated this revision to Diff 35855.Jun 8 2018, 8:33 PM

Rebased on current master

BTW the updateInterval, which caused the conflict, is not as useful as it sounds, because the data source sends new data at a fixed 1Hz frequency.

Thanks! For your next patch, consider using arc instead of the web UI, which makes reviewing and landing a lot easier for us. :-)

See https://community.kde.org/Infrastructure/Phabricator#Using_Arcanist

This revision was automatically updated to reflect the committed changes.