[Applet]Fix dimensions of traffic Monitor
ClosedPublic

Authored by gvgeo on Feb 14 2020, 6:29 AM.

Details

Summary

Remove top margin.
Workaround to get paintedheight for label. (Undefined or paintedheight
does not work.)
Base plotter's top margin on labels size.
Add small spacing at the bottom.
Add 0 value.
Align labels to the right.

Test Plan

Before


After

Diff Detail

Repository
R116 Plasma Network Management Applet
Branch
monitor (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 22578
Build 22596: arc lint + arc unit
gvgeo created this revision.Feb 14 2020, 6:29 AM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 14 2020, 6:29 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
gvgeo requested review of this revision.Feb 14 2020, 6:29 AM
gvgeo edited the test plan for this revision. (Show Details)Feb 14 2020, 6:36 AM
gvgeo edited the test plan for this revision. (Show Details)
gvgeo edited the summary of this revision. (Show Details)
broulik added inline comments.
applet/contents/ui/TrafficMonitor.qml
42–43

Always Math.round when you doing random fractions of sizes

46

You can set it to undefiend to reset the height

64–65

Ideally we didn't randomly divide random sizes

gvgeo updated this revision to Diff 75670.EditedFeb 14 2020, 10:44 AM
gvgeo edited the summary of this revision. (Show Details)

Changes:
Added O value and aligned to the right.
Used Math.round
Made the plot's topMargin more specific. (Need to alling lines with labels)
Made comment more clear.

About the label workaround:
It is the complete opposite problem of PlasmaComponents checkboxes, where label cannot take implicitHeight.
Here it always takes implicitHeight with undefined or paintedheight.

gvgeo updated this revision to Diff 75770.EditedFeb 16 2020, 2:53 PM
gvgeo marked 3 inline comments as done.

Remove double space.

ngraham added inline comments.
applet/contents/ui/TrafficMonitor.qml
64–65

We could probably just use a smaller predefined unit, like largeSpacing, instead of coming up with a semi-random-looking value derived from the label height

jgrulich accepted this revision.Feb 17 2020, 2:17 PM

Accepting from my side. I'll wait for Nate to do the final review as I don't consider myself expert to QML and UI.

This revision is now accepted and ready to land.Feb 17 2020, 2:17 PM
gvgeo updated this revision to Diff 75832.Feb 17 2020, 2:35 PM

Added comment.

Hope it is not semi-random-looking anymore.

ngraham accepted this revision.Feb 18 2020, 4:36 AM

LGTM!

This revision was automatically updated to reflect the committed changes.