# HG changeset patch # User unc0rr # Date 1225032587 0 # Node ID 8650a8f55006b29f94f87187f7f3e71fb244dc5c # Parent 69df8f2a7cba1dec02d416ea1cb3cfb4246242b9 Set custom palette to scrollbars 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) diff -r 69df8f2a7cba -r 8650a8f55006 QTfrontend/hwform.h --- a/QTfrontend/hwform.h Sun Oct 26 14:45:07 2008 +0000 +++ b/QTfrontend/hwform.h Sun Oct 26 14:49:47 2008 +0000 @@ -96,6 +96,8 @@ void UpdateTeamsLists(const QStringList* editable_teams=0); void CreateGame(GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget, QString ammo); void closeEvent(QCloseEvent *event); + void CustomizePalettes(); + enum PageIDs { ID_PAGE_SETUP_TEAM = 0, ID_PAGE_SETUP = 1, diff -r 69df8f2a7cba -r 8650a8f55006 QTfrontend/teamselhelper.cpp --- a/QTfrontend/teamselhelper.cpp Sun Oct 26 14:45:07 2008 +0000 +++ b/QTfrontend/teamselhelper.cpp Sun Oct 26 14:49:47 2008 +0000 @@ -70,7 +70,7 @@ connect(colorButt, SIGNAL(clicked()), this, SLOT(changeTeamColor())); mainLayout.addWidget(colorButt); - phhoger=new CHedgehogerWidget(QImage(":/res/hh25x25.png"), this); + phhoger = new CHedgehogerWidget(QImage(":/res/hh25x25.png"), this); connect(phhoger, SIGNAL(hedgehogsNumChanged()), this, SLOT(hhNumChanged())); mainLayout.addWidget(phhoger); }