Make toolbar color configurable

Not generally useful but allows one to make the toolbar
menu and titlebar match for a more pleasing general effect.
Most users will not use this I imagine and use the default
window colors.
This commit is contained in:
Mark Liversedge
2011-05-15 21:35:21 +01:00
parent c7e0d4ed8c
commit 4801fc0b87
5 changed files with 30 additions and 2 deletions

View File

@@ -175,6 +175,12 @@ MainWindow::MainWindow(const QDir &home) :
#ifndef Q_OS_MAC
toolbar->setContentsMargins(0,0,0,0);
toolbar->setAutoFillBackground(true);
QPalette pal;
//pal.setColor(QPalette::Button, QColor(60,59,55));
pal.setColor(QPalette::Window, GColor(CTOOLBAR));
pal.setColor(QPalette::Button, GColor(CTOOLBAR));
toolbar->setPalette(pal);
toolbar->setMovable(false);
#else
QIcon tickIcon(":images/toolbar/main/tick.png");
QPushButton *showControls = new QPushButton(tickIcon, "", this);
@@ -1547,6 +1553,14 @@ MainWindow::notifyConfigChanged()
QMessageBox::warning(this, tr("Reading HR Zones File"), hrzones_->warningString());
}
// update the toolbar color if not Mac
#ifndef Q_OS_MAC
QPalette pal;
pal.setColor(QPalette::Window, GColor(CTOOLBAR));
pal.setColor(QPalette::Button, GColor(CTOOLBAR));
toolbar->setPalette(pal);
#endif
// now tell everyone else
configChanged();
}