From dd16cdee48c494c090fbc531ac93063cf7a9e3c7 Mon Sep 17 00:00:00 2001 From: doitux Date: Fri, 27 Mar 2009 00:33:26 +0000 Subject: [PATCH] F1-F4 key indicator dynamical displayed on buttons now. --- pokerth_game.pro | 4 +- src/gui/qt/gametable.ui | 13 +++-- src/gui/qt/gametable/gametableimpl.cpp | 39 +++++++++++++- src/gui/qt/gametable/gametableimpl.h | 1 + src/gui/qt/gametable/myactionbutton.cpp | 39 ++++++++++++++ src/gui/qt/gametable/myactionbutton.h | 33 ++++++++++++ src/gui/qt/resources/fill-color.png | Bin 0 -> 2508 bytes src/gui/qt/resources/pokerth.qrc | 69 ++++++++++++------------ src/gui/qt/settingsdialog.ui | 44 +++++++++++++++ 9 files changed, 202 insertions(+), 40 deletions(-) create mode 100644 src/gui/qt/gametable/myactionbutton.cpp create mode 100644 src/gui/qt/gametable/myactionbutton.h create mode 100755 src/gui/qt/resources/fill-color.png diff --git a/pokerth_game.pro b/pokerth_game.pro index 47fc4ec5..c7bf03bf 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -11,7 +11,7 @@ CONFIG += qt thread embed_manifest_exe exceptions rtti stl warn_on release #CONFIG += qt thread embed_manifest_exe exceptions rtti stl warn_on debug #####Uncomment this for RELEASE on Linux/Unix/BSD (only for static Qt) -#QTPLUGIN += qjpeg qgif +QTPLUGIN += qjpeg qgif UI_DIR = uics MOC_DIR = mocs @@ -152,6 +152,7 @@ HEADERS += \ src/gui/qt/gametable/gametableimpl.h \ src/gui/qt/gametable/mycardspixmaplabel.h \ src/gui/qt/gametable/mysetlabel.h \ + src/gui/qt/gametable/myactionbutton.h \ src/gui/qt/gametable/mystatuslabel.h \ src/gui/qt/gametable/myavatarlabel.h \ src/gui/qt/gametable/myrighttabwidget.h \ @@ -215,6 +216,7 @@ SOURCES += \ src/gui/qt/gametable/gametableimpl.cpp \ src/gui/qt/gametable/mycardspixmaplabel.cpp \ src/gui/qt/gametable/mysetlabel.cpp \ + src/gui/qt/gametable/myactionbutton.cpp \ src/gui/qt/gametable/mystatuslabel.cpp \ src/gui/qt/gametable/myavatarlabel.cpp \ src/gui/qt/gametable/myrighttabwidget.cpp \ diff --git a/src/gui/qt/gametable.ui b/src/gui/qt/gametable.ui index 28675c4e..e4804100 100644 --- a/src/gui/qt/gametable.ui +++ b/src/gui/qt/gametable.ui @@ -2763,7 +2763,7 @@ - + 50 @@ -2897,7 +2897,7 @@ - + 0 @@ -2922,7 +2922,7 @@ - + 0 @@ -2947,7 +2947,7 @@ - + 0 @@ -3683,6 +3683,11 @@ QLabel
mychancelabel.h
+ + MyActionButton + QPushButton +
myactionbutton.h
+
diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index c83b87f8..8cb80c90 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -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"); + } + } +} diff --git a/src/gui/qt/gametable/gametableimpl.h b/src/gui/qt/gametable/gametableimpl.h index be0ce908..d8d9ecfb 100755 --- a/src/gui/qt/gametable/gametableimpl.h +++ b/src/gui/qt/gametable/gametableimpl.h @@ -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(); diff --git a/src/gui/qt/gametable/myactionbutton.cpp b/src/gui/qt/gametable/myactionbutton.cpp new file mode 100644 index 00000000..77d5fa17 --- /dev/null +++ b/src/gui/qt/gametable/myactionbutton.cpp @@ -0,0 +1,39 @@ +// +// C++ Implementation: mycardspixmaplabel +// +// Description: +// +// +// Author: FThauer FHammer , (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); +} diff --git a/src/gui/qt/gametable/myactionbutton.h b/src/gui/qt/gametable/myactionbutton.h new file mode 100644 index 00000000..de04d0a1 --- /dev/null +++ b/src/gui/qt/gametable/myactionbutton.h @@ -0,0 +1,33 @@ +// +// C++ Interface: mycardspixmaplabel +// +// Description: +// +// +// Author: FThauer FHammer , (C) 2007 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef MYACTIONBUTTON_H +#define MYACTIONBUTTON_H + +#include +#include + +class MyActionButton : public QPushButton +{ +public: + MyActionButton(QGroupBox*); + + ~MyActionButton(); + + void paintEvent(QPaintEvent * event); + void setFKeyText ( const QString& theValue ){fKeyText = theValue;} + +private: + + QString fKeyText; +}; + +#endif diff --git a/src/gui/qt/resources/fill-color.png b/src/gui/qt/resources/fill-color.png new file mode 100755 index 0000000000000000000000000000000000000000..af5421e3158daa3861cae236de0987aa4d2b4f3a GIT binary patch literal 2508 zcmV;-2{ZPIP)qsBOiC?iqJ zn#nk7oNQ=JG!-o;lb}?B0nG?R1Vy_+VcbPTR5saH+dwzSqSEYp+wA++3;&#Vt2@($ zBQaBRt3F=WeckW>-#O>rdtd-w7-lb9NgN;!6H^WE*)y>dv7gvWjD68({uc4Y#BCx< z$5mo-Zf@>q57*d_H_W<_;9w+xO5gVUc9v>gy7#w_F z1g~Ny4;deZ!dnr3T69DsI9>$-u;MaFDpK&i_fCU7YGqLzQ z6N#b(=<|*_UaZEa|3YC=_26&^l(h_tjc+_-TA0RaIxdh{sV+}v>K z(k1PcD_8!wiv`X9jEO>sC?b3pJNw?R8X(a>b737{CnY_us;yOabaY@~U;zF7{b+7( z)*IjvxO3+YPM<#gi-CxU2*_lz^iSCtcR}2MtM4<9F(Vrgi}&iq{Uwr$%9l-|j{N+5e*ehY&_ph5fGZ20Iidl| z`y4^sBPB)txJ0f|C=?LF-rd~|iUJR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SyYQq)#*c97A5RLYeXfC(j7<-l zHLFdy8qSMEBG;s(B>7rh=PIw zp@}BT;9m(eA$e1&Si{Gb)^!EJu1LCPupZXXZKm3ZZkjad_MGv+o9ErC~ zO-)@0XZpOBa3a - - view-fullscreen.png - pokerth.qrc - swbuttoninternetgame.png - swbuttoncreatenetworkgame.png - swbuttonjoinnetworkgame.png - media_podcast.png - system_users_big.png - swbuttonlocalgame.png - tools_wizard.png - speaker.png - player_play.png - arrow_right_double.png - view_refresh.png - arrow_left_double.png - list_remove_user.png - user.png - application_exit.png - system_users.png - list_add_user.png - list_add.png - audio_input_microphone.png - utilities-log-viewer.png - preferences-desktop.png - dialog_close.png - systemsettings.png - editdelete.png - user_properties.png - printer1.png - pdf.png - preferences_desktop_user.png - dialog_ok_apply.png - filesave.png - + + view-fullscreen.png + pokerth.qrc + swbuttoninternetgame.png + swbuttoncreatenetworkgame.png + swbuttonjoinnetworkgame.png + media_podcast.png + system_users_big.png + swbuttonlocalgame.png + tools_wizard.png + speaker.png + player_play.png + arrow_right_double.png + view_refresh.png + arrow_left_double.png + list_remove_user.png + user.png + application_exit.png + system_users.png + list_add_user.png + list_add.png + audio_input_microphone.png + utilities-log-viewer.png + preferences-desktop.png + dialog_close.png + systemsettings.png + editdelete.png + user_properties.png + printer1.png + pdf.png + preferences_desktop_user.png + dialog_ok_apply.png + filesave.png + fill-color.png + diff --git a/src/gui/qt/settingsdialog.ui b/src/gui/qt/settingsdialog.ui index 1f404ed7..ddb44f4e 100644 --- a/src/gui/qt/settingsdialog.ui +++ b/src/gui/qt/settingsdialog.ui @@ -57,6 +57,15 @@ :/gfx/preferences-desktop.png:/gfx/preferences-desktop.png
+ + + Style + + + + :/gfx/fill-color.png:/gfx/fill-color.png + + Sound @@ -372,6 +381,41 @@ p, li { white-space: pre-wrap; } + + + + + + QLabel { font-weight: bold; } + + + Style + + + + + + + Qt::Horizontal + + + + + + + Game Table Styles + + + + + + + Card Decks + + + + +