first colors and font sizes are skinnable now

This commit is contained in:
doitux
2009-04-01 12:27:31 +00:00
parent 6d973aa178
commit b944852a4e
16 changed files with 355 additions and 242 deletions
@@ -3,7 +3,6 @@
<TableStyle> <TableStyle>
<StyleDescription value="PokerTH default table style" /> <StyleDescription value="PokerTH default table style" />
<StyleMaintainerEMail value="webmaster@pokerth.net" /> <StyleMaintainerEMail value="webmaster@pokerth.net" />
<Preview value="preview.png" />
<IfFixedWindowSize value="0" /> <IfFixedWindowSize value="0" />
<FixedWindowWidth value="1024" /> <FixedWindowWidth value="1024" />
<FixedWindowHeight value="600" /> <FixedWindowHeight value="600" />
@@ -11,6 +10,7 @@
<MinimumWindowHeight value="600" /> <MinimumWindowHeight value="600" />
<MaximumWindowWidth value="1980" /> <MaximumWindowWidth value="1980" />
<MaximumWindowHeight value="1200" /> <MaximumWindowHeight value="1200" />
<Preview value="preview.png" />
<ActionAllIn value="action_allin.png" /> <ActionAllIn value="action_allin.png" />
<ActionRaise value="action_raise.png" /> <ActionRaise value="action_raise.png" />
<ActionBet value="action_bet.png" /> <ActionBet value="action_bet.png" />
@@ -46,5 +46,17 @@
<Table value="table.png" /> <Table value="table.png" />
<ToolBoxBackground value="toolboxbg.png" /> <ToolBoxBackground value="toolboxbg.png" />
<HandRanking value="handranking.png" /> <HandRanking value="handranking.png" />
<FKeyIndicatorColor value="FFFFFF" />
<ChanceLabelPossibleColor value="9CD500" />
<ChanceLabelImpossibleColor value="55632F" />
<ChatTextColor value="FFFFFF" />
<ChatTextNickNotifyColor value="FFFF00" />
<LogTextColor value="FFFFFF" />
<LogWinnerMainPotColor value="FFFF00" />
<LogWinnerSidePotColor value="FFFFCC" />
<LogPlayerSitsOutColor value="FF6633" />
<LogNewGameAdminColor value="69FF33" />
<ChatTextSize value="11" />
<LogTextSize value="11" />
</TableStyle> </TableStyle>
</PokerTH> </PokerTH>
+7 -2
View File
@@ -20,6 +20,7 @@
#include "chattools.h" #include "chattools.h"
#include "session.h" #include "session.h"
#include "configfile.h" #include "configfile.h"
#include "gametablestylereader.h"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
@@ -63,9 +64,11 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
switch (myNotifyMode) { switch (myNotifyMode) {
case 0: tempMsg = message; case 0: tempMsg = message;
break; break;
// lobby
case 1: tempMsg = QString("<span style=\"font-weight:bold;\">"+message+"</span>"); case 1: tempMsg = QString("<span style=\"font-weight:bold;\">"+message+"</span>");
break; break;
case 2: tempMsg = QString("<span style=\"color:#FFFF00;\">"+message+"</span>"); // ingame
case 2: tempMsg = QString("<span style=\"color:#"+myStyle->getChatTextNickNotifyColor()+";\">"+message+"</span>");
break; break;
default:; default:;
} }
@@ -74,9 +77,11 @@ void ChatTools::receiveMessage(QString playerName, QString message) {
switch (myNotifyMode) { switch (myNotifyMode) {
case 0: tempMsg = message; case 0: tempMsg = message;
break; break;
// lobby
case 1: tempMsg = QString("<span style=\"font-weight:normal;\">"+message+"</span>"); case 1: tempMsg = QString("<span style=\"font-weight:normal;\">"+message+"</span>");
break; break;
case 2: tempMsg = QString("<span style=\"color:#FFFFFF;\">"+message+"</span>"); // ingame
case 2: tempMsg = QString("<span style=\"color:#"+myStyle->getChatTextColor()+";\">"+message+"</span>");
break; break;
default:; default:;
} }
+5
View File
@@ -27,6 +27,7 @@
class Session; class Session;
class ConfigFile; class ConfigFile;
class GameTableStyleReader;
class ChatTools : public QObject class ChatTools : public QObject
{ {
@@ -56,6 +57,8 @@ public slots:
void setPlayerNicksList(QStringList value) { myNickStringList = value; } void setPlayerNicksList(QStringList value) { myNickStringList = value; }
void setMyNick ( const QString& theValue ) { myNick = theValue; } void setMyNick ( const QString& theValue ) { myNick = theValue; }
void setMyStyle ( GameTableStyleReader* theValue ) { myStyle = theValue; }
private: private:
@@ -73,6 +76,8 @@ private:
ConfigFile *myConfig; ConfigFile *myConfig;
QString myNick; QString myNick;
GameTableStyleReader *myStyle;
}; };
#endif #endif
+33 -39
View File
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>gameLobbyDialog</class> <class>gameLobbyDialog</class>
<widget class="QDialog" name="gameLobbyDialog"> <widget class="QDialog" name="gameLobbyDialog">
@@ -10,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" > <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@@ -25,16 +26,16 @@
<string>Internet Game Lobby</string> <string>Internet Game Lobby</string>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout">
<property name="bottomMargin" >
<number>4</number>
</property>
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>4</number> <number>4</number>
</property> </property>
<item rowspan="3" row="0" column="0" > <property name="bottomMargin">
<number>4</number>
</property>
<item row="0" column="0" rowspan="3">
<widget class="QTreeWidget" name="treeWidget_NickList"> <widget class="QTreeWidget" name="treeWidget_NickList">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy vsizetype="Expanding" hsizetype="Fixed" > <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@@ -103,13 +104,13 @@
</column> </column>
</widget> </widget>
</item> </item>
<item rowspan="3" row="0" column="2" > <item row="0" column="2" rowspan="3">
<widget class="QGroupBox" name="groupBox_GameInfo"> <widget class="QGroupBox" name="groupBox_GameInfo">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" > <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@@ -174,7 +175,7 @@
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@@ -350,7 +351,7 @@
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>248</width> <width>248</width>
<height>91</height> <height>91</height>
@@ -371,7 +372,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum> <enum>QSizePolicy::Fixed</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>0</width> <width>0</width>
<height>27</height> <height>27</height>
@@ -382,7 +383,7 @@
<item> <item>
<widget class="QPushButton" name="pushButton_Leave"> <widget class="QPushButton" name="pushButton_Leave">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" > <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@@ -402,16 +403,7 @@
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin" > <property name="margin">
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
@@ -429,7 +421,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Expanding</enum> <enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>181</width> <width>181</width>
<height>20</height> <height>20</height>
@@ -445,7 +437,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum> <enum>QSizePolicy::Fixed</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>0</width> <width>0</width>
<height>28</height> <height>28</height>
@@ -475,22 +467,10 @@
<string>Lobby-Chat</string> <string>Lobby-Chat</string>
</property> </property>
<layout class="QGridLayout"> <layout class="QGridLayout">
<property name="leftMargin" > <property name="margin">
<number>7</number> <number>7</number>
</property> </property>
<property name="topMargin" > <property name="spacing">
<number>7</number>
</property>
<property name="rightMargin" >
<number>7</number>
</property>
<property name="bottomMargin" >
<number>7</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
@@ -528,7 +508,7 @@
<item> <item>
<widget class="QLabel" name="label_openGamesCounter"> <widget class="QLabel" name="label_openGamesCounter">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" > <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@@ -538,6 +518,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="label_pokerthDotNet">
<property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Nimbus Sans L'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://www.pokerth.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;http://www.pokerth.net&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
+6
View File
@@ -25,6 +25,7 @@
#include "playerinterface.h" #include "playerinterface.h"
#include "chattools.h" #include "chattools.h"
#include "configfile.h" #include "configfile.h"
#include "gametablestylereader.h"
using namespace std; using namespace std;
@@ -108,3 +109,8 @@ int Chat::getChatLinesHistorySize() { return myChatTools->getChatLinesHistorySiz
void Chat::showChatHistoryIndex(int index) { myChatTools->showChatHistoryIndex(index); } void Chat::showChatHistoryIndex(int index) { myChatTools->showChatHistoryIndex(index); }
void Chat::nickAutoCompletition() { myChatTools->nickAutoCompletition(); } void Chat::nickAutoCompletition() { myChatTools->nickAutoCompletition(); }
void Chat::setChatTextEdited() { myChatTools->setChatTextEdited(); } void Chat::setChatTextEdited() { myChatTools->setChatTextEdited(); }
void Chat::transportMyStyle(GameTableStyleReader *s)
{
myChatTools->setMyStyle(s);
}
+2
View File
@@ -27,6 +27,7 @@
class gameTableImpl; class gameTableImpl;
class ChatTools; class ChatTools;
class ConfigFile; class ConfigFile;
class GameTableStyleReader;
class Chat : public QObject class Chat : public QObject
{ {
@@ -44,6 +45,7 @@ public slots:
void checkInvisible(); void checkInvisible();
void checkInputLength(QString); void checkInputLength(QString);
void clearNewGame(); void clearNewGame();
void transportMyStyle(GameTableStyleReader*);
ChatTools* getMyChatTools() const { return myChatTools; } ChatTools* getMyChatTools() const { return myChatTools; }
+10 -14
View File
@@ -87,6 +87,9 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
pixmapLabel_card0b->setMyW(this); pixmapLabel_card0b->setMyW(this);
pixmapLabel_card0a->setMyW(this); pixmapLabel_card0a->setMyW(this);
//set myStyle to widgets wich needs it
label_chance->setMyStyle(myGameTableStyle);
//Flipside festlegen; //Flipside festlegen;
if (myConfig->readConfigInt("FlipsideOwn") && myConfig->readConfigString("FlipsideOwnFile") != "") { if (myConfig->readConfigInt("FlipsideOwn") && myConfig->readConfigString("FlipsideOwnFile") != "") {
flipside = new QPixmap(); flipside = new QPixmap();
@@ -365,6 +368,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
// Dialogs // Dialogs
myChat = new Chat(this, myConfig); myChat = new Chat(this, myConfig);
myChat->transportMyStyle(myGameTableStyle);
lineEdit_ChatInput->installEventFilter(this); lineEdit_ChatInput->installEventFilter(this);
this->installEventFilter(this); this->installEventFilter(this);
@@ -2408,7 +2412,7 @@ void gameTableImpl::nextRoundCleanGui() {
//Clean breakbutton //Clean breakbutton
if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_LOCAL) { if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_LOCAL) {
blinkingStartButtonAnimationTimer->stop(); blinkingStartButtonAnimationTimer->stop();
pushButton_break->setStyleSheet("QPushButton { background-color: #145300; color: #99D500;}"); myGameTableStyle->setBreakButtonStyle(pushButton_break,0);
blinkingStartButtonAnimationTimer->stop(); blinkingStartButtonAnimationTimer->stop();
QFontMetrics tempMetrics = this->fontMetrics(); QFontMetrics tempMetrics = this->fontMetrics();
int width = tempMetrics.width(tr("Stop")); int width = tempMetrics.width(tr("Stop"));
@@ -2494,7 +2498,7 @@ void gameTableImpl::breakButtonClicked() {
blinkingStartButtonAnimationTimer->stop(); blinkingStartButtonAnimationTimer->stop();
//Set default Color //Set default Color
pushButton_break->setStyleSheet("QPushButton { background-color: #145300; color: #99D500;}"); myGameTableStyle->setBreakButtonStyle(pushButton_break,0);
QFontMetrics tempMetrics = this->fontMetrics(); QFontMetrics tempMetrics = this->fontMetrics();
int width = tempMetrics.width(tr("Stop")); int width = tempMetrics.width(tr("Stop"));
pushButton_break->setMinimumSize(width+10,20); pushButton_break->setMinimumSize(width+10,20);
@@ -2713,11 +2717,11 @@ void gameTableImpl::blinkingStartButtonAnimationAction() {
QString style = pushButton_break->styleSheet(); QString style = pushButton_break->styleSheet();
if(style.contains("QPushButton { background-color: #145300;")) { if(style.contains("QPushButton:enabled { background-color: #145300;")) {
pushButton_break->setStyleSheet("QPushButton { background-color: #6E9E00; color: black;}"); myGameTableStyle->setBreakButtonStyle(pushButton_break,1);
} }
else { else {
pushButton_break->setStyleSheet("QPushButton { background-color: #145300; color: #99D500;}"); myGameTableStyle->setBreakButtonStyle(pushButton_break,0);
} }
} }
@@ -3164,13 +3168,6 @@ void gameTableImpl::refreshGameTableStyle()
myGameTableStyle->setChatStyle(textBrowser_Chat); myGameTableStyle->setChatStyle(textBrowser_Chat);
myGameTableStyle->setChatInputStyle(lineEdit_ChatInput); myGameTableStyle->setChatInputStyle(lineEdit_ChatInput);
#ifdef __APPLE__
// tabWidget_Right->setStyleSheet("QTabWidget { "+ font1String +" font-size: 11px; background-color: #145300; }");
// tabWidget_Left->setStyleSheet("QTabWidget { "+ font1String +" font-size: 11px; background-color: #145300;}");
#else
// tabWidget_Right->setStyleSheet("QTabWidget::pane { "+ font1String +" font-size: 10px; background-color: #145300; border: 1px solid #286400; border-radius: 2px; }");
// tabWidget_Left->setStyleSheet("QTabWidget::pane { border: 1px solid #286400; border-radius: 2px; background-color: #145300; }");
#endif
int i; int i;
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
@@ -3196,7 +3193,7 @@ void gameTableImpl::refreshGameTableStyle()
myGameTableStyle->setCardHolderStyle(label_CardHolder4,2); myGameTableStyle->setCardHolderStyle(label_CardHolder4,2);
myGameTableStyle->setTableBackground(this); myGameTableStyle->setTableBackground(this);
myGameTableStyle->setMenuBarStyle(menubar); myGameTableStyle->setMenuBarStyle(menubar);
myGameTableStyle->setBreakButtonStyle(pushButton_break); myGameTableStyle->setBreakButtonStyle(pushButton_break,0);
myGameTableStyle->setSpeedStringStyle(label_speedString); myGameTableStyle->setSpeedStringStyle(label_speedString);
myGameTableStyle->setSpeedStringStyle(label_speedValue); myGameTableStyle->setSpeedStringStyle(label_speedValue);
myGameTableStyle->setVoteButtonStyle(pushButton_voteOnKickYes); myGameTableStyle->setVoteButtonStyle(pushButton_voteOnKickYes);
@@ -3228,6 +3225,5 @@ void gameTableImpl::refreshGameTableStyle()
myGameTableStyle->setTabWidgetStyle(tabWidget_Right, tabWidget_Right->getMyTabBar()); myGameTableStyle->setTabWidgetStyle(tabWidget_Right, tabWidget_Right->getMyTabBar());
myGameTableStyle->setTabWidgetStyle(tabWidget_Left, tabWidget_Left->getMyTabBar()); myGameTableStyle->setTabWidgetStyle(tabWidget_Left, tabWidget_Left->getMyTabBar());
label_Handranking->setPixmap(myGameTableStyle->getHandRanking()); label_Handranking->setPixmap(myGameTableStyle->getHandRanking());
} }
+2
View File
@@ -65,6 +65,8 @@ public:
SDLPlayer* getMySDLPlayer() const { return mySDLPlayer; } SDLPlayer* getMySDLPlayer() const { return mySDLPlayer; }
Chat* getMyChat() const { return myChat; } Chat* getMyChat() const { return myChat; }
GameTableStyleReader* getMyGameTableStyle() const { return myGameTableStyle; }
void setSpeeds(); void setSpeeds();
signals: signals:
+6 -4
View File
@@ -24,12 +24,14 @@
#include <session.h> #include <session.h>
#include <game.h> #include <game.h>
#include <game_defs.h> #include <game_defs.h>
#include "gametablestylereader.h"
using namespace std; using namespace std;
Log::Log(gameTableImpl* w, ConfigFile *c) : myW(w), myConfig(c), myLogDir(0), myLogFile(0) Log::Log(gameTableImpl* w, ConfigFile *c) : myW(w), myConfig(c), myLogDir(0), myLogFile(0)
{ {
myW->setLog(this); myW->setLog(this);
myStyle = myW->getMyGameTableStyle();
myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
@@ -207,9 +209,9 @@ void Log::logNewBlindsSetsMsg(int sbSet, int bbSet, QString sbName, QString bbNa
void Log::logPlayerWinsMsg(QString playerName, int pot, bool main) { void Log::logPlayerWinsMsg(QString playerName, int pot, bool main) {
if(main) { if(main) {
myW->textBrowser_Log->append("<span style=\"color:#FFFF00;\">"+playerName+" wins $"+QString::number(pot,10)+"</span>"); myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogWinnerMainPotColor()+";\">"+playerName+" wins $"+QString::number(pot,10)+"</span>");
} else { } else {
myW->textBrowser_Log->append("<span style=\"color:#FFFFCC;\">"+playerName+" wins $"+QString::number(pot,10)+" (side pot)</span>"); myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogWinnerSidePotColor()+";\">"+playerName+" wins $"+QString::number(pot,10)+" (side pot)</span>");
} }
if(myConfig->readConfigInt("LogOnOff")) { if(myConfig->readConfigInt("LogOnOff")) {
@@ -231,7 +233,7 @@ void Log::logPlayerWinsMsg(QString playerName, int pot, bool main) {
void Log::logPlayerSitsOut(QString playerName) { void Log::logPlayerSitsOut(QString playerName) {
myW->textBrowser_Log->append("<i><span style=\"color:#FF6633;\">"+playerName+" sits out</span></i>"); myW->textBrowser_Log->append("<i><span style=\"color:#"+myStyle->getLogPlayerSitsOutColor()+";\">"+playerName+" sits out</span></i>");
if(myConfig->readConfigInt("LogOnOff")) { if(myConfig->readConfigInt("LogOnOff")) {
@@ -344,7 +346,7 @@ void Log::logPlayerLeftMsg(QString playerName, int wasKicked) {
void Log::logNewGameAdminMsg(QString playerName) { void Log::logNewGameAdminMsg(QString playerName) {
myW->textBrowser_Log->append( "<i><span style=\"color:#69FF33;\">"+playerName+" is game admin now!</span></i>"); myW->textBrowser_Log->append( "<i><span style=\"color:#"+myStyle->getLogNewGameAdminColor()+";\">"+playerName+" is game admin now!</span></i>");
if(myConfig->readConfigInt("LogOnOff")) { if(myConfig->readConfigInt("LogOnOff")) {
+3 -1
View File
@@ -28,7 +28,7 @@
#include <QtCore> #include <QtCore>
class gameTableImpl; class gameTableImpl;
class GameTableStyleReader;
class Log : public QObject class Log : public QObject
{ {
@@ -87,6 +87,8 @@ private:
QString logFileStreamString; QString logFileStreamString;
QString myAppDataPath; QString myAppDataPath;
GameTableStyleReader *myStyle;
friend class GuiWrapper; friend class GuiWrapper;
}; };
+2 -2
View File
@@ -10,7 +10,7 @@
// //
// //
#include "myactionbutton.h" #include "myactionbutton.h"
#include "gametablestylereader.h"
using namespace std; using namespace std;
@@ -30,7 +30,7 @@ void MyActionButton::paintEvent(QPaintEvent * event) {
QPushButton::paintEvent(event); QPushButton::paintEvent(event);
QPainter painter(this); QPainter painter(this);
painter.setPen(QColor(240,240,240)); painter.setPen(QColor("#"+myStyle->getFKeyIndicatorColor()));
painter.setOpacity(0.5); painter.setOpacity(0.5);
QFont f= painter.font(); QFont f= painter.font();
f.setPixelSize(9); f.setPixelSize(9);
+5
View File
@@ -15,6 +15,8 @@
#include <QtGui> #include <QtGui>
#include <QtCore> #include <QtCore>
class GameTableStyleReader;
class MyActionButton : public QPushButton class MyActionButton : public QPushButton
{ {
public: public:
@@ -25,9 +27,12 @@ public:
void paintEvent(QPaintEvent * event); void paintEvent(QPaintEvent * event);
void setFKeyText ( const QString& theValue ){fKeyText = theValue;} void setFKeyText ( const QString& theValue ){fKeyText = theValue;}
void setMyStyle ( GameTableStyleReader* theValue ) { myStyle = theValue; }
private: private:
QString fKeyText; QString fKeyText;
GameTableStyleReader *myStyle;
}; };
#endif #endif
+26 -21
View File
@@ -11,11 +11,13 @@
// //
#include "mychancelabel.h" #include "mychancelabel.h"
#include "gametableimpl.h" #include "gametableimpl.h"
#include "gametablestylereader.h"
using namespace std; using namespace std;
MyChanceLabel::MyChanceLabel(QWidget* parent) MyChanceLabel::MyChanceLabel(QWidget* parent)
: QLabel(parent) { : QLabel(parent), myW(0), myStyle(0)
{
} }
@@ -70,44 +72,47 @@ void MyChanceLabel::paintEvent(QPaintEvent * /*event*/) {
painter.setFont(font); painter.setFont(font);
//Draw Texts //Draw Texts
if(RFChance[1] == 0) { painter.setPen(QColor(85,99,47)); } QColor possible("#"+myStyle->getChanceLabelPossibleColor());
else { painter.setPen(QColor(156,213,0)); } QColor impossible("#"+myStyle->getChanceLabelImpossibleColor());
if(RFChance[1] == 0) { painter.setPen(impossible); }
else { painter.setPen(possible); }
painter.drawText(QRectF(QPointF(2,0), QPointF(85,13)),Qt::AlignRight,"Royal Flush"); painter.drawText(QRectF(QPointF(2,0), QPointF(85,13)),Qt::AlignRight,"Royal Flush");
painter.drawText(QRectF(QPointF(196,0), QPointF(236,13)),Qt::AlignRight,QString("%1%").arg(RFChance[0])); painter.drawText(QRectF(QPointF(196,0), QPointF(236,13)),Qt::AlignRight,QString("%1%").arg(RFChance[0]));
if(SFChance[1] == 0) { painter.setPen(QColor(85,99,47)); } if(SFChance[1] == 0) { painter.setPen(impossible); }
else { painter.setPen(QColor(156,213,0)); } else { painter.setPen(possible); }
painter.drawText(QRectF(QPointF(2,13), QPointF(85,26)),Qt::AlignRight,"Straight Flush"); painter.drawText(QRectF(QPointF(2,13), QPointF(85,26)),Qt::AlignRight,"Straight Flush");
painter.drawText(QRectF(QPointF(196,13), QPointF(236,26)),Qt::AlignRight,QString("%1%").arg(SFChance[0])); painter.drawText(QRectF(QPointF(196,13), QPointF(236,26)),Qt::AlignRight,QString("%1%").arg(SFChance[0]));
if(FOAKChance[1] == 0) { painter.setPen(QColor(85,99,47)); } if(FOAKChance[1] == 0) { painter.setPen(impossible); }
else { painter.setPen(QColor(156,213,0)); } else { painter.setPen(possible); }
painter.drawText(QRectF(QPointF(2,26), QPointF(85,39)),Qt::AlignRight,"Four of a Kind"); painter.drawText(QRectF(QPointF(2,26), QPointF(85,39)),Qt::AlignRight,"Four of a Kind");
painter.drawText(QRectF(QPointF(196,26), QPointF(236,39)),Qt::AlignRight,QString("%1%").arg(FOAKChance[0])); painter.drawText(QRectF(QPointF(196,26), QPointF(236,39)),Qt::AlignRight,QString("%1%").arg(FOAKChance[0]));
if(FHChance[1] == 0) { painter.setPen(QColor(85,99,47)); } if(FHChance[1] == 0) { painter.setPen(impossible); }
else { painter.setPen(QColor(156,213,0)); } else { painter.setPen(possible); }
painter.drawText(QRectF(QPointF(2,39), QPointF(85,52)),Qt::AlignRight,"Full House"); painter.drawText(QRectF(QPointF(2,39), QPointF(85,52)),Qt::AlignRight,"Full House");
painter.drawText(QRectF(QPointF(196,39), QPointF(236,52)),Qt::AlignRight,QString("%1%").arg(FHChance[0])); painter.drawText(QRectF(QPointF(196,39), QPointF(236,52)),Qt::AlignRight,QString("%1%").arg(FHChance[0]));
if(FLChance[1] == 0) { painter.setPen(QColor(85,99,47)); } if(FLChance[1] == 0) { painter.setPen(impossible); }
else { painter.setPen(QColor(156,213,0)); } else { painter.setPen(possible); }
painter.drawText(QRectF(QPointF(2,52), QPointF(85,65)),Qt::AlignRight,"Flush"); painter.drawText(QRectF(QPointF(2,52), QPointF(85,65)),Qt::AlignRight,"Flush");
painter.drawText(QRectF(QPointF(196,52), QPointF(236,65)),Qt::AlignRight,QString("%1%").arg(FLChance[0])); painter.drawText(QRectF(QPointF(196,52), QPointF(236,65)),Qt::AlignRight,QString("%1%").arg(FLChance[0]));
if(STRChance[1] == 0) { painter.setPen(QColor(85,99,47)); } if(STRChance[1] == 0) { painter.setPen(impossible); }
else { painter.setPen(QColor(156,213,0)); } else { painter.setPen(possible); }
painter.drawText(QRectF(QPointF(2,65), QPointF(85,78)),Qt::AlignRight,"Straight"); painter.drawText(QRectF(QPointF(2,65), QPointF(85,78)),Qt::AlignRight,"Straight");
painter.drawText(QRectF(QPointF(196,65), QPointF(236,78)),Qt::AlignRight,QString("%1%").arg(STRChance[0])); painter.drawText(QRectF(QPointF(196,65), QPointF(236,78)),Qt::AlignRight,QString("%1%").arg(STRChance[0]));
if(TOAKChance[1] == 0) { painter.setPen(QColor(85,99,47)); } if(TOAKChance[1] == 0) { painter.setPen(impossible); }
else { painter.setPen(QColor(156,213,0)); } else { painter.setPen(possible); }
painter.drawText(QRectF(QPointF(2,78), QPointF(85,91)),Qt::AlignRight,"Three of a Kind"); painter.drawText(QRectF(QPointF(2,78), QPointF(85,91)),Qt::AlignRight,"Three of a Kind");
painter.drawText(QRectF(QPointF(196,78), QPointF(236,91)),Qt::AlignRight,QString("%1%").arg(TOAKChance[0])); painter.drawText(QRectF(QPointF(196,78), QPointF(236,91)),Qt::AlignRight,QString("%1%").arg(TOAKChance[0]));
if(TPChance[1] == 0) { painter.setPen(QColor(85,99,47)); } if(TPChance[1] == 0) { painter.setPen(impossible); }
else { painter.setPen(QColor(156,213,0)); } else { painter.setPen(possible); }
painter.drawText(QRectF(QPointF(2,91), QPointF(85,104)),Qt::AlignRight,"Two Pairs"); painter.drawText(QRectF(QPointF(2,91), QPointF(85,104)),Qt::AlignRight,"Two Pairs");
painter.drawText(QRectF(QPointF(196,91), QPointF(236,104)),Qt::AlignRight,QString("%1%").arg(TPChance[0])); painter.drawText(QRectF(QPointF(196,91), QPointF(236,104)),Qt::AlignRight,QString("%1%").arg(TPChance[0]));
if(OPChance[1] == 0) { painter.setPen(QColor(85,99,47)); } if(OPChance[1] == 0) { painter.setPen(impossible); }
else { painter.setPen(QColor(156,213,0)); } else { painter.setPen(possible); }
painter.drawText(QRectF(QPointF(2,104), QPointF(85,117)),Qt::AlignRight,"One Pair"); painter.drawText(QRectF(QPointF(2,104), QPointF(85,117)),Qt::AlignRight,"One Pair");
painter.drawText(QRectF(QPointF(196,104), QPointF(236,117)),Qt::AlignRight,QString("%1%").arg(OPChance[0])); painter.drawText(QRectF(QPointF(196,104), QPointF(236,117)),Qt::AlignRight,QString("%1%").arg(OPChance[0]));
if(HCChance[1] == 0) { painter.setPen(QColor(85,99,47)); } if(HCChance[1] == 0) { painter.setPen(impossible); }
else { painter.setPen(QColor(156,213,0)); } else { painter.setPen(possible); }
painter.drawText(QRectF(QPointF(2,117), QPointF(85,130)),Qt::AlignRight,"Highest Card"); painter.drawText(QRectF(QPointF(2,117), QPointF(85,130)),Qt::AlignRight,"Highest Card");
painter.drawText(QRectF(QPointF(196,117), QPointF(236,130)),Qt::AlignRight,QString("%1%").arg(HCChance[0])); painter.drawText(QRectF(QPointF(196,117), QPointF(236,130)),Qt::AlignRight,QString("%1%").arg(HCChance[0]));
+3
View File
@@ -18,6 +18,7 @@
#include <QtCore> #include <QtCore>
class gameTableImpl; class gameTableImpl;
class GameTableStyleReader;
class MyChanceLabel : public QLabel class MyChanceLabel : public QLabel
{ {
@@ -28,6 +29,7 @@ public:
~MyChanceLabel(); ~MyChanceLabel();
void setMyW ( gameTableImpl* theValue ) { myW = theValue; } void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
void setMyStyle ( GameTableStyleReader* theValue ) { myStyle = theValue; }
void paintEvent(QPaintEvent * event); void paintEvent(QPaintEvent * event);
void refreshChance(std::vector< std::vector<int> >); void refreshChance(std::vector< std::vector<int> >);
void resetChance(); void resetChance();
@@ -35,6 +37,7 @@ public:
private: private:
gameTableImpl *myW; gameTableImpl *myW;
GameTableStyleReader *myStyle;
int RFChance[2]; int RFChance[2];
int SFChance[2]; int SFChance[2];
int FOAKChance[2]; int FOAKChance[2];
+56 -12
View File
@@ -105,16 +105,19 @@ void GameTableStyleReader::readStyleFile(QString file) {
if (tmpStr1) { if (tmpStr1) {
tempString1 = tmpStr1; tempString1 = tmpStr1;
// INFOS
if(itemsList->ValueStr() == "StyleDescription") { StyleDescription = QString::fromUtf8(tempString1.c_str()); } if(itemsList->ValueStr() == "StyleDescription") { StyleDescription = QString::fromUtf8(tempString1.c_str()); }
else if(itemsList->ValueStr() == "StyleMaintainerEMail") { StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str()); } else if(itemsList->ValueStr() == "StyleMaintainerEMail") { StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str()); }
// WINDOWS SETTINGS
else if (itemsList->ValueStr() == "IfFixedWindowSize") { IfFixedWindowSize = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "FixedWindowWidth") { FixedWindowWidth = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "FixedWindowHeight") { FixedWindowHeight = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "MinimumWindowWidth") { MinimumWindowWidth = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "MinimumWindowHeight") { MinimumWindowHeight = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "MaximumWindowWidth") { MaximumWindowWidth = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "MaximumWindowHeight") { MaximumWindowHeight = QString::fromUtf8(tempString1.c_str()); }
// PICS
else if (itemsList->ValueStr() == "Preview") { Preview = currentDir+QString::fromUtf8(tempString1.c_str()); } else if (itemsList->ValueStr() == "Preview") { Preview = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "IfFixedWindowSize") { IfFixedWindowSize = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "FixedWindowWidth") { FixedWindowWidth = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "FixedWindowHeight") { FixedWindowHeight = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "MinimumWindowWidth") { MinimumWindowWidth = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "MinimumWindowHeight") { MinimumWindowHeight = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "MaximumWindowWidth") { MaximumWindowWidth = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "MaximumWindowHeight") { MaximumWindowHeight = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ActionAllIn") { ActionAllIn = currentDir+QString::fromUtf8(tempString1.c_str()); } else if (itemsList->ValueStr() == "ActionAllIn") { ActionAllIn = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ActionRaise") { ActionRaise = currentDir+QString::fromUtf8(tempString1.c_str()); } else if (itemsList->ValueStr() == "ActionRaise") { ActionRaise = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ActionBet") { ActionBet = currentDir+QString::fromUtf8(tempString1.c_str()); } else if (itemsList->ValueStr() == "ActionBet") { ActionBet = currentDir+QString::fromUtf8(tempString1.c_str()); }
@@ -150,6 +153,20 @@ void GameTableStyleReader::readStyleFile(QString file) {
else if (itemsList->ValueStr() == "Table") { Table = currentDir+QString::fromUtf8(tempString1.c_str()); } else if (itemsList->ValueStr() == "Table") { Table = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "HandRanking") { HandRanking = currentDir+QString::fromUtf8(tempString1.c_str()); } else if (itemsList->ValueStr() == "HandRanking") { HandRanking = currentDir+QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ToolBoxBackground") { ToolBoxBackground = currentDir+QString::fromUtf8(tempString1.c_str()); } else if (itemsList->ValueStr() == "ToolBoxBackground") { ToolBoxBackground = currentDir+QString::fromUtf8(tempString1.c_str()); }
// COLORS
else if (itemsList->ValueStr() == "FKeyIndicatorColor") { FKeyIndicatorColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ChanceLabelPossibleColor") { ChanceLabelPossibleColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ChanceLabelImpossibleColor") { ChanceLabelImpossibleColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ChatTextNickNotifyColor") { ChatTextNickNotifyColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "ChatTextColor") { ChatTextColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "LogTextColor") { LogTextColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "LogWinnerMainPotColor") { LogWinnerMainPotColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "LogWinnerSidePotColor") { LogWinnerSidePotColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "LogPlayerSitsOutColor") { LogPlayerSitsOutColor = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "LogNewGameAdminColor") { LogNewGameAdminColor = QString::fromUtf8(tempString1.c_str()); }
// SIZES
else if (itemsList->ValueStr() == "ChatTextSize") { ChatTextSize = QString::fromUtf8(tempString1.c_str()); }
else if (itemsList->ValueStr() == "LogTextSize") { LogTextSize = QString::fromUtf8(tempString1.c_str()); }
// std::cout << "ÖLP" << itemsList->ValueStr() <<"§4s"<< itemsList->ValueStr()<<"§89"<< endl; // std::cout << "ÖLP" << itemsList->ValueStr() <<"§4s"<< itemsList->ValueStr()<<"§89"<< endl;
} }
@@ -196,6 +213,20 @@ void GameTableStyleReader::readStyleFile(QString file) {
if(PlayerSeatActive == "") { wrongItems << "PlayerSeatActive"; } if(PlayerSeatActive == "") { wrongItems << "PlayerSeatActive"; }
if(PlayerSeatInActive == "") { wrongItems << "PlayerSeatInActive"; } if(PlayerSeatInActive == "") { wrongItems << "PlayerSeatInActive"; }
if(Table == "") { wrongItems << "Table"; } if(Table == "") { wrongItems << "Table"; }
if(HandRanking == "") { wrongItems << "HandRanking"; }
if(ToolBoxBackground == "") { wrongItems << "ToolBoxBackground"; }
if(FKeyIndicatorColor == "") { wrongItems << "FKeyIndicatorColor"; }
if(ChanceLabelPossibleColor == "") { wrongItems << "ChanceLabelPossibleColor"; }
if(ChanceLabelImpossibleColor == "") { wrongItems << "ChanceLabelImpossibleColor"; }
if(ChatTextColor == "") { wrongItems << "ChatTextColor"; }
if(ChatTextNickNotifyColor == "") { wrongItems << "ChatTextNickNotifyColor"; }
if(LogTextColor == "") { wrongItems << "LogTextColor"; }
if(LogWinnerMainPotColor == "") { wrongItems << "LogWinnerMainPotColor"; }
if(LogWinnerSidePotColor == "") { wrongItems << "LogWinnerSidePotColor"; }
if(LogPlayerSitsOutColor == "") { wrongItems << "LogPlayerSitsOutColor"; }
if(LogNewGameAdminColor == "") { wrongItems << "LogNewGameAdminColor"; }
if(ChatTextSize == "") { wrongItems << "ChatTextSize"; }
if(LogTextSize == "") { wrongItems << "LogTextSize"; }
//if one or more items are wrong or left show detailed error message //if one or more items are wrong or left show detailed error message
if(!wrongItems.isEmpty() && myW != 0) showErrorMessage(StyleDescription, wrongItems, StyleMaintainerEMail); if(!wrongItems.isEmpty() && myW != 0) showErrorMessage(StyleDescription, wrongItems, StyleMaintainerEMail);
@@ -219,13 +250,13 @@ void GameTableStyleReader::setTableBackground(gameTableImpl *gt)
void GameTableStyleReader::setLogStyle(QTextBrowser *tb) void GameTableStyleReader::setLogStyle(QTextBrowser *tb)
{ {
tb->setStyleSheet("QTextBrowser { "+ font1String +" font-size: "+textBrowserFontsize+"px; color: #F0F0F0; background-color: #1D3B00; border:none; } QScrollBar:vertical { border: 1px solid #104600; background: #135000; width: 15px; margin: 17px -1px 17px 0px; } QScrollBar::handle:vertical { border-radius: 1px; border: 1px solid #1B7200; background: #176400; min-height: 20px; } QScrollBar::add-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 1px; border-top-left-radius: 1px; border: 1px solid #1E7F00; background: #1A6F00; height: 15px; subcontrol-position: bottom; subcontrol-origin: margin; } QScrollBar::sub-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; border-top-right-radius: 2px; border-top-left-radius: 2px; border: 1px solid #1E7F00; background: #1A6F00; height: 15px; subcontrol-position: top; subcontrol-origin: margin; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { border: 1px solid #208A00; height: 3px; width: 3px; background: #27A800; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); tb->setStyleSheet("QTextBrowser { "+ font1String +" font-size: "+LogTextSize+"px; color: #F0F0F0; background-color: #1D3B00; border:none; } QScrollBar:vertical { border: 1px solid #104600; background: #135000; width: 15px; margin: 17px -1px 17px 0px; } QScrollBar::handle:vertical { border-radius: 1px; border: 1px solid #1B7200; background: #176400; min-height: 20px; } QScrollBar::add-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 1px; border-top-left-radius: 1px; border: 1px solid #1E7F00; background: #1A6F00; height: 15px; subcontrol-position: bottom; subcontrol-origin: margin; } QScrollBar::sub-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; border-top-right-radius: 2px; border-top-left-radius: 2px; border: 1px solid #1E7F00; background: #1A6F00; height: 15px; subcontrol-position: top; subcontrol-origin: margin; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { border: 1px solid #208A00; height: 3px; width: 3px; background: #27A800; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }");
} }
void GameTableStyleReader::setChatStyle(QTextBrowser *tb) void GameTableStyleReader::setChatStyle(QTextBrowser *tb)
{ {
tb->setStyleSheet("QTextBrowser { "+ font1String +" font-size: "+textBrowserFontsize+"px; color: #F0F0F0; background-color: #1D3B00; border:none; } QScrollBar:vertical { border: 1px solid #104600; background: #135000; width: 15px; margin: 17px -1px 17px 0px; } QScrollBar::handle:vertical { border-radius: 1px; border: 1px solid #1B7200; background: #176400; min-height: 20px; } QScrollBar::add-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 1px; border-top-left-radius: 1px; border: 1px solid #1E7F00; background: #1A6F00; height: 15px; subcontrol-position: bottom; subcontrol-origin: margin; } QScrollBar::sub-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; border-top-right-radius: 2px; border-top-left-radius: 2px; border: 1px solid #1E7F00; background: #1A6F00; height: 15px; subcontrol-position: top; subcontrol-origin: margin; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { border: 1px solid #208A00; height: 3px; width: 3px; background: #27A800; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }"); tb->setStyleSheet("QTextBrowser { "+ font1String +" font-size: "+ChatTextSize+"px; color: #F0F0F0; background-color: #1D3B00; border:none; } QScrollBar:vertical { border: 1px solid #104600; background: #135000; width: 15px; margin: 17px -1px 17px 0px; } QScrollBar::handle:vertical { border-radius: 1px; border: 1px solid #1B7200; background: #176400; min-height: 20px; } QScrollBar::add-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 1px; border-top-left-radius: 1px; border: 1px solid #1E7F00; background: #1A6F00; height: 15px; subcontrol-position: bottom; subcontrol-origin: margin; } QScrollBar::sub-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; border-top-right-radius: 2px; border-top-left-radius: 2px; border: 1px solid #1E7F00; background: #1A6F00; height: 15px; subcontrol-position: top; subcontrol-origin: margin; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { border: 1px solid #208A00; height: 3px; width: 3px; background: #27A800; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }");
} }
void GameTableStyleReader::setChatInputStyle(QLineEdit *ci) void GameTableStyleReader::setChatInputStyle(QLineEdit *ci)
@@ -275,9 +306,17 @@ void GameTableStyleReader::setMenuBarStyle(QMenuBar *mb)
mb->setStyleSheet("QMenuBar { background-color: #145300; } QMenuBar::item { color: #99D500; }"); mb->setStyleSheet("QMenuBar { background-color: #145300; } QMenuBar::item { color: #99D500; }");
} }
void GameTableStyleReader::setBreakButtonStyle(QPushButton *bb) void GameTableStyleReader::setBreakButtonStyle(QPushButton *bb, int state)
{ {
bb->setStyleSheet("QPushButton:enabled { background-color: #145300; color: #99D500;} QPushButton:disabled { background-color: #145300; color: #486F3E; font-weight: 900;}"); switch(state) {
// default
case 0: bb->setStyleSheet("QPushButton:enabled { background-color: #145300; color: #99D500;} QPushButton:disabled { background-color: #145300; color: #486F3E; font-weight: 900;}");
break;
// blink
case 1: bb->setStyleSheet("QPushButton { background-color: #6E9E00; color: black;}");
break;
}
} }
void GameTableStyleReader::setSpeedStringStyle(QLabel *l) void GameTableStyleReader::setSpeedStringStyle(QLabel *l)
@@ -337,8 +376,13 @@ QString GameTableStyleReader::getActionPic(int action)
} }
} }
void GameTableStyleReader::setButtonsStyle(QPushButton *br, QPushButton *cc, QPushButton *f, QPushButton *a, int state) void GameTableStyleReader::setButtonsStyle(MyActionButton *br, MyActionButton *cc, MyActionButton *f, MyActionButton *a, int state)
{ {
br->setMyStyle(this);
cc->setMyStyle(this);
f->setMyStyle(this);
a->setMyStyle(this);
switch(state) { switch(state) {
//default //default
case 0: { case 0: {
+34 -4
View File
@@ -27,6 +27,8 @@
#include <QtCore> #include <QtCore>
#include <QtGui> #include <QtGui>
class gameTableImpl;
class GameTableStyleReader : public QObject { class GameTableStyleReader : public QObject {
Q_OBJECT Q_OBJECT
public: public:
@@ -45,6 +47,11 @@ public:
QString getSmallBlindPuck() const { return SmallBlindPuck; } QString getSmallBlindPuck() const { return SmallBlindPuck; }
QString getBigBlindPuck() const { return BigBlindPuck; } QString getBigBlindPuck() const { return BigBlindPuck; }
QString getHandRanking() const { return HandRanking; } QString getHandRanking() const { return HandRanking; }
QString getFKeyIndicatorColor() const { return FKeyIndicatorColor; }
QString getChanceLabelImpossibleColor() const { return ChanceLabelImpossibleColor; }
QString getChanceLabelPossibleColor() const { return ChanceLabelPossibleColor; }
QString getChatTextColor() const { return ChatTextColor; }
QString getChatTextNickNotifyColor() const { return ChatTextNickNotifyColor; }
QString getActionPic(int); QString getActionPic(int);
@@ -67,7 +74,7 @@ public:
void setSmallFontBoardStyle(QLabel*); void setSmallFontBoardStyle(QLabel*);
void setBigFontBoardStyle(QLabel*); void setBigFontBoardStyle(QLabel*);
void setMenuBarStyle(QMenuBar*); void setMenuBarStyle(QMenuBar*);
void setBreakButtonStyle(QPushButton*); void setBreakButtonStyle(QPushButton*, int);
void setSpeedStringStyle(QLabel*); void setSpeedStringStyle(QLabel*);
void setVoteButtonStyle(QPushButton*); void setVoteButtonStyle(QPushButton*);
void setVoteStringsStyle(QLabel*); void setVoteStringsStyle(QLabel*);
@@ -76,14 +83,20 @@ public:
void setTabWidgetStyle(QTabWidget*, QTabBar*); void setTabWidgetStyle(QTabWidget*, QTabBar*);
//set pics and fonts and colors //set pics and fonts and colors
void setButtonsStyle(QPushButton*, QPushButton*, QPushButton*, QPushButton*, int); void setButtonsStyle(MyActionButton*, MyActionButton*, MyActionButton*, MyActionButton*, int);
void setAwayRadioButtonsStyle(QRadioButton*); void setAwayRadioButtonsStyle(QRadioButton*);
private: QString getLogWinnerMainPotColor() const { return LogWinnerMainPotColor; }
QString getLogWinnerSidePotColor() const { return LogWinnerSidePotColor; }
QString getLogPlayerSitsOutColor() const { return LogPlayerSitsOutColor; }
QString getLogNewGameAdminColor() const { return LogNewGameAdminColor; }
private:
//style values
// INFOS
QString StyleDescription; QString StyleDescription;
QString StyleMaintainerEMail; QString StyleMaintainerEMail;
QString Preview; // WINDOWS SETTINGS
QString IfFixedWindowSize; QString IfFixedWindowSize;
QString FixedWindowWidth; QString FixedWindowWidth;
QString FixedWindowHeight; QString FixedWindowHeight;
@@ -91,6 +104,8 @@ private:
QString MinimumWindowHeight; QString MinimumWindowHeight;
QString MaximumWindowWidth; QString MaximumWindowWidth;
QString MaximumWindowHeight; QString MaximumWindowHeight;
// PICS
QString Preview;
QString ActionAllIn; QString ActionAllIn;
QString ActionRaise; QString ActionRaise;
QString ActionBet; QString ActionBet;
@@ -126,7 +141,22 @@ private:
QString Table; QString Table;
QString HandRanking; QString HandRanking;
QString ToolBoxBackground; QString ToolBoxBackground;
// COLORS
QString FKeyIndicatorColor;
QString ChanceLabelPossibleColor;
QString ChanceLabelImpossibleColor;
QString ChatTextColor;
QString ChatTextNickNotifyColor;
QString LogTextColor;
QString LogWinnerMainPotColor;
QString LogWinnerSidePotColor;
QString LogPlayerSitsOutColor;
QString LogNewGameAdminColor;
// SIZES
QString ChatTextSize;
QString LogTextSize;
//internal
QString font2String; QString font2String;
QString font1String; QString font1String;
QString textBrowserFontsize; QString textBrowserFontsize;