gui modifications for resolution 800x480 (Maemo OS)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,7 @@
|
||||
|
||||
#ifdef GUI_800x480
|
||||
#include "ui_gametable_800x480.h"
|
||||
#include "ui_tabs_800x480.h"
|
||||
#else
|
||||
#include "ui_gametable.h"
|
||||
#endif
|
||||
@@ -97,6 +98,11 @@ public:
|
||||
|
||||
void setSpeeds();
|
||||
|
||||
#ifdef GUI_800x480
|
||||
Ui::tabs tabs;
|
||||
QDialog *tabsDiag;
|
||||
#endif
|
||||
|
||||
|
||||
signals:
|
||||
void signalInitGui(int speed);
|
||||
@@ -344,6 +350,11 @@ public slots:
|
||||
void soundEvent_blindsWereSet(int);
|
||||
void enableCallCheckPushButton();
|
||||
|
||||
#ifdef GUI_800x480
|
||||
void tabsButtonClicked();
|
||||
void tabsButtonClose();
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
boost::shared_ptr<GuiInterface> myServerGuiInterface;
|
||||
|
||||
@@ -86,7 +86,11 @@ guiLog::guiLog(gameTableImpl* w, ConfigFile *c) : myW(w), myConfig(c), myLogDir(
|
||||
stream_old << "<head>\n";
|
||||
stream_old << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf8\">";
|
||||
stream_old << "</head>\n";
|
||||
stream_old << "<body style=\"font-size:smaller\">\n";
|
||||
#ifdef GUI_800x480
|
||||
stream_old << "<body style=\"font-size:14px\">\n";
|
||||
#else
|
||||
stream_old << "<body>\n";
|
||||
#endif
|
||||
stream_old << "<img src='logo.png'>\n";
|
||||
stream_old << QString("<h3><b>Log-File for PokerTH %1 Session started on ").arg(POKERTH_BETA_RELEASE_STRING)+QDate::currentDate().toString("yyyy-MM-dd")+" at "+QTime::currentTime().toString("hh:mm:ss")+"</b></h3>\n";
|
||||
myHtmlLogFile_old->close();
|
||||
@@ -166,7 +170,12 @@ void guiLog::logPlayerActionMsg(QString msg, int action, int setValue)
|
||||
msg += "$"+QString::number(setValue,10)+".";
|
||||
}
|
||||
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+msg+"</span>");
|
||||
#else
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+msg+"</span>");
|
||||
#endif
|
||||
|
||||
|
||||
if(HTML_LOG) {
|
||||
|
||||
@@ -193,7 +202,11 @@ void guiLog::logNewGameHandMsg(int gameID, int handID)
|
||||
|
||||
PlayerList activePlayerList = currentHand->getActivePlayerList();
|
||||
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+"; font-size:large; font-weight:bold\">## Game: "+QString::number(gameID,10)+" | Hand: "+QString::number(handID,10)+" ##</span>");
|
||||
#else
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+"; font-size:large; font-weight:bold\">## Game: "+QString::number(gameID,10)+" | Hand: "+QString::number(handID,10)+" ##</span>");
|
||||
#endif
|
||||
|
||||
if(HTML_LOG) {
|
||||
|
||||
@@ -220,8 +233,13 @@ void guiLog::logNewBlindsSetsMsg(int sbSet, int bbSet, QString sbName, QString b
|
||||
{
|
||||
|
||||
// log blinds
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+sbName+" posts small blind ($"+QString::number(sbSet,10)+")</span>");
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+bbName+" posts big blind ($"+QString::number(bbSet,10)+")</span>");
|
||||
#else
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+sbName+" posts small blind ($"+QString::number(sbSet,10)+")</span>");
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+bbName+" posts big blind ($"+QString::number(bbSet,10)+")</span>");
|
||||
#endif
|
||||
|
||||
if(HTML_LOG) {
|
||||
|
||||
@@ -266,11 +284,19 @@ void guiLog::logNewBlindsSetsMsg(int sbSet, int bbSet, QString sbName, QString b
|
||||
void guiLog::logPlayerWinsMsg(QString playerName, int pot, bool main)
|
||||
{
|
||||
|
||||
#ifdef GUI_800x480
|
||||
if(main) {
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogWinnerMainPotColor()+";\">"+playerName+" wins $"+QString::number(pot,10)+"</span>");
|
||||
} else {
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogWinnerSidePotColor()+";\">"+playerName+" wins $"+QString::number(pot,10)+" (side pot)</span>");
|
||||
}
|
||||
#else
|
||||
if(main) {
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogWinnerMainPotColor()+";\">"+playerName+" wins $"+QString::number(pot,10)+"</span>");
|
||||
} else {
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogWinnerSidePotColor()+";\">"+playerName+" wins $"+QString::number(pot,10)+" (side pot)</span>");
|
||||
}
|
||||
#endif
|
||||
|
||||
if(HTML_LOG) {
|
||||
|
||||
@@ -295,7 +321,11 @@ void guiLog::logPlayerWinsMsg(QString playerName, int pot, bool main)
|
||||
void guiLog::logPlayerSitsOut(QString playerName)
|
||||
{
|
||||
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append("<i><span style=\"color:#"+myStyle->getLogPlayerSitsOutColor()+";\">"+playerName+" sits out</span></i>");
|
||||
#else
|
||||
myW->textBrowser_Log->append("<i><span style=\"color:#"+myStyle->getLogPlayerSitsOutColor()+";\">"+playerName+" sits out</span></i>");
|
||||
#endif
|
||||
|
||||
if(HTML_LOG) {
|
||||
|
||||
@@ -321,15 +351,27 @@ void guiLog::logDealBoardCardsMsg(int roundID, int card1, int card2, int card3,
|
||||
|
||||
case 1:
|
||||
round = "Flop";
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogPlayerSitsOutColor()+";\">--- "+round+" --- "+"["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+","+translateCardCode(card3).at(0)+translateCardCode(card3).at(1)+"]</span>");
|
||||
#else
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogPlayerSitsOutColor()+";\">--- "+round+" --- "+"["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+","+translateCardCode(card3).at(0)+translateCardCode(card3).at(1)+"]</span>");
|
||||
#endif
|
||||
break;
|
||||
case 2:
|
||||
round = "Turn";
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogPlayerSitsOutColor()+";\">--- "+round+" --- "+"["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+","+translateCardCode(card3).at(0)+translateCardCode(card3).at(1)+","+translateCardCode(card4).at(0)+translateCardCode(card4).at(1)+"]</span>");
|
||||
#else
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogPlayerSitsOutColor()+";\">--- "+round+" --- "+"["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+","+translateCardCode(card3).at(0)+translateCardCode(card3).at(1)+","+translateCardCode(card4).at(0)+translateCardCode(card4).at(1)+"]</span>");
|
||||
#endif
|
||||
break;
|
||||
case 3:
|
||||
round = "River";
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogPlayerSitsOutColor()+";\">--- "+round+" --- "+"["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+","+translateCardCode(card3).at(0)+translateCardCode(card3).at(1)+","+translateCardCode(card4).at(0)+translateCardCode(card4).at(1)+","+translateCardCode(card5).at(0)+translateCardCode(card5).at(1)+"]</span>");
|
||||
#else
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getLogPlayerSitsOutColor()+";\">--- "+round+" --- "+"["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+","+translateCardCode(card3).at(0)+translateCardCode(card3).at(1)+","+translateCardCode(card4).at(0)+translateCardCode(card4).at(1)+","+translateCardCode(card5).at(0)+translateCardCode(card5).at(1)+"]</span>");
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
round = "ERROR";
|
||||
@@ -377,12 +419,18 @@ void guiLog::logFlipHoleCardsMsg(QString playerName, int card1, int card2, int c
|
||||
|
||||
tempHandName = CardsValue::determineHandName(cardsValueInt,myW->getSession()->getCurrentGame()->getActivePlayerList()).c_str();
|
||||
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+playerName+" "+showHas+" ["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+"] - \""+tempHandName+"\"</span>");
|
||||
#else
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+playerName+" "+showHas+" ["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+"] - \""+tempHandName+"\"</span>");
|
||||
#endif
|
||||
|
||||
} else {
|
||||
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+playerName+" "+showHas+" ["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+"]</span>");
|
||||
#else
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\">"+playerName+" "+showHas+" ["+translateCardCode(card1).at(0)+translateCardCode(card1).at(1)+","+translateCardCode(card2).at(0)+translateCardCode(card2).at(1)+"]</span>");
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
if(HTML_LOG) {
|
||||
@@ -422,7 +470,11 @@ void guiLog::logPlayerLeftMsg(QString playerName, int wasKicked)
|
||||
if(wasKicked) action = "was kicked from";
|
||||
else action = "has left";
|
||||
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append( "<span style=\"color:#"+myStyle->getChatLogTextColor()+";\"><i>"+playerName+" "+action+" the game!</i></span>");
|
||||
#else
|
||||
myW->textBrowser_Log->append( "<span style=\"color:#"+myStyle->getChatLogTextColor()+";\"><i>"+playerName+" "+action+" the game!</i></span>");
|
||||
#endif
|
||||
|
||||
if(HTML_LOG) {
|
||||
|
||||
@@ -442,7 +494,11 @@ void guiLog::logPlayerLeftMsg(QString playerName, int wasKicked)
|
||||
void guiLog::logNewGameAdminMsg(QString playerName)
|
||||
{
|
||||
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append( "<i><span style=\"color:#"+myStyle->getLogNewGameAdminColor()+";\">"+playerName+" is game admin now!</span></i>");
|
||||
#else
|
||||
myW->textBrowser_Log->append( "<i><span style=\"color:#"+myStyle->getLogNewGameAdminColor()+";\">"+playerName+" is game admin now!</span></i>");
|
||||
#endif
|
||||
|
||||
if(HTML_LOG) {
|
||||
|
||||
@@ -461,14 +517,22 @@ void guiLog::logNewGameAdminMsg(QString playerName)
|
||||
|
||||
void guiLog::logPlayerJoinedMsg(QString playerName)
|
||||
{
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\"><i>"+playerName+" has joined the game!</i></span>");
|
||||
#else
|
||||
myW->textBrowser_Log->append("<span style=\"color:#"+myStyle->getChatLogTextColor()+";\"><i>"+playerName+" has joined the game!</i></span>");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void guiLog::logPlayerWinGame(QString playerName, int gameID)
|
||||
{
|
||||
|
||||
#ifdef GUI_800x480
|
||||
myW->tabs.textBrowser_Log->append( "<i><b>"+playerName+" wins game " + QString::number(gameID,10) +"!</i></b><br>");
|
||||
#else
|
||||
myW->textBrowser_Log->append( "<i><b>"+playerName+" wins game " + QString::number(gameID,10) +"!</i></b><br>");
|
||||
#endif
|
||||
|
||||
if(HTML_LOG) {
|
||||
|
||||
|
||||
@@ -156,6 +156,16 @@ void MyAvatarLabel::setPlayerRating(QString playerInfo)
|
||||
|
||||
void MyAvatarLabel::startChangePlayerTip(QString playerName)
|
||||
{
|
||||
#ifdef GUI_800x480
|
||||
if(myW->tabs.tabWidget_Left->widget(2) == myW->tabs.tab_Kick) {
|
||||
myW->tabs.tabWidget_Left->insertTab(3, myW->tabs.tab_editTip, playerName);
|
||||
myW->tabs.tabWidget_Left->setCurrentIndex(3);
|
||||
} else {
|
||||
myW->tabs.tabWidget_Left->insertTab(2, myW->tabs.tab_editTip, playerName);
|
||||
myW->tabs.tabWidget_Left->setCurrentIndex(2);
|
||||
}
|
||||
myW->tabs.textEdit_tipInput->setPlainText(getPlayerTip(playerName));
|
||||
#else
|
||||
if(myW->tabWidget_Left->widget(2) == myW->tab_Kick) {
|
||||
myW->tabWidget_Left->insertTab(3, myW->tab_editTip, playerName);
|
||||
myW->tabWidget_Left->setCurrentIndex(3);
|
||||
@@ -164,6 +174,7 @@ void MyAvatarLabel::startChangePlayerTip(QString playerName)
|
||||
myW->tabWidget_Left->setCurrentIndex(2);
|
||||
}
|
||||
myW->textEdit_tipInput->setPlainText(getPlayerTip(playerName));
|
||||
#endif
|
||||
}
|
||||
|
||||
void MyAvatarLabel::refreshStars()
|
||||
@@ -273,10 +284,16 @@ void MyAvatarLabel::setPlayerTip()
|
||||
int found=0;
|
||||
//std::string rating="1";
|
||||
std::string separator="(!#$%)";
|
||||
std::string tip = std::string((const char*)myW->textEdit_tipInput->toPlainText().toUtf8());
|
||||
std::string playerName;
|
||||
#ifdef GUI_800x480
|
||||
std::string tip = std::string((const char*)myW->tabs.textEdit_tipInput->toPlainText().toUtf8());
|
||||
if(myW->tabs.tabWidget_Left->widget(2) == myW->tabs.tab_editTip)playerName = myW->tabs.tabWidget_Left->tabText(2).toUtf8().constData();
|
||||
if(myW->tabs.tabWidget_Left->widget(3) == myW->tabs.tab_editTip)playerName = myW->tabs.tabWidget_Left->tabText(3).toUtf8().constData();
|
||||
#else
|
||||
std::string tip = std::string((const char*)myW->textEdit_tipInput->toPlainText().toUtf8());
|
||||
if(myW->tabWidget_Left->widget(2) == myW->tab_editTip)playerName = myW->tabWidget_Left->tabText(2).toUtf8().constData();
|
||||
if(myW->tabWidget_Left->widget(3) == myW->tab_editTip)playerName = myW->tabWidget_Left->tabText(3).toUtf8().constData();
|
||||
#endif
|
||||
QStringList playerInfo;
|
||||
std::list<std::string> tipsList = myW->getMyConfig()->readConfigStringList("PlayerTooltips");
|
||||
std::list<std::string> result;
|
||||
@@ -296,11 +313,19 @@ void MyAvatarLabel::setPlayerTip()
|
||||
myW->getMyConfig()->writeConfigStringList("PlayerTooltips", result);
|
||||
myW->getMyConfig()->writeBuffer();
|
||||
|
||||
#ifdef GUI_800x480
|
||||
if(myW->tabs.tabWidget_Left->widget(3) == myW->tabs.tab_editTip) {
|
||||
myW->tabs.tabWidget_Left->removeTab(3);
|
||||
} else if(myW->tabs.tabWidget_Left->widget(2) == myW->tabs.tab_editTip) {
|
||||
myW->tabs.tabWidget_Left->removeTab(2);
|
||||
}
|
||||
#else
|
||||
if(myW->tabWidget_Left->widget(3) == myW->tab_editTip) {
|
||||
myW->tabWidget_Left->removeTab(3);
|
||||
} else if(myW->tabWidget_Left->widget(2) == myW->tab_editTip) {
|
||||
myW->tabWidget_Left->removeTab(2);
|
||||
}
|
||||
#endif
|
||||
refreshTooltips();
|
||||
}
|
||||
|
||||
|
||||
@@ -97,88 +97,110 @@ void MyChanceLabel::paintEvent(QPaintEvent * /*event*/)
|
||||
#endif
|
||||
QFont font;
|
||||
font.setFamily(font1String);
|
||||
#ifdef GUI_800x480
|
||||
font.setPixelSize(18);
|
||||
#else
|
||||
font.setPixelSize(10);
|
||||
#endif
|
||||
painter.setFont(font);
|
||||
|
||||
//Draw Texts
|
||||
QColor possible("#"+myStyle->getChanceLabelPossibleColor());
|
||||
QColor impossible("#"+myStyle->getChanceLabelImpossibleColor());
|
||||
|
||||
#ifdef GUI_800x480
|
||||
int start_y = 3;
|
||||
int height = 27;
|
||||
int text_width = 140;
|
||||
int percent_width = 50;
|
||||
int percent_start = 320;
|
||||
int bar_height = 13;
|
||||
int bar_width = 172;
|
||||
#else
|
||||
int start_y = 0;
|
||||
int height = 13;
|
||||
int text_width = 85;
|
||||
int percent_width = 40;
|
||||
int percent_start = 196;
|
||||
int bar_height = 7;
|
||||
int bar_width = 108;
|
||||
#endif
|
||||
|
||||
if(RFChance[1] == 0 || myFoldState) {
|
||||
painter.setPen(impossible);
|
||||
} else {
|
||||
painter.setPen(possible);
|
||||
}
|
||||
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(2,start_y), QPointF(text_width,start_y+height)),Qt::AlignRight,"Royal Flush");
|
||||
painter.drawText(QRectF(QPointF(percent_start,start_y), QPointF(percent_start+percent_width,start_y+height)),Qt::AlignRight,QString("%1%").arg(RFChance[0]));
|
||||
if(SFChance[1] == 0 || myFoldState) {
|
||||
painter.setPen(impossible);
|
||||
} else {
|
||||
painter.setPen(possible);
|
||||
}
|
||||
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(2,start_y+height), QPointF(text_width,start_y+2*height)),Qt::AlignRight,"Straight Flush");
|
||||
painter.drawText(QRectF(QPointF(percent_start,start_y+height), QPointF(percent_start+percent_width,start_y+2*height)),Qt::AlignRight,QString("%1%").arg(SFChance[0]));
|
||||
if(FOAKChance[1] == 0 || myFoldState) {
|
||||
painter.setPen(impossible);
|
||||
} else {
|
||||
painter.setPen(possible);
|
||||
}
|
||||
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(2,start_y+2*height), QPointF(text_width,start_y+3*height)),Qt::AlignRight,"Four of a Kind");
|
||||
painter.drawText(QRectF(QPointF(percent_start,start_y+2*height), QPointF(percent_start+percent_width,start_y+3*height)),Qt::AlignRight,QString("%1%").arg(FOAKChance[0]));
|
||||
if(FHChance[1] == 0 || myFoldState) {
|
||||
painter.setPen(impossible);
|
||||
} else {
|
||||
painter.setPen(possible);
|
||||
}
|
||||
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(2,start_y+3*height), QPointF(text_width,start_y+4*height)),Qt::AlignRight,"Full House");
|
||||
painter.drawText(QRectF(QPointF(percent_start,start_y+3*height), QPointF(percent_start+percent_width,start_y+4*height)),Qt::AlignRight,QString("%1%").arg(FHChance[0]));
|
||||
if(FLChance[1] == 0 || myFoldState) {
|
||||
painter.setPen(impossible);
|
||||
} else {
|
||||
painter.setPen(possible);
|
||||
}
|
||||
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(2,start_y+4*height), QPointF(text_width,start_y+5*height)),Qt::AlignRight,"Flush");
|
||||
painter.drawText(QRectF(QPointF(percent_start,start_y+4*height), QPointF(percent_start+percent_width,start_y+5*height)),Qt::AlignRight,QString("%1%").arg(FLChance[0]));
|
||||
if(STRChance[1] == 0 || myFoldState) {
|
||||
painter.setPen(impossible);
|
||||
} else {
|
||||
painter.setPen(possible);
|
||||
}
|
||||
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(2,start_y+5*height), QPointF(text_width,start_y+6*height)),Qt::AlignRight,"Straight");
|
||||
painter.drawText(QRectF(QPointF(percent_start,start_y+5*height), QPointF(percent_start+percent_width,start_y+6*height)),Qt::AlignRight,QString("%1%").arg(STRChance[0]));
|
||||
if(TOAKChance[1] == 0 || myFoldState) {
|
||||
painter.setPen(impossible);
|
||||
} else {
|
||||
painter.setPen(possible);
|
||||
}
|
||||
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(2,start_y+6*height), QPointF(text_width,start_y+7*height)),Qt::AlignRight,"Three of a Kind");
|
||||
painter.drawText(QRectF(QPointF(percent_start,start_y+6*height), QPointF(percent_start+percent_width,start_y+7*height)),Qt::AlignRight,QString("%1%").arg(TOAKChance[0]));
|
||||
if(TPChance[1] == 0 || myFoldState) {
|
||||
painter.setPen(impossible);
|
||||
} else {
|
||||
painter.setPen(possible);
|
||||
}
|
||||
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(2,start_y+7*height), QPointF(text_width,start_y+8*height)),Qt::AlignRight,"Two Pairs");
|
||||
painter.drawText(QRectF(QPointF(percent_start,start_y+7*height), QPointF(percent_start+percent_width,start_y+8*height)),Qt::AlignRight,QString("%1%").arg(TPChance[0]));
|
||||
if(OPChance[1] == 0 || myFoldState) {
|
||||
painter.setPen(impossible);
|
||||
} else {
|
||||
painter.setPen(possible);
|
||||
}
|
||||
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(2,start_y+8*height), QPointF(text_width,start_y+9*height)),Qt::AlignRight,"One Pair");
|
||||
painter.drawText(QRectF(QPointF(percent_start,start_y+8*height), QPointF(percent_start+percent_width,start_y+9*height)),Qt::AlignRight,QString("%1%").arg(OPChance[0]));
|
||||
if(HCChance[1] == 0 || myFoldState) {
|
||||
painter.setPen(impossible);
|
||||
} else {
|
||||
painter.setPen(possible);
|
||||
}
|
||||
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(2,start_y+9*height), QPointF(text_width,start_y+10*height)),Qt::AlignRight,"Highest Card");
|
||||
painter.drawText(QRectF(QPointF(percent_start,start_y+9*height), QPointF(percent_start+percent_width,start_y+10*height)),Qt::AlignRight,QString("%1%").arg(HCChance[0]));
|
||||
|
||||
//Draw gfx
|
||||
painter.setPen(QColor(0,0,0));
|
||||
|
||||
QLinearGradient linearGrad(QPointF(89,3), QPointF(190,10));
|
||||
QLinearGradient linearGrad(QPointF(text_width+4,3), QPointF(text_width+4+bar_width,10));
|
||||
linearGrad.setColorAt(0, Qt::blue);
|
||||
linearGrad.setColorAt(0.5, Qt::yellow);
|
||||
linearGrad.setColorAt(1, Qt::red);
|
||||
@@ -190,16 +212,16 @@ void MyChanceLabel::paintEvent(QPaintEvent * /*event*/)
|
||||
painter.setOpacity(1.0);
|
||||
}
|
||||
|
||||
if(RFChance[1] != 0) painter.drawRect(89,3,(108*RFChance[0])/100,7);
|
||||
if(SFChance[1] != 0) painter.drawRect(89,16,(108*SFChance[0])/100,7);
|
||||
if(FOAKChance[1] != 0) painter.drawRect(89,29,(108*FOAKChance[0])/100,7);
|
||||
if(FHChance[1] != 0) painter.drawRect(89,42,(108*FHChance[0])/100,7);
|
||||
if(FLChance[1] != 0) painter.drawRect(89,55,(108*FLChance[0])/100,7);
|
||||
if(STRChance[1] != 0) painter.drawRect(89,68,(108*STRChance[0])/100,7);
|
||||
if(TOAKChance[1] != 0) painter.drawRect(89,81,(108*TOAKChance[0])/100,7);
|
||||
if(TPChance[1] != 0) painter.drawRect(89,94,(108*TPChance[0])/100,7);
|
||||
if(OPChance[1] != 0) painter.drawRect(89,107,(108*OPChance[0])/100,7);
|
||||
if(HCChance[1] != 0) painter.drawRect(89,120,(108*HCChance[0])/100,7);
|
||||
if(RFChance[1] != 0) painter.drawRect(text_width+4,start_y+0*height+3,(bar_width*RFChance[0])/100,bar_height);
|
||||
if(SFChance[1] != 0) painter.drawRect(text_width+4,start_y+1*height+3,(bar_width*SFChance[0])/100,bar_height);
|
||||
if(FOAKChance[1] != 0) painter.drawRect(text_width+4,start_y+2*height+3,(bar_width*FOAKChance[0])/100,bar_height);
|
||||
if(FHChance[1] != 0) painter.drawRect(text_width+4,start_y+3*height+3,(bar_width*FHChance[0])/100,bar_height);
|
||||
if(FLChance[1] != 0) painter.drawRect(text_width+4,start_y+4*height+3,(bar_width*FLChance[0])/100,bar_height);
|
||||
if(STRChance[1] != 0) painter.drawRect(text_width+4,start_y+5*height+3,(bar_width*STRChance[0])/100,bar_height);
|
||||
if(TOAKChance[1] != 0) painter.drawRect(text_width+4,start_y+6*height+3,(bar_width*TOAKChance[0])/100,bar_height);
|
||||
if(TPChance[1] != 0) painter.drawRect(text_width+4,start_y+7*height+3,(bar_width*TPChance[0])/100,bar_height);
|
||||
if(OPChance[1] != 0) painter.drawRect(text_width+4,start_y+8*height+3,(bar_width*OPChance[0])/100,bar_height);
|
||||
if(HCChance[1] != 0) painter.drawRect(text_width+4,start_y+9*height+3,(bar_width*HCChance[0])/100,bar_height);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
* You should have received a copy of the GNU Affero General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*****************************************************************************/
|
||||
#ifndef MYSLIDER_H
|
||||
#define MYSLIDER_H
|
||||
|
||||
#include <QtGui>
|
||||
/*
|
||||
* This QSlider Extension was sponsored by: AZEVEDO Filipe aka Nox P@sNox <pasnox@gmail.com>
|
||||
@@ -100,3 +103,6 @@ protected:
|
||||
QSlider::mousePressEvent( ev ); // should not be needed but as we can't update private d pointer it's needed.
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user