F1-F4 key indicator dynamical displayed on buttons now.
This commit is contained in:
1 parent
b096149678
commit
dd16cdee48
9 files changed
+202
-40
No files matched your search
@@ -27,6 +27,7 @@
|
||||
#include "mycardspixmaplabel.h"
|
||||
#include "mysetlabel.h"
|
||||
#include "myavatarlabel.h"
|
||||
#include "myactionbutton.h"
|
||||
#include "mychancelabel.h"
|
||||
#include "log.h"
|
||||
#include "chat.h"
|
||||
@@ -428,6 +429,8 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||
|
||||
pushButton_AllIn->setStyleSheet("QPushButton:enabled { background-color: #145300; color: #99D500;} QPushButton:disabled { background-color: #145300; color: #486F3E; font-weight: 900;}");
|
||||
|
||||
|
||||
|
||||
// away radiobuttons
|
||||
// QString radioButtonString("QRadioButton { color: #99D500; } QRadioButton::indicator { width: 13px; height: 13px; } QRadioButton::indicator::checked { image: url("+myAppDataPath+"gfx/gui/misc/radiobutton_checked.png); }");
|
||||
QString radioButtonString("QRadioButton { color: #99D500; } QRadioButton::indicator { width: 13px; height: 13px;} QRadioButton::indicator::checked { image: url("+myAppDataPath+"gfx/gui/misc/radiobutton_checked.png);} QRadioButton::indicator::unchecked { image: url("+myAppDataPath+"gfx/gui/misc/radiobutton_unchecked.png);} QRadioButton::indicator:unchecked:hover { image: url("+myAppDataPath+"gfx/gui/misc/radiobutton_unchecked_hover.png);} QRadioButton::indicator:unchecked:pressed { image: url("+myAppDataPath+"gfx/gui/misc/radiobutton_pressed.png);} QRadioButton::indicator::checked { image: url("+myAppDataPath+"gfx/gui/misc/radiobutton_checked.png);} QRadioButton::indicator:checked:hover { image: url("+myAppDataPath+"gfx/gui/misc/radiobutton_checked_hover.png);} QRadioButton::indicator:checked:pressed { image: url("+myAppDataPath+"gfx/gui/misc/radiobutton_pressed.png);}");
|
||||
@@ -1389,6 +1392,8 @@ void gameTableImpl::provideMyActions(int mode) {
|
||||
lineEdit_betValue->setDisabled(TRUE);
|
||||
|
||||
myButtonsCheckable(FALSE);
|
||||
|
||||
refreshActionButtonFKeyIndicator(1);
|
||||
}
|
||||
else {
|
||||
pushButton_AllIn->setEnabled(TRUE);
|
||||
@@ -1406,7 +1411,8 @@ void gameTableImpl::provideMyActions(int mode) {
|
||||
else { pushButtonCallCheckString = "Call $"+QString::number(getMyCallAmount()); }
|
||||
|
||||
pushButtonFoldString = "Fold";
|
||||
|
||||
|
||||
refreshActionButtonFKeyIndicator();
|
||||
}
|
||||
else { // flop,turn,river
|
||||
|
||||
@@ -1425,6 +1431,7 @@ void gameTableImpl::provideMyActions(int mode) {
|
||||
pushButtonBetRaiseString = "Raise $"+QString::number(getMyBetAmount());
|
||||
}
|
||||
}
|
||||
refreshActionButtonFKeyIndicator();
|
||||
}
|
||||
|
||||
if(mode == 0) {
|
||||
@@ -1433,6 +1440,8 @@ void gameTableImpl::provideMyActions(int mode) {
|
||||
pushButtonCallCheckString = "Check";
|
||||
if( (currentGame->getActivePlayerList()->size() > 2 && currentGame->getSeatsList()->front()->getMyButton() == BUTTON_SMALL_BLIND ) || ( currentGame->getActivePlayerList()->size() <= 2 && currentGame->getSeatsList()->front()->getMyButton() == BUTTON_BIG_BLIND)) { pushButtonFoldString = "Fold"; }
|
||||
else { pushButtonFoldString = "Check / Fold"; }
|
||||
|
||||
refreshActionButtonFKeyIndicator();
|
||||
}
|
||||
else {
|
||||
pushButtonBetRaiseString = "";
|
||||
@@ -1443,6 +1452,8 @@ void gameTableImpl::provideMyActions(int mode) {
|
||||
lineEdit_betValue->setDisabled(TRUE);
|
||||
|
||||
myButtonsCheckable(FALSE);
|
||||
|
||||
refreshActionButtonFKeyIndicator(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2934,6 +2945,8 @@ void gameTableImpl::resetMyButtonsCheckStateMemory() {
|
||||
|
||||
void gameTableImpl::clearMyButtons() {
|
||||
|
||||
refreshActionButtonFKeyIndicator(1);
|
||||
|
||||
pushButton_BetRaise->setText("");
|
||||
pushButton_CallCheck->setText("");
|
||||
pushButton_Fold->setText("");
|
||||
@@ -3232,3 +3245,27 @@ void gameTableImpl::refreshCardsChance(GameState bero)
|
||||
|
||||
delete myCardsValue;
|
||||
}
|
||||
|
||||
void gameTableImpl::refreshActionButtonFKeyIndicator(bool clear)
|
||||
{
|
||||
if(clear) {
|
||||
pushButton_AllIn->setFKeyText("");
|
||||
pushButton_BetRaise->setFKeyText("");
|
||||
pushButton_CallCheck->setFKeyText("");
|
||||
pushButton_Fold->setFKeyText("");
|
||||
}
|
||||
else {
|
||||
if(myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ){
|
||||
pushButton_AllIn->setFKeyText("F4");
|
||||
pushButton_BetRaise->setFKeyText("F3");
|
||||
pushButton_CallCheck->setFKeyText("F2");
|
||||
pushButton_Fold->setFKeyText("F1");
|
||||
}
|
||||
else {
|
||||
pushButton_AllIn->setFKeyText("F1");
|
||||
pushButton_BetRaise->setFKeyText("F2");
|
||||
pushButton_CallCheck->setFKeyText("F3");
|
||||
pushButton_Fold->setFKeyText("F4");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,6 +139,7 @@ public slots:
|
||||
void refreshGameLabels(int);
|
||||
void refreshButton();
|
||||
void refreshPlayerAvatar();
|
||||
void refreshActionButtonFKeyIndicator(bool =0);
|
||||
void setPlayerAvatar(int myID, QString myAvatar);
|
||||
|
||||
void guiUpdateDone();
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// C++ Implementation: mycardspixmaplabel
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#include "myactionbutton.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
MyActionButton::MyActionButton(QGroupBox* parent)
|
||||
: QPushButton(parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
MyActionButton::~MyActionButton()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void MyActionButton::paintEvent(QPaintEvent * event) {
|
||||
|
||||
QPushButton::paintEvent(event);
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setPen(QColor(240,240,240));
|
||||
painter.setOpacity(0.5);
|
||||
QFont f= painter.font();
|
||||
f.setPixelSize(9);
|
||||
painter.setFont(f);
|
||||
painter.drawText(8,11,15,15,Qt::AlignLeft,fKeyText);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// C++ Interface: mycardspixmaplabel
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
//
|
||||
// Author: FThauer FHammer <f.thauer@web.de>, (C) 2007
|
||||
//
|
||||
// Copyright: See COPYING file that comes with this distribution
|
||||
//
|
||||
//
|
||||
#ifndef MYACTIONBUTTON_H
|
||||
#define MYACTIONBUTTON_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QtCore>
|
||||
|
||||
class MyActionButton : public QPushButton
|
||||
{
|
||||
public:
|
||||
MyActionButton(QGroupBox*);
|
||||
|
||||
~MyActionButton();
|
||||
|
||||
void paintEvent(QPaintEvent * event);
|
||||
void setFKeyText ( const QString& theValue ){fKeyText = theValue;}
|
||||
|
||||
private:
|
||||
|
||||
QString fKeyText;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user