Merge pull request #4411 from a1batross/master

Now Bar Analyzer respects color scheme
This commit is contained in:
David Sansome 2014-06-19 09:12:59 +10:00
commit 428796b933
4 changed files with 9 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -25,7 +25,7 @@ BarAnalyzer::BarAnalyzer(QWidget* parent) : Analyzer::Base(parent, 8) {
// roof pixmaps don't depend on size() so we do in the ctor
m_bg = parent->palette().color(QPalette::Background);
QColor fg(0xff, 0x50, 0x70);
QColor fg(parent->palette().color(QPalette::Highlight).lighter(150));
double dr = double(m_bg.red() - fg.red()) /
(NUM_ROOFS - 1); //-1 because we start loop below at 0
@ -69,7 +69,9 @@ void BarAnalyzer::init() {
canvas_.fill(palette().color(QPalette::Background));
QPainter p(&m_pixBarGradient);
for (int x = 0, r = 0x40, g = 0x30, b = 0xff, r2 = 255 - r; x < height();
QColor rgb(palette().color(QPalette::Highlight));
for (int x = 0, r = rgb.red(), g = rgb.green(), b = rgb.blue(), r2 = 255 - r; x < height();
++x) {
for (int y = x; y > 0; --y) {
const double fraction = (double)y / height();

View File

@ -39,7 +39,7 @@ RainbowDashAnalyzer::RainbowDashAnalyzer(QWidget* parent)
available_rainbow_width_(0),
px_per_frame_(0),
x_offset_(0),
background_brush_(QColor(0x38, 0x88, 0x00)) {
background_brush_(QColor(0x0f, 0x43, 0x73)) {
memset(history_, 0, sizeof(history_));
for (int i = 0; i < kRainbowBands; ++i) {

View File

@ -38,12 +38,12 @@ class RainbowDashAnalyzer : public Analyzer::Base {
void resizeEvent(QResizeEvent* e);
private:
static const int kDashHeight = 30;
static const int kDashWidth = 54;
static const int kDashHeight = 33;
static const int kDashWidth = 53;
static const int kRainbowHeight = 16;
static const int kDashFrameCount = 1;
static const int kDashFrameCount = 16;
static const int kRainbowOverlap = 15;
static const int kSleepingDashHeight = 30;
static const int kSleepingDashHeight = 33;
static const int kHistorySize = 128;
static const int kRainbowBands = 6;