diff -r 69df8f2a7cba -r 8650a8f55006 QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Sun Oct 26 14:45:07 2008 +0000 +++ b/QTfrontend/hwform.cpp Sun Oct 26 14:49:47 2008 +0000 @@ -31,6 +31,7 @@ #include #include #include +#include #include "hwform.h" #include "game.h" @@ -53,6 +54,8 @@ { ui.setupUi(this); + CustomizePalettes(); + ui.pageOptions->CBResolution->addItems(sdli.getResolutions()); config = new GameUIConfig(this, cfgdir->absolutePath() + "/hedgewars.ini"); @@ -147,28 +150,44 @@ } } +void HWForm::CustomizePalettes() +{ + QList allSBars = findChildren(); + QPalette pal = palette(); + pal.setColor(QPalette::WindowText, QColor(0xff, 0xcc, 0x00)); + pal.setColor(QPalette::Button, QColor(0x00, 0x35, 0x1d)); + pal.setColor(QPalette::Base, QColor(0x00, 0x35, 0x1d)); + pal.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00)); + + for (int i = 0; i < allSBars.size(); ++i) + allSBars.at(i)->setPalette(pal); +} + void HWForm::UpdateWeapons() { - // FIXME: rewrite this with boost (or TR1/0x) - QVector combos; - combos.push_back(ui.pageOptions->WeaponsName); - combos.push_back(ui.pageMultiplayer->gameCFG->WeaponsName); - combos.push_back(ui.pageNetGame->pGameCFG->WeaponsName); + // FIXME: rewrite this with boost (or TR1/0x) + QVector combos; + combos.push_back(ui.pageOptions->WeaponsName); + combos.push_back(ui.pageMultiplayer->gameCFG->WeaponsName); + combos.push_back(ui.pageNetGame->pGameCFG->WeaponsName); - for(QVector::iterator it=combos.begin(); it!=combos.end(); ++it) { - (*it)->clear(); - (*it)->addItems(ui.pageSelectWeapon->pWeapons->getWeaponNames()); - int pos=(*it)->findText("Default"); - if (pos!=-1) { - (*it)->setCurrentIndex(pos); - } - } + for(QVector::iterator it=combos.begin(); it!=combos.end(); ++it) { + (*it)->clear(); + (*it)->addItems(ui.pageSelectWeapon->pWeapons->getWeaponNames()); + int pos=(*it)->findText("Default"); + if (pos!=-1) { + (*it)->setCurrentIndex(pos); + } + } } void HWForm::NetWeaponNameChanged(const QString& name) { - QString ammo=ui.pageSelectWeapon->pWeapons->getWeaponsString(ui.pageNetGame->pGameCFG->WeaponsName->currentText()); - hwnet->onWeaponsNameChanged(name, ammo); + QString ammo = ui.pageSelectWeapon->pWeapons->getWeaponsString( + ui.pageNetGame->pGameCFG->WeaponsName->currentText() + ); + + hwnet->onWeaponsNameChanged(name, ammo); } void HWForm::UpdateTeamsLists(const QStringList* editable_teams)