# HG changeset patch # User valnut # Date 1326705741 -3600 # Node ID fc52f7c22c9b056b152519725d2cc9f57aaa7c67 # Parent d4ad422831255da98ccd842b1291f1791fc76630 GCI task: season greetings diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/hedgewars.qrc --- a/QTfrontend/hedgewars.qrc Sun Jan 15 22:01:50 2012 -0500 +++ b/QTfrontend/hedgewars.qrc Mon Jan 16 10:22:21 2012 +0100 @@ -1,8 +1,11 @@ ../share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png - res/css/qt.css - res/css/chat.css + res/css/qt.css + res/css/chat.css + res/css/christmas.css + res/css/easter.css + res/css/birthday.css res/hh25x25.png res/hh25x25grey.png res/ammopic.png @@ -34,6 +37,9 @@ res/Multiplayer.png res/Trainings.png res/Background.png + res/BackgroundChristmas.png + res/BackgroundEaster.png + res/BackgroundBirthday.png res/Exit.png res/HedgewarsTitle.png res/LocalPlay.png @@ -95,6 +101,9 @@ res/iconRope.png res/dice.png res/Star.png + res/Flake.png + res/Egg.png + res/Confetti.png res/file_save.png res/file_demo.png res/chat_default.png diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/hwconsts.cpp.in --- a/QTfrontend/hwconsts.cpp.in Sun Jan 15 22:01:50 2012 -0500 +++ b/QTfrontend/hwconsts.cpp.in Mon Jan 16 10:22:21 2012 +0100 @@ -71,3 +71,6 @@ bool haveServer = ${HAVE_NETSERVER}; bool isDevBuild = ${HW_DEV}; + +int season = SEASON_NONE; +int years_since_foundation = 0; diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/hwconsts.h --- a/QTfrontend/hwconsts.h Sun Jan 15 22:01:50 2012 -0500 +++ b/QTfrontend/hwconsts.h Mon Jan 16 10:22:21 2012 +0100 @@ -56,24 +56,32 @@ extern bool haveServer; extern bool isDevBuild; + +//Current season, SEASON_NONE by default +extern int season; +//On the day of hedgewars birthday (Oct 31st) this variable is assigned +//with number of years past 2004 (foundation of hedgewars) +//Could be used to implement a text/graphic like "This is the xxth birthday of hedgewars" or similar +extern int years_since_foundation; + #endif #define HEDGEHOGS_PER_TEAM 8 #define AMMOLINE_DEFAULT_QT "939192942219912103223511100120100000021111010101111101" -#define AMMOLINE_DEFAULT_PROB "040504054160065554655446477657666666615551010111541111" +#define AMMOLINE_DEFAULT_PROB "040504054160065554655446477657666666615551010111541101" #define AMMOLINE_DEFAULT_DELAY "000000000000020550000004000700400000000022000000060000" -#define AMMOLINE_DEFAULT_CRATE "131111031211111112311411111111111111121111110111111111" +#define AMMOLINE_DEFAULT_CRATE "131111031211111112311411111111111111121111110111111101" -#define AMMOLINE_CRAZY_QT "999999999999999999299999999999999929999999990999999229" -#define AMMOLINE_CRAZY_PROB "111111011111111111111111111111111111111111110111111111" +#define AMMOLINE_CRAZY_QT "999999999999999999299999999999999929999999990999999209" +#define AMMOLINE_CRAZY_PROB "111111011111111111111111111111111111111111110111111101" #define AMMOLINE_CRAZY_DELAY "000000000000000000000000000000000000000000000000000000" -#define AMMOLINE_CRAZY_CRATE "131111031211111112311411111111111111121111010111111111" +#define AMMOLINE_CRAZY_CRATE "131111031211111112311411111111111111121111010111111101" #define AMMOLINE_PROMODE_QT "909000900000000000000900000000000000000000000000000000" #define AMMOLINE_PROMODE_PROB "000000000000000000000000000000000000000000000000000000" #define AMMOLINE_PROMODE_DELAY "000000000000020550000004000700400000000020000000000000" -#define AMMOLINE_PROMODE_CRATE "111111111111111111111111111111111111111110010111111111" +#define AMMOLINE_PROMODE_CRATE "111111111111111111111111111111111111111110010111111101" #define AMMOLINE_SHOPPA_QT "000000990000000000000000000000000000000000000000000000" #define AMMOLINE_SHOPPA_PROB "444441004424440221011212122242200000000200040001001100" @@ -81,20 +89,25 @@ #define AMMOLINE_SHOPPA_CRATE "111111111111111111111111111111111111111110110111111100" #define AMMOLINE_CLEAN_QT "101000900001000001100000000000000000000000000000100000" -#define AMMOLINE_CLEAN_PROB "040504054160065554655446477657666666615551010111541111" +#define AMMOLINE_CLEAN_PROB "040504054160065554655446477657666666615551010111541101" #define AMMOLINE_CLEAN_DELAY "000000000000000000000000000000000000000000000000000000" -#define AMMOLINE_CLEAN_CRATE "131111031211111112311411111111111111121111110111111111" +#define AMMOLINE_CLEAN_CRATE "131111031211111112311411111111111111121111110111111101" #define AMMOLINE_MINES_QT "000000990009000000030000000000000000000000000000000000" #define AMMOLINE_MINES_PROB "000000000000000000000000000000000000000000000000000000" #define AMMOLINE_MINES_DELAY "000000000000020550000004000700400000000020000000060000" -#define AMMOLINE_MINES_CRATE "111111111111111111111111111111111111111111110111111111" +#define AMMOLINE_MINES_CRATE "111111111111111111111111111111111111111111110111111101" #define AMMOLINE_PORTALS_QT "900000900200000000210000000000000011000009000000000000" -#define AMMOLINE_PORTALS_PROB "040504054160065554655446477657666666615551010111541111" +#define AMMOLINE_PORTALS_PROB "040504054160065554655446477657666666615551010111541101" #define AMMOLINE_PORTALS_DELAY "000000000000020550000004000700400000000020000000060000" -#define AMMOLINE_PORTALS_CRATE "131111031211111112311411111111111111121111110111111111" +#define AMMOLINE_PORTALS_CRATE "131111031211111112311411111111111111121111110111111101" +//Different seasons; assigned to season (int) +#define SEASON_NONE 0 +#define SEASON_CHRISTMAS 2 +#define SEASON_HWBDAY 4 +#define SEASON_EASTER 8 #define NETGAME_DEFAULT_PORT 46631 diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/main.cpp --- a/QTfrontend/main.cpp Sun Jan 15 22:01:50 2012 -0500 +++ b/QTfrontend/main.cpp Mon Jan 16 10:22:21 2012 +0100 @@ -26,6 +26,7 @@ #include #include #include +#include #include "hwform.h" #include "hwconsts.h" @@ -39,6 +40,50 @@ #include "CocoaInitializer.h" #endif + +//Determines the day of easter in year +//from http://aa.usno.navy.mil/faq/docs/easter.php,adapted to C/C++ +QDate calculateEaster(long year) +{ + int c, n, k, i, j, l, m, d; + + c = year/100; + n = year - 19*(year/19); + k = (c - 17)/25; + i = c - c/4 - (c - k)/3 + 19*n + 15; + i = i - 30*(i/30); + i = i - (i/28)*(1 - (i/28)*(29/(i + 1))*((21 - n)/11)); + j = year + year/4 + i + 2 - c + c/4; + j = j - 7*(j/7); + l = i - j; + m = 3 + (l + 40)/44; + d = l + 28 - 31*(m / 4); + + return QDate(year, m, d); +} + +//Checks season and assigns it to the variable season in "hwconsts.h" +void checkSeason() +{ + QDate date = QDate::currentDate(); + + //Christmas? + if (date.month() == 12 && date.daysInMonth() >= 24 + && date.daysInMonth() <= 26) + season = SEASON_CHRISTMAS; + //Hedgewars birthday? + else if (date.month() == 10 && date.daysInMonth() == 31) + { + season = SEASON_HWBDAY; + years_since_foundation = date.year() - 2004; + } + //Easter? + else if (calculateEaster(date.year()) == date) + season = SEASON_EASTER; + else + season = SEASON_NONE; +} + bool checkForDir(const QString & dir) { QDir tmpdir; @@ -244,11 +289,28 @@ #endif QString style = ""; + QString fname; + + checkSeason(); + //For each season, there is an extra stylesheet + //Todo: change background for easter and birthday + //(simply replace res/BackgroundBirthday.png and res/BackgroundEaster.png + //with an appropriate background + switch (season) + { + case SEASON_CHRISTMAS : fname = "christmas.css"; + break; + case SEASON_EASTER : fname = "easter.css"; + break; + case SEASON_HWBDAY : fname = "birthday.css"; + break; + default : fname = "qt.css"; + } // load external stylesheet if there is any - QFile extFile(dataMgr.findFileForRead("css/qt.css")); + QFile extFile(dataMgr.findFileForRead("css/" + fname)); - QFile resFile(":/res/css/qt.css"); + QFile resFile(":/res/css/" + fname); QFile & file = (extFile.exists()?extFile:resFile); diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/res/BackgroundBirthday.png Binary file QTfrontend/res/BackgroundBirthday.png has changed diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/res/BackgroundChristmas.png Binary file QTfrontend/res/BackgroundChristmas.png has changed diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/res/BackgroundEaster.png Binary file QTfrontend/res/BackgroundEaster.png has changed diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/res/Confetti.png Binary file QTfrontend/res/Confetti.png has changed diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/res/Egg.png Binary file QTfrontend/res/Egg.png has changed diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/res/Flake.png Binary file QTfrontend/res/Flake.png has changed diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/res/css/birthday.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/res/css/birthday.css Mon Jan 16 10:22:21 2012 +0100 @@ -0,0 +1,248 @@ +/****************************************************************************** + * + * CSS-like definition of Qt frontend appearance + * + ****************************************************************************** + * + * see http://doc.qt.nokia.com/4.5/stylesheet.html + * + ****************************************************************************** + * + * This file can be stored at different locations, but it will be read only + * once, based on first file found in this order: + * + * /Data/css/birthday.css + * /css/birthday.css + * (:/res/css/birthday.css) + * + *****************************************************************************/ + +HWForm,QDialog { +background-image: url(":/res/BackgroundBirthday.png"); +background-position: bottom center; +background-repeat: repeat-x; +background-color: #141250; +} + +* { +color: #ffcc00; +selection-background-color: #ffcc00; +selection-color: #00351d; +} + +a { color:#c8c8ff; } + +QLineEdit, QListWidget, QTableView, QTextBrowser, QSpinBox, QComboBox, +QComboBox QAbstractItemView, QMenu::item { +background-color: rgba(13, 5, 68, 70%); +} + +QComboBox::separator { +border: solid; border-width: 3px; border-color: #ffcc00; +} + +QPushButton, QListWidget, QTableView, QLineEdit, QHeaderView, +QTextBrowser, QSpinBox, QToolBox, QComboBox, +QComboBox QAbstractItemView, IconedGroupBox, +.QGroupBox, GameCFGWidget, TeamSelWidget, SelWeaponWidget, +QTabWidget::pane, QTabBar::tab { +border: solid; +border-width: 3px; +border-color: #ffcc00; +} + +QPushButton:hover, QLineEdit:hover, QListWidget:hover, +QSpinBox:hover, QToolBox:hover, QComboBox:hover { +border-color: yellow; +} + +QLineEdit, QListWidget,QTableView, QTextBrowser, +QSpinBox, QToolBox { +border-radius: 10px; +} + +QLineEdit, QLabel, QHeaderView, QListWidget, QTableView, +QSpinBox, QToolBox::tab, QComboBox, QComboBox QAbstractItemView, +IconedGroupBox, .QGroupBox, GameCFGWidget, TeamSelWidget, +SelWeaponWidget, QCheckBox, QRadioButton, QPushButton { +font: bold 13px; +} +SelWeaponWidget QTabWidget::pane, SelWeaponWidget QTabBar::tab:selected { +background-position: bottom center; +background-repeat: repeat-x; +background-color: #000000; +} +.QGroupBox,GameCFGWidget,TeamSelWidget,SelWeaponWidget { +background-position: bottom center; +background-repeat: repeat-x; +border-radius: 16px; +background-color: rgba(13, 5, 68, 70%); +padding: 6px; +} +/* Experimenting with PaintOnScreen and border-radius on IconedGroupBox children didn't work out well +IconedGroupBox QComboBox, IconedGroupBox QPushButton, IconedGroupBox QLineEdit, +IconedGroupBox QSpinBox { +border-radius: 0; +} +IconedGroupBox, IconedGroupBox *, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{" */ +IconedGroupBox, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{ +background-color: #130f2c; +} + + +QPushButton { +border-radius: 8px; +background-origin: margin; +background-position: top left; +background-color: rgba(18, 42, 5, 70%); +} + +QPushButton:pressed{ +border-color: white; +} + +QPushButton:focus { +outline: none; +} + + +QHeaderView { +border-radius: 0; +border-width: 0; +border-bottom-width: 3px; +background-color: #00351d; +} +QTableView { +alternate-background-color: #2f213a; +gridline-color: transparent; +} + +QTabBar::tab { +border-bottom-width: 0; +border-radius: 0; +border-top-left-radius: 6px; +border-top-right-radius: 6px; +padding: 3px; +} +QTabBar::tab:!selected { +color: #0d0544; +background-color: #ffcc00; +} +QSpinBox::up-button{ +background: transparent; +width: 16px; +height: 10px; +} + +QSpinBox::up-arrow { +image: url(":/res/spin_up.png"); +} + +QSpinBox::down-arrow { +image: url(":/res/spin_down.png"); +} + +QSpinBox::down-button { +background: transparent; +width: 16px; +height: 10px; +} + +QComboBox { +border-radius: 10px; +padding: 3px; +} +QComboBox:pressed{ +border-color: white; +} +QComboBox::drop-down{ +border: transparent; +width: 25px; +} +QComboBox::down-arrow { +image: url(":/res/dropdown.png"); +} + +VertScrArea { +background-position: bottom center; +background-repeat: repeat-x; +} + +IconedGroupBox { +border-radius: 16px; +padding: 2px; +} + +QGroupBox::title{ +subcontrol-origin: margin; +subcontrol-position: top left; +text-align: left; +left: 15px; +top: -4px; +} + +QCheckBox::indicator:checked{ +image: url(":/res/checked.png"); +} +QCheckBox::indicator:unchecked{ +image: url(":/res/unchecked.png"); +} + +.QWidget{ +background: transparent; +} + +QTabWidget::pane { +border-top-width: 2px; +} + +QMenu{ +background-color: #ffcc00; +margin: 3px; +} +QMenu::item { +background-color: #0d0544; +border: 1px solid transparent; +font: bold; +padding: 2px 25px 2px 20px; +} +QMenu::item:selected { +background-color: #2d2564; +} +QMenu::indicator { +width: 16px; +height: 16px; +} +QMenu::indicator:non-exclusive:checked{ +image: url(":/res/checked.png"); +} +QMenu::indicator:non-exclusive:unchecked{ +image: url(":/res/unchecked.png"); +} + +QToolTip{ +background-color: #0d0544; +border: 1px solid #ffcc00; +} + +:disabled{ +color: #a0a0a0; +} +SquareLabel, ItemNum { +background-color: #000000; +} + +QSlider::groove::horizontal { +height: 2px; +margin: 2px 0px; +background-color: #ffcc00; +} + +QSlider::handle::horizontal { +border: 0px; +margin: -2px 0px; +border-radius: 3px; +background-color: #ffcc00; +width: 8px; +} + diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/res/css/christmas.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/res/css/christmas.css Mon Jan 16 10:22:21 2012 +0100 @@ -0,0 +1,248 @@ +/****************************************************************************** + * + * CSS-like definition of Qt frontend appearance + * + ****************************************************************************** + * + * see http://doc.qt.nokia.com/4.5/stylesheet.html + * + ****************************************************************************** + * + * This file can be stored at different locations, but it will be read only + * once, based on first file found in this order: + * + * /Data/css/christmas.css + * /css/christmas.css + * (:/res/css/christmas.css) + * + *****************************************************************************/ + +HWForm,QDialog { +background-image: url(":/res/BackgroundChristmas.png"); +background-position: bottom center; +background-repeat: repeat-x; +background-color: #141250; +} + +* { +color: #ffcc00; +selection-background-color: #ffcc00; +selection-color: #00351d; +} + +a { color:#c8c8ff; } + +QLineEdit, QListWidget, QTableView, QTextBrowser, QSpinBox, QComboBox, +QComboBox QAbstractItemView, QMenu::item { +background-color: rgba(13, 5, 68, 70%); +} + +QComboBox::separator { +border: solid; border-width: 3px; border-color: #ffcc00; +} + +QPushButton, QListWidget, QTableView, QLineEdit, QHeaderView, +QTextBrowser, QSpinBox, QToolBox, QComboBox, +QComboBox QAbstractItemView, IconedGroupBox, +.QGroupBox, GameCFGWidget, TeamSelWidget, SelWeaponWidget, +QTabWidget::pane, QTabBar::tab { +border: solid; +border-width: 3px; +border-color: #ffcc00; +} + +QPushButton:hover, QLineEdit:hover, QListWidget:hover, +QSpinBox:hover, QToolBox:hover, QComboBox:hover { +border-color: yellow; +} + +QLineEdit, QListWidget,QTableView, QTextBrowser, +QSpinBox, QToolBox { +border-radius: 10px; +} + +QLineEdit, QLabel, QHeaderView, QListWidget, QTableView, +QSpinBox, QToolBox::tab, QComboBox, QComboBox QAbstractItemView, +IconedGroupBox, .QGroupBox, GameCFGWidget, TeamSelWidget, +SelWeaponWidget, QCheckBox, QRadioButton, QPushButton { +font: bold 13px; +} +SelWeaponWidget QTabWidget::pane, SelWeaponWidget QTabBar::tab:selected { +background-position: bottom center; +background-repeat: repeat-x; +background-color: #000000; +} +.QGroupBox,GameCFGWidget,TeamSelWidget,SelWeaponWidget { +background-position: bottom center; +background-repeat: repeat-x; +border-radius: 16px; +background-color: rgba(13, 5, 68, 70%); +padding: 6px; +} +/* Experimenting with PaintOnScreen and border-radius on IconedGroupBox children didn't work out well +IconedGroupBox QComboBox, IconedGroupBox QPushButton, IconedGroupBox QLineEdit, +IconedGroupBox QSpinBox { +border-radius: 0; +} +IconedGroupBox, IconedGroupBox *, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{" */ +IconedGroupBox, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{ +background-color: #130f2c; +} + + +QPushButton { +border-radius: 8px; +background-origin: margin; +background-position: top left; +background-color: rgba(18, 42, 5, 70%); +} + +QPushButton:pressed{ +border-color: white; +} + +QPushButton:focus { +outline: none; +} + + +QHeaderView { +border-radius: 0; +border-width: 0; +border-bottom-width: 3px; +background-color: #00351d; +} +QTableView { +alternate-background-color: #2f213a; +gridline-color: transparent; +} + +QTabBar::tab { +border-bottom-width: 0; +border-radius: 0; +border-top-left-radius: 6px; +border-top-right-radius: 6px; +padding: 3px; +} +QTabBar::tab:!selected { +color: #0d0544; +background-color: #ffcc00; +} +QSpinBox::up-button{ +background: transparent; +width: 16px; +height: 10px; +} + +QSpinBox::up-arrow { +image: url(":/res/spin_up.png"); +} + +QSpinBox::down-arrow { +image: url(":/res/spin_down.png"); +} + +QSpinBox::down-button { +background: transparent; +width: 16px; +height: 10px; +} + +QComboBox { +border-radius: 10px; +padding: 3px; +} +QComboBox:pressed{ +border-color: white; +} +QComboBox::drop-down{ +border: transparent; +width: 25px; +} +QComboBox::down-arrow { +image: url(":/res/dropdown.png"); +} + +VertScrArea { +background-position: bottom center; +background-repeat: repeat-x; +} + +IconedGroupBox { +border-radius: 16px; +padding: 2px; +} + +QGroupBox::title{ +subcontrol-origin: margin; +subcontrol-position: top left; +text-align: left; +left: 15px; +top: -4px; +} + +QCheckBox::indicator:checked{ +image: url(":/res/checked.png"); +} +QCheckBox::indicator:unchecked{ +image: url(":/res/unchecked.png"); +} + +.QWidget{ +background: transparent; +} + +QTabWidget::pane { +border-top-width: 2px; +} + +QMenu{ +background-color: #ffcc00; +margin: 3px; +} +QMenu::item { +background-color: #0d0544; +border: 1px solid transparent; +font: bold; +padding: 2px 25px 2px 20px; +} +QMenu::item:selected { +background-color: #2d2564; +} +QMenu::indicator { +width: 16px; +height: 16px; +} +QMenu::indicator:non-exclusive:checked{ +image: url(":/res/checked.png"); +} +QMenu::indicator:non-exclusive:unchecked{ +image: url(":/res/unchecked.png"); +} + +QToolTip{ +background-color: #0d0544; +border: 1px solid #ffcc00; +} + +:disabled{ +color: #a0a0a0; +} +SquareLabel, ItemNum { +background-color: #000000; +} + +QSlider::groove::horizontal { +height: 2px; +margin: 2px 0px; +background-color: #ffcc00; +} + +QSlider::handle::horizontal { +border: 0px; +margin: -2px 0px; +border-radius: 3px; +background-color: #ffcc00; +width: 8px; +} + diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/res/css/easter.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/QTfrontend/res/css/easter.css Mon Jan 16 10:22:21 2012 +0100 @@ -0,0 +1,248 @@ +/****************************************************************************** + * + * CSS-like definition of Qt frontend appearance + * + ****************************************************************************** + * + * see http://doc.qt.nokia.com/4.5/stylesheet.html + * + ****************************************************************************** + * + * This file can be stored at different locations, but it will be read only + * once, based on first file found in this order: + * + * /Data/css/easter.css + * /css/easter.css + * (:/res/css/easter.css) + * + *****************************************************************************/ + +HWForm,QDialog { +background-image: url(":/res/BackgroundEaster.png"); +background-position: bottom center; +background-repeat: repeat-x; +background-color: #141250; +} + +* { +color: #ffcc00; +selection-background-color: #ffcc00; +selection-color: #00351d; +} + +a { color:#c8c8ff; } + +QLineEdit, QListWidget, QTableView, QTextBrowser, QSpinBox, QComboBox, +QComboBox QAbstractItemView, QMenu::item { +background-color: rgba(13, 5, 68, 70%); +} + +QComboBox::separator { +border: solid; border-width: 3px; border-color: #ffcc00; +} + +QPushButton, QListWidget, QTableView, QLineEdit, QHeaderView, +QTextBrowser, QSpinBox, QToolBox, QComboBox, +QComboBox QAbstractItemView, IconedGroupBox, +.QGroupBox, GameCFGWidget, TeamSelWidget, SelWeaponWidget, +QTabWidget::pane, QTabBar::tab { +border: solid; +border-width: 3px; +border-color: #ffcc00; +} + +QPushButton:hover, QLineEdit:hover, QListWidget:hover, +QSpinBox:hover, QToolBox:hover, QComboBox:hover { +border-color: yellow; +} + +QLineEdit, QListWidget,QTableView, QTextBrowser, +QSpinBox, QToolBox { +border-radius: 10px; +} + +QLineEdit, QLabel, QHeaderView, QListWidget, QTableView, +QSpinBox, QToolBox::tab, QComboBox, QComboBox QAbstractItemView, +IconedGroupBox, .QGroupBox, GameCFGWidget, TeamSelWidget, +SelWeaponWidget, QCheckBox, QRadioButton, QPushButton { +font: bold 13px; +} +SelWeaponWidget QTabWidget::pane, SelWeaponWidget QTabBar::tab:selected { +background-position: bottom center; +background-repeat: repeat-x; +background-color: #000000; +} +.QGroupBox,GameCFGWidget,TeamSelWidget,SelWeaponWidget { +background-position: bottom center; +background-repeat: repeat-x; +border-radius: 16px; +background-color: rgba(13, 5, 68, 70%); +padding: 6px; +} +/* Experimenting with PaintOnScreen and border-radius on IconedGroupBox children didn't work out well +IconedGroupBox QComboBox, IconedGroupBox QPushButton, IconedGroupBox QLineEdit, +IconedGroupBox QSpinBox { +border-radius: 0; +} +IconedGroupBox, IconedGroupBox *, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{" */ +IconedGroupBox, QTabWidget::pane, QTabBar::tab:selected, QToolBox::tab QWidget{ +background-color: #130f2c; +} + + +QPushButton { +border-radius: 8px; +background-origin: margin; +background-position: top left; +background-color: rgba(18, 42, 5, 70%); +} + +QPushButton:pressed{ +border-color: white; +} + +QPushButton:focus { +outline: none; +} + + +QHeaderView { +border-radius: 0; +border-width: 0; +border-bottom-width: 3px; +background-color: #00351d; +} +QTableView { +alternate-background-color: #2f213a; +gridline-color: transparent; +} + +QTabBar::tab { +border-bottom-width: 0; +border-radius: 0; +border-top-left-radius: 6px; +border-top-right-radius: 6px; +padding: 3px; +} +QTabBar::tab:!selected { +color: #0d0544; +background-color: #ffcc00; +} +QSpinBox::up-button{ +background: transparent; +width: 16px; +height: 10px; +} + +QSpinBox::up-arrow { +image: url(":/res/spin_up.png"); +} + +QSpinBox::down-arrow { +image: url(":/res/spin_down.png"); +} + +QSpinBox::down-button { +background: transparent; +width: 16px; +height: 10px; +} + +QComboBox { +border-radius: 10px; +padding: 3px; +} +QComboBox:pressed{ +border-color: white; +} +QComboBox::drop-down{ +border: transparent; +width: 25px; +} +QComboBox::down-arrow { +image: url(":/res/dropdown.png"); +} + +VertScrArea { +background-position: bottom center; +background-repeat: repeat-x; +} + +IconedGroupBox { +border-radius: 16px; +padding: 2px; +} + +QGroupBox::title{ +subcontrol-origin: margin; +subcontrol-position: top left; +text-align: left; +left: 15px; +top: -4px; +} + +QCheckBox::indicator:checked{ +image: url(":/res/checked.png"); +} +QCheckBox::indicator:unchecked{ +image: url(":/res/unchecked.png"); +} + +.QWidget{ +background: transparent; +} + +QTabWidget::pane { +border-top-width: 2px; +} + +QMenu{ +background-color: #ffcc00; +margin: 3px; +} +QMenu::item { +background-color: #0d0544; +border: 1px solid transparent; +font: bold; +padding: 2px 25px 2px 20px; +} +QMenu::item:selected { +background-color: #2d2564; +} +QMenu::indicator { +width: 16px; +height: 16px; +} +QMenu::indicator:non-exclusive:checked{ +image: url(":/res/checked.png"); +} +QMenu::indicator:non-exclusive:unchecked{ +image: url(":/res/unchecked.png"); +} + +QToolTip{ +background-color: #0d0544; +border: 1px solid #ffcc00; +} + +:disabled{ +color: #a0a0a0; +} +SquareLabel, ItemNum { +background-color: #000000; +} + +QSlider::groove::horizontal { +height: 2px; +margin: 2px 0px; +background-color: #ffcc00; +} + +QSlider::handle::horizontal { +border: 0px; +margin: -2px 0px; +border-radius: 3px; +background-color: #ffcc00; +width: 8px; +} + diff -r d4ad42283125 -r fc52f7c22c9b QTfrontend/ui/widget/bgwidget.cpp --- a/QTfrontend/ui/widget/bgwidget.cpp Sun Jan 15 22:01:50 2012 -0500 +++ b/QTfrontend/ui/widget/bgwidget.cpp Mon Jan 16 10:22:21 2012 +0100 @@ -18,6 +18,7 @@ */ #include "bgwidget.h" +#include "hwconsts.h" SpritePosition::SpritePosition(QWidget * parent, int sw, int sh) { @@ -85,7 +86,24 @@ BGWidget::BGWidget(QWidget * parent) : QWidget(parent), enabled(false) { setAttribute(Qt::WA_NoSystemBackground, true); - sprite.load(":/res/Star.png"); + + QString fname; + + //For each season, there is a replacement for the star (Star.png) + //Todo: change element for easter and birthday + //Simply replace Confetti.png and Egg.png with an appropriate graphic) + switch (season) + { + case SEASON_CHRISTMAS : fname = "Flake.png"; + break; + case SEASON_EASTER : fname = "Egg.png"; + break; + case SEASON_HWBDAY : fname = "Confetti.png"; + break; + default : fname = "Star.png"; + } + + sprite.load(":/res/" + fname); setAutoFillBackground(false); @@ -164,7 +182,7 @@ void BGWidget::stopAnimation() { timerAnimation->stop(); - repaint(); + repaint(); } void BGWidget::init()