Adjust spacing between text and plotter line in Speed tab of nm applet
ClosedPublic

Authored by kamathraghavendra on Jan 29 2018, 6:14 PM.

Details

Summary

The text showing the speed of the download in the speed section of the plasma-nm applet was overlapping an sticking to the horizontal lines of the plotter.
the screen shot of the current spacing is as follows:

I increased the left margin of the graph and also added a line height to the text so that it appears centered with respect to the lines. I asked around the plasma IRC channel and according to @davidedmundson the lines don't correspond to the text, so in my opinion it is safe to make the lines and the text vertically centered to each other.

the screenshot after adding the spacing is as follows :

Note: Currently I have only increased the left margin of the graph to accommodated the text assuming the text won't go beyond 4-5 digit and will get converted to MiB from KiB automatically. Ideally this should be dynamic and the graph should auto adjust according to the longest text + margin, So any suggestion for making it that way is welcome.

Diff Detail

Repository
R116 Plasma Network Management Applet
Lint
Lint Skipped
Unit
Unit Tests Skipped
Restricted Application added a project: Plasma. · View Herald TranscriptJan 29 2018, 6:14 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kamathraghavendra requested review of this revision.Jan 29 2018, 6:14 PM

Looks good. +1

1 minor nitpick, but it's not super important.

applet/contents/ui/TrafficMonitor.qml
55

Semantically it's weird to use the size of an icon for a margin, unless you're trying to line up with an icon. There's a medium sized icon in the toolbar, which I assume is the intent here.

Can you rewrite this as "units.iconSizes.medium + largeSpacing"

Should equate to the same value, but self-documents what it's actually doing and handles a user changing icon sizes in the config file.

applet/contents/ui/TrafficMonitor.qml
55

Thank you very much for the pointer.

I tried adding the medium size with large spacing, but for some reason it returns empty value and the lines got overlapped

So I suggest a different method of using "units.gridUnit * 3" since everything else is also calculated with this property, it is suitable here I think. Also this returns to 54 while earlier the iconSizes.larger returned 48 , this is not harmful because we anyways wanted some more space to accommodate longer text.

So changing this to "units.gridUnit * 3" gave a reasonable space and it is independent of the icons size now. which gives the below result

ngraham accepted this revision.Jan 29 2018, 8:50 PM

QML and presentation look great to me!

This revision is now accepted and ready to land.Jan 29 2018, 8:50 PM
jgrulich accepted this revision.Feb 1 2018, 4:02 PM
This revision was automatically updated to reflect the committed changes.