Commit 4ca1e7e3 authored by George Vogiatzis's avatar George Vogiatzis Committed by Nate Graham

[Applet]Fix dimensions of traffic Monitor

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
{F8102889, inline=true, size=full}
After
{F8102890, inline=true, size=full}

Reviewers: #plasma, #vdg, jgrulich, ngraham

Reviewed By: #vdg, jgrulich, ngraham

Subscribers: ngraham, broulik, plasma-devel

Tags: #plasma

Maniphest Tasks: T10470

Differential Revision: https://phabricator.kde.org/D27391
parent 2efaecee
......@@ -28,18 +28,22 @@ Item {
property real txBytes: 0
property alias interval: timer.interval
height: visible ? plotter.height + units.gridUnit : 0
height: visible ? plotter.height + plotter.anchors.topMargin + units.smallSpacing : 0
Repeater {
model: 5
id: labels
model: 6
readonly property int labelHeight: theme.mSize(theme.smallestFont).height
PlasmaComponents.Label {
anchors {
left: parent.left
right: plotter.left
top: parent.top
topMargin: Math.round(units.gridUnit / 3) + (index * plotter.height / 5)
rightMargin: units.smallSpacing
topMargin: Math.round(index * plotter.height / 5)
}
height: paintedHeight
// Workaround to get paintedHeight. (Undefined or paintedheight does not work.)
height: labels.labelHeight
font.pointSize: theme.smallestFont.pointSize
lineHeight: 1.75
text: KCoreAddons.Format.formatByteSize(plotter.maxValue * (1 - index / 5)) + i18n("/s")
......@@ -57,7 +61,8 @@ Item {
leftMargin: units.gridUnit * 3
right: parent.right
top: parent.top
topMargin: units.gridUnit
// Align plotter lines with labels.
topMargin: Math.round(labels.labelHeight / 2)
}
width: units.gridUnit * 20
height: units.gridUnit * 8
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment