As suggested in http://bugs.kde.org/show_bug.cgi?id=237922 I'm
sending a patch here as well.
Problem:
It's very hard to understand on the network monitor plasmoid which
line is download and which is upload speed. They also stack and
this is not really usual for this kind of graphs.
Solution:
Change colors and make graphs not stacked.
Attached patch implements it.
--
Sergey
diff -ur system-monitor/net.cpp system-monitor-new/net.cpp
--- system-monitor/net.cpp 2010-05-17 07:15:02.000000000 +0300
+++ system-monitor-new/net.cpp 2010-05-17 11:00:53.000000000 +0300
@@ -93,7 +93,8 @@
SM::Plotter *plotter = new SM::Plotter(this);
plotter->setTitle(interface);
plotter->setUnit("KiB/s");
- plotter->setPlotCount(2);
+ plotter->setPlotCount(2, QList<QColor>() << QColor("#00f000") << QColor("#f00000"));
+ plotter->setStackPlots(false);
appendPlotter(interface, plotter);
connectSource("network/interfaces/" + interface + "/receiver/data");
setPreferredItemHeight(80);
diff -ur system-monitor/plotter.h system-monitor-new/plotter.h
--- system-monitor/plotter.h 2010-05-17 07:15:02.000000000 +0300
+++ system-monitor-new/plotter.h 2010-05-17 11:00:45.000000000 +0300
@@ -46,8 +46,9 @@
const QString& title();
void setTitle(const QString& title);
void setUnit(const QString& unit);
- void setPlotCount(int count);
+ void setPlotCount(int count, const QList<QColor> colors = QList<QColor>());
void setScale(qreal scale);
+ void setStackPlots(bool stack);
protected slots:
void themeChanged();
diff -ur system-monitor/plotter.cpp system-monitor-new/plotter.cpp
--- system-monitor/plotter.cpp 2010-05-17 07:15:02.000000000 +0300
+++ system-monitor-new/plotter.cpp 2010-05-17 11:00:38.000000000 +0300
@@ -102,18 +102,29 @@
m_plotter->scale(scale);
}
+void Plotter::setStackPlots(bool stack)
+{
+ m_plotter->setStackPlots(stack);
+}
+
-void Plotter::setPlotCount(int count)
+void Plotter::setPlotCount(int count, const QList<QColor> colors)
{
for (int i = 0; i < m_plotCount; ++i) {
m_plotter->removePlot(0);
}
m_plotCount = count;
- Plasma::Theme* theme = Plasma::Theme::defaultTheme();
- QColor text = theme->color(Plasma::Theme::TextColor);
- QColor bg = theme->color(Plasma::Theme::BackgroundColor);
- for (int i = 0; i < m_plotCount; ++i) {
- QColor color = KColorUtils::tint(text, bg, 0.4 + ((double)i / 2.5));
- m_plotter->addPlot(color);
+ if (count == colors.count()) {
+ foreach (QColor color, colors) {
+ m_plotter->addPlot(color);
+ }
+ } else {
+ Plasma::Theme* theme = Plasma::Theme::defaultTheme();
+ QColor text = theme->color(Plasma::Theme::TextColor);
+ QColor bg = theme->color(Plasma::Theme::BackgroundColor);
+ for (int i = 0; i < m_plotCount; ++i) {
+ QColor color = KColorUtils::tint(text, bg, 0.4 + ((double)i / 2.5));
+ m_plotter->addPlot(color);
+ }
}
}
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel