die hardcoded colors, die!

svn path=/trunk/KDE/kdelibs/; revision=894466
This commit is contained in:
Marco Martin 2008-12-08 17:51:53 +00:00
parent dffbf7817c
commit 1d7144e6f7
2 changed files with 22 additions and 10 deletions

View File

@ -39,20 +39,31 @@
#include <kstandarddirs.h>
#include <plasma/svg.h>
#include <plasma/theme.h>
namespace Plasma
{
class SignalPlotterPrivate
{
public:
SignalPlotterPrivate()
: svgBackground(0)
{ }
public:
SignalPlotterPrivate()
: svgBackground(0)
{ }
~SignalPlotterPrivate()
{
}
~SignalPlotterPrivate()
{
}
void themeChanged()
{
Plasma::Theme *theme = Plasma::Theme::defaultTheme();
backgroundColor = theme->color(Theme::BackgroundColor);
verticalLinesColor = theme->color(Theme::TextColor);
verticalLinesColor.setAlphaF(0.4);
horizontalLinesColor = theme->color(Theme::TextColor);
horizontalLinesColor.setAlphaF(0.4);
}
int precision;
uint samples;
@ -116,14 +127,12 @@ SignalPlotter::SignalPlotter(QGraphicsItem *parent)
setMinimumSize(QSizeF(16, 16));
d->showVerticalLines = true;
d->verticalLinesColor = QColor("black");
d->verticalLinesDistance = 30;
d->verticalLinesScroll = true;
d->verticalLinesOffset = 0;
d->horizontalScale = 1;
d->showHorizontalLines = true;
d->horizontalLinesColor = QColor("black");
d->horizontalLinesCount = 5;
d->showLabels = true;
@ -132,7 +141,9 @@ SignalPlotter::SignalPlotter(QGraphicsItem *parent)
d->fillPlots = true;
d->svgBackground = 0;
d->backgroundColor = QColor(0, 0, 0);
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), SLOT(themeChanged()));
d->themeChanged();
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}

View File

@ -440,6 +440,7 @@ protected:
private:
SignalPlotterPrivate *const d;
Q_PRIVATE_SLOT(d, void themeChanged())
};
} // Plasma namespace