Improve up/down display for Monitor widgets

Summary: This patch improves the up/down display for the Monitor widgets

Test Plan:
Before, no activity: {F6549441}

After, no activity: {F6550787}

Before, some activity: {F6549443}

After, some activity: {F6550788}

All the other ones still look good or are improved: {F6550789}

Reviewers: #plasma, #vdg

Subscribers: abetts, davidedmundson, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D18255
wilder-broken-krunner
Nate Graham 7 years ago
parent 0885170daf
commit 64045dbddc
  1. 13
      applets/systemmonitor/common/contents/ui/DoublePlotter.qml
  2. 5
      applets/systemmonitor/net/contents/ui/net.qml

@ -54,12 +54,15 @@ KQuickAddons.Plotter {
return Qt.hsla(hue, saturation, lightness, 1.0);
}
property string downloadColor: theme.highlightColor
property string uploadColor: cycle(theme.highlightColor, -90)
dataSets: [
KQuickAddons.PlotData {
color: theme.highlightColor
color: downloadColor
},
KQuickAddons.PlotData {
color: cycle(theme.highlightColor, -90)
color: uploadColor
}
]
@ -99,7 +102,11 @@ KQuickAddons.Plotter {
if (plasmoid.formFactor != PlasmaCore.Types.Vertical) {
nameLabel.text = plotter.sensorName
speedLabel.text = formatData(data1) + " | " + formatData(data2)
speedLabel.text = i18n("<font color='%1'>⬇</font> %2 | <font color='%3'>⬆</font> %4",
downloadColor,
formatData(data1),
uploadColor,
formatData(data2))
} else {
nameLabel.text = plotter.sensorName+ "\n" + formatData(data1) + "\n" + formatData(data2)
speedLabel.text = ""

@ -48,10 +48,7 @@ Applet {
if (value > 1024) {
return i18nc("%1 is the displayed data transfer speed in kilobits per second", "%1 Kbps", (value / 1024));
}
if (value > 0) {
return i18nc("%1 is the displayed data transfer speed in bits per second", "%1 bps", value);
}
return value;
return i18nc("%1 is the displayed data transfer speed in bits per second", "%1 bps", value);
}
}
}

Loading…
Cancel
Save