From 64045dbddc14a110cc9efc5f6452138024a17da2 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Mon, 14 Jan 2019 14:37:16 -0700 Subject: [PATCH] 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 --- .../common/contents/ui/DoublePlotter.qml | 13 ++++++++++--- applets/systemmonitor/net/contents/ui/net.qml | 5 +---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/applets/systemmonitor/common/contents/ui/DoublePlotter.qml b/applets/systemmonitor/common/contents/ui/DoublePlotter.qml index c513c0776..24502384e 100644 --- a/applets/systemmonitor/common/contents/ui/DoublePlotter.qml +++ b/applets/systemmonitor/common/contents/ui/DoublePlotter.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(" %2 | %4", + downloadColor, + formatData(data1), + uploadColor, + formatData(data2)) } else { nameLabel.text = plotter.sensorName+ "\n" + formatData(data1) + "\n" + formatData(data2) speedLabel.text = "" diff --git a/applets/systemmonitor/net/contents/ui/net.qml b/applets/systemmonitor/net/contents/ui/net.qml index 2af507428..67e30bb8d 100644 --- a/applets/systemmonitor/net/contents/ui/net.qml +++ b/applets/systemmonitor/net/contents/ui/net.qml @@ -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); } } }