# HG changeset patch # User unc0rr # Date 1225041427 0 # Node ID 2b45d88716b0c6d2bea512c94e3c8a2861c58143 # Parent c23fa62f7c46f6456919be28e4bee9d20a7fcff8 - Some work on team select widget look - Fix IconedGroupBox drawing logic diff -r c23fa62f7c46 -r 2b45d88716b0 QTfrontend/frameTeam.cpp --- a/QTfrontend/frameTeam.cpp Sun Oct 26 15:02:55 2008 +0000 +++ b/QTfrontend/frameTeam.cpp Sun Oct 26 17:17:07 2008 +0000 @@ -25,10 +25,10 @@ #include "hwconsts.h" FrameTeams::FrameTeams(QWidget* parent) : - QWidget(parent), maxHedgehogsPerGame(18), overallHedgehogs(0), mainLayout(this), nonInteractive(false) + QFrame(parent), maxHedgehogsPerGame(18), overallHedgehogs(0), mainLayout(this), nonInteractive(false) { QPalette newPalette = palette(); - newPalette.setColor(QPalette::Window, QColor(0x13, 0x0f, 0x2c)); + newPalette.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00)); setPalette(newPalette); setAutoFillBackground(true); diff -r c23fa62f7c46 -r 2b45d88716b0 QTfrontend/frameTeam.h --- a/QTfrontend/frameTeam.h Sun Oct 26 15:02:55 2008 +0000 +++ b/QTfrontend/frameTeam.h Sun Oct 26 17:17:07 2008 +0000 @@ -19,13 +19,13 @@ #ifndef _FRAME_TEAM_INCLUDED #define _FRAME_TEAM_INCLUDED -#include +#include #include #include #include "teamselect.h" -class FrameTeams : public QWidget +class FrameTeams : public QFrame { Q_OBJECT diff -r c23fa62f7c46 -r 2b45d88716b0 QTfrontend/igbox.cpp --- a/QTfrontend/igbox.cpp Sun Oct 26 15:02:55 2008 +0000 +++ b/QTfrontend/igbox.cpp Sun Oct 26 17:17:07 2008 +0000 @@ -30,22 +30,25 @@ void IconedGroupBox::setIcon(const QIcon & icon) { + if (this->icon.isNull()) + setStyleSheet(QString( + "IconedGroupBox{" + "margin-top: 46px;" + "margin-left: 12px;" + "padding: 22px 0px 0px 0px;" + "}" + "IconedGroupBox::title{" + "subcontrol-origin: margin;" + "subcontrol-position: top left;" + "padding-left: %1px;" + "padding-top: 26px;" + "text-align: left;" + "}" + ).arg(padding) + ); + this->icon = icon; - setStyleSheet(QString( - "IconedGroupBox{" - "margin-top: 46px;" - "margin-left: 12px;" - "padding: 22px 0px 0px 0px;" - "}" - "IconedGroupBox::title{" - "subcontrol-origin: margin;" - "subcontrol-position: top left;" - "padding-left: %1px;" - "padding-top: 26px;" - "text-align: left;" - "}" - ).arg(padding) - ); + repaint(); } void IconedGroupBox::paintEvent(QPaintEvent * event) diff -r c23fa62f7c46 -r 2b45d88716b0 QTfrontend/teamselect.cpp --- a/QTfrontend/teamselect.cpp Sun Oct 26 15:02:55 2008 +0000 +++ b/QTfrontend/teamselect.cpp Sun Oct 26 17:17:07 2008 +0000 @@ -214,17 +214,31 @@ TeamSelWidget::TeamSelWidget(QWidget* parent) : QGroupBox(parent), mainLayout(this), m_acceptOuter(false) { - setTitle(QGroupBox::tr("Playing teams")); - framePlaying = new FrameTeams(); - frameDontPlaying = new FrameTeams(); - QPalette p; - p.setColor(QPalette::Window, QColor(0x13, 0x0f, 0x2c)); - addScrArea(framePlaying, p.color(QPalette::Window).light(105), 200); - addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 0); - QPushButton * btnSetup = new QPushButton(this); - btnSetup->setText(QPushButton::tr("Setup")); - connect(btnSetup, SIGNAL(clicked()), this, SIGNAL(SetupClicked())); - mainLayout.addWidget(btnSetup); + setTitle(QGroupBox::tr("Playing teams")); + framePlaying = new FrameTeams(); + framePlaying->setStyleSheet( + "FrameTeams{" + "border: solid;" + "border-width: 1px;" + "border-radius: 16px;" + "border-color: #ffcc00;" + "}" + ); + frameDontPlaying = new FrameTeams(); + frameDontPlaying->setStyleSheet( + "FrameTeams{" + "background-image: url(\":/res/panelbg.png\");" + "}" + ); + + QPalette p; + p.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00)); + addScrArea(framePlaying, p.color(QPalette::Window).light(105), 200); + addScrArea(frameDontPlaying, p.color(QPalette::Window).dark(105), 0); + QPushButton * btnSetup = new QPushButton(this); + btnSetup->setText(QPushButton::tr("Setup")); + connect(btnSetup, SIGNAL(clicked()), this, SIGNAL(SetupClicked())); + mainLayout.addWidget(btnSetup); } void TeamSelWidget::setAcceptOuter(bool acceptOuter) diff -r c23fa62f7c46 -r 2b45d88716b0 QTfrontend/teamselhelper.cpp --- a/QTfrontend/teamselhelper.cpp Sun Oct 26 15:02:55 2008 +0000 +++ b/QTfrontend/teamselhelper.cpp Sun Oct 26 17:17:07 2008 +0000 @@ -36,7 +36,7 @@ colorButt(0) { QPalette newPalette = palette(); - newPalette.setColor(QPalette::Window, QColor(0x13, 0x0f, 0x2c)); + newPalette.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00)); setPalette(newPalette); setAutoFillBackground(true);