From 95b3c457509f50304a10171d8ed7624afd3cc824 Mon Sep 17 00:00:00 2001 From: doitux Date: Mon, 3 Sep 2007 00:26:38 +0000 Subject: [PATCH] some other gui fixes for qt-4.3.* --- src/gui/qt/gamelobbydialog.ui | 125 ++++- src/gui/qt/mainwindow.ui | 621 +-------------------- src/gui/qt/mainwindow/mainwindowimpl.cpp | 109 ++-- src/gui/qt/mainwindow/mylefttabwidget.cpp | 12 + src/gui/qt/mainwindow/myrighttabwidget.cpp | 12 + src/pokerth.cpp | 13 + 6 files changed, 191 insertions(+), 701 deletions(-) diff --git a/src/gui/qt/gamelobbydialog.ui b/src/gui/qt/gamelobbydialog.ui index 0793c440..437a166b 100644 --- a/src/gui/qt/gamelobbydialog.ui +++ b/src/gui/qt/gamelobbydialog.ui @@ -13,18 +13,42 @@ Game Lobby - + 9 - + + 9 + + + 9 + + + 9 + + + 6 + + 6 - + 0 - + + 0 + + + 0 + + + 0 + + + 6 + + 6 @@ -33,10 +57,22 @@ Lobby-Chat - + 7 - + + 7 + + + 7 + + + 7 + + + 0 + + 0 @@ -57,12 +93,21 @@ - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + @@ -124,10 +169,22 @@ Game Info - + 9 - + + 9 + + + 9 + + + 9 + + + 6 + + 6 @@ -160,12 +217,21 @@ - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + @@ -220,10 +286,22 @@ - + 0 - + + 0 + + + 0 + + + 0 + + + 6 + + 6 @@ -318,12 +396,21 @@ p, li { white-space: pre-wrap; } - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + diff --git a/src/gui/qt/mainwindow.ui b/src/gui/qt/mainwindow.ui index def583db..ebcfb5f3 100644 --- a/src/gui/qt/mainwindow.ui +++ b/src/gui/qt/mainwindow.ui @@ -28,7 +28,7 @@ - PokerTH 0.5 - The Open-Source Texas Holdem Engine + PokerTH 0.6 - The Open-Source Texas Holdem Engine @@ -164,9 +164,6 @@ - - QTabWidget::Rounded - 0 @@ -227,232 +224,6 @@ - - - - - - - 240 - 240 - 240 - - - - - - - 40 - 82 - 0 - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - 29 - 59 - 0 - - - - - - - 29 - 59 - 0 - - - - - - - 240 - 240 - 240 - - - - - - - - - 240 - 240 - 240 - - - - - - - 40 - 82 - 0 - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - 29 - 59 - 0 - - - - - - - 29 - 59 - 0 - - - - - - - 240 - 240 - 240 - - - - - - - - - 128 - 128 - 128 - - - - - - - 40 - 82 - 0 - - - - - - - 240 - 240 - 240 - - - - - - - 199 - 199 - 199 - - - - - - - 240 - 240 - 240 - - - - - - - 29 - 59 - 0 - - - - - - - 29 - 59 - 0 - - - - - - - 240 - 240 - 240 - - - - - - Qt::NoFocus @@ -462,99 +233,7 @@ - - - - - - - - 29 - 59 - 0 - - - - - - - 29 - 59 - 0 - - - - - - - 29 - 59 - 0 - - - - - - - - - 29 - 59 - 0 - - - - - - - 29 - 59 - 0 - - - - - - - 29 - 59 - 0 - - - - - - - - - 29 - 59 - 0 - - - - - - - 29 - 59 - 0 - - - - - - - 29 - 59 - 0 - - - - - - - + @@ -1268,9 +947,6 @@ - - QTabWidget::Rounded - 0 @@ -1484,46 +1160,6 @@ 0 - - - - - - - 203 - 237 - 180 - - - - - - - - - 203 - 237 - 180 - - - - - - - - - 203 - 237 - 180 - - - - - - - - Qt::NoFocus - 1 @@ -1549,259 +1185,6 @@ 20 - - - - - - - 240 - 240 - 240 - - - - - - - 40 - 82 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 240 - 240 - 240 - - - - - - - 255 - 255 - 255 - - - - - - - 240 - 240 - 240 - - - - - - - 40 - 82 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 232 - 232 - 232 - - - - - - - - - 240 - 240 - 240 - - - - - - - 40 - 82 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 240 - 240 - 240 - - - - - - - 255 - 255 - 255 - - - - - - - 240 - 240 - 240 - - - - - - - 40 - 82 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 232 - 232 - 232 - - - - - - - - - 131 - 153 - 86 - - - - - - - 40 - 82 - 0 - - - - - - - 131 - 153 - 86 - - - - - - - 131 - 153 - 86 - - - - - - - 131 - 153 - 86 - - - - - - - 131 - 153 - 86 - - - - - - - 40 - 82 - 0 - - - - - - - 131 - 153 - 86 - - - - - - - 131 - 153 - 86 - - - - - - Qt::NoFocus diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 8d2f5ca6..cf8b779f 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -85,24 +85,6 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent) flopValuesFile.copy(QString::fromUtf8(myConfig->readConfigString("DataDir").c_str())+QString("flopValues")); // } -// Schriftart laden und für Dialoge setzen -#ifdef _WIN32 - QFont tmpFont1; - tmpFont1.setFamily("Arial"); - tmpFont1.setPixelSize(12); -// if(this->logicalDpiX() > 105) { tmpFont.setFont("Arial",8); } -// else { QFont tmpFont("Arial",9); } - -#else - QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/n019003l.pfb"); - QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/VeraBd.ttf"); -// QFont tmpFont("Nimbus Sans L",9); - QFont tmpFont1; - tmpFont1.setFamily("Nimbus Sans L"); - tmpFont1.setPixelSize(12); -#endif - QApplication::setFont(tmpFont1); - setupUi(this); //pixmapCardsLabel erstellen und ins Layout einfügen! @@ -416,69 +398,67 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent) inactive.setRgb(83,141,107); highlight.setRgb(151,214,109); + + +// Schriftart laden und für Dialoge setzen +#ifdef _WIN32 + QString font1String("font-family: \"Arial\";"); +// if(this->logicalDpiX() > 105) { tmpFont.setFont("Arial",8); } +// else { QFont tmpFont("Arial",9); } +#else + QString font1String("font-family: \"Nimbus Sans L\";"); +#endif + //Schriftart und Schriftgrößen für Widgets festlegen #ifdef _WIN32 - tmpFont1.setPixelSize(11); - textBrowser_Log->setStyleSheet("QTextBrowser { font-family: \"Nimbus Sans L\"; font-size: 11px; color: white; background-color: #285200; border-color: #669900;}"); + textBrowser_Log->setStyleSheet("QTextBrowser { "+ font1String +" font-size: 11px; color: white; background-color: #1D3B00; border:none; }"); #else - tmpFont1.setPixelSize(10); - textBrowser_Log->setStyleSheet("QTextBrowser { font-family: \"Nimbus Sans L\"; font-size: 10px; color: white; background-color: #285200; border-color: #669900; }"); - textBrowser_Chat->setStyleSheet("QTextBrowser { font-family: \"Nimbus Sans L\"; font-size: 10px; color: white; background-color: #285200; border-color: #669900; }"); - lineEdit_ChatInput->setStyleSheet("QLineEdit { font-family: \"Nimbus Sans L\"; font-size: 10px; color: white; background-color: #285200; border-color: #669900; }"); + textBrowser_Log->setStyleSheet("QTextBrowser { "+ font1String +" font-size: 10px; color: white; background-color: #1D3B00; border:none; }"); + textBrowser_Chat->setStyleSheet("QTextBrowser { "+ font1String +" font-size: 10px; color: white; background-color: #1D3B00; border:none; }"); + lineEdit_ChatInput->setStyleSheet("QLineEdit { "+ font1String +" font-size: 10px; color: white; background-color: #1D3B00; border-top: 2px solid #286400; }"); #endif #ifdef __APPLE__ - tmpFont1.setPixelSize(11); - tabWidget_Right->setStyleSheet("QTabWidget { font-family: \"Nimbus Sans L\"; font-size: 11px; font-color: white; border-color: #669900; }"); - tabWidget_Left->setStyleSheet("QTabWidget { font-family: \"Nimbus Sans L\"; font-size: 11px; font-color: white; border-color: #669900;}"); +// tabWidget_Right->setStyleSheet("QTabWidget { "+ font1String +" font-size: 11px; background-color: #145300; }"); +// tabWidget_Left->setStyleSheet("QTabWidget { "+ font1String +" font-size: 11px; background-color: #145300;}"); #else - tmpFont1.setPixelSize(10); - tabWidget_Right->setStyleSheet("QTabWidget::pane { font-family: \"Nimbus Sans L\"; font-size: 10px; border-color: #669900; }"); - tabWidget_Left->setStyleSheet("QTabWidget::pane { font-family: \"Nimbus Sans L\"; font-size: 10px; border-color: #669900; }"); +// 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 - QFont tmpFont2; - tmpFont2.setFamily("Bitstream Vera Sans"); - - tmpFont2.setPixelSize(10); + QString font2String("font-family: \"Bitstream Vera Sans\";"); + for (i=0; isetStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 10px }"); - cashLabelArray[i]->setStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 10px }"); + cashTopLabelArray[i]->setStyleSheet("QLabel { "+ font2String +" font-size: 10px }"); + cashLabelArray[i]->setStyleSheet("QLabel { "+ font2String +" font-size: 10px }"); } - spinBox_set->setFont(tmpFont2); + spinBox_set->setStyleSheet("QSpinBox { "+ font2String +" font-size: 10px }"); - - tmpFont2.setPixelSize(12); for (i=0; isetStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 12px }"); + setLabelArray[i]->setStyleSheet("QLabel { "+ font2String +" font-size: 12px }"); } - tmpFont2.setPixelSize(13); for (i=0; isetStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 13px }"); + playerNameLabelArray[i]->setStyleSheet("QLabel { "+ font2String +" font-size: 13px }"); } - label_Sets->setStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 13px }"); - label_Total->setStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 13px }"); - textLabel_Sets->setStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 13px }"); - textLabel_Pot->setStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 13px }"); - label_handNumber->setStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 13px }"); - label_gameNumber->setStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 13px }"); - textLabel_handNumber->setStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 13px }"); - textLabel_gameNumber->setStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 13px }"); + label_Sets->setStyleSheet("QLabel { "+ font2String +" font-size: 13px }"); + label_Total->setStyleSheet("QLabel { "+ font2String +" font-size: 13px }"); + textLabel_Sets->setStyleSheet("QLabel { "+ font2String +" font-size: 13px }"); + textLabel_Pot->setStyleSheet("QLabel { "+ font2String +" font-size: 13px }"); + label_handNumber->setStyleSheet("QLabel { "+ font2String +" font-size: 13px }"); + label_gameNumber->setStyleSheet("QLabel { "+ font2String +" font-size: 13px }"); + textLabel_handNumber->setStyleSheet("QLabel { "+ font2String +" font-size: 13px }"); + textLabel_gameNumber->setStyleSheet("QLabel { "+ font2String +" font-size: 13px }"); -// tmpFont2.setPixelSize(15); - tmpFont2.setPixelSize(17); - tmpFont2.setBold(TRUE); - textLabel_handLabel->setStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 17px }"); + textLabel_handLabel->setStyleSheet("QLabel { "+ font2String +" font-size: 17px; font-weight: bold; }"); - tmpFont2.setPixelSize(18); - label_Pot->setStyleSheet("QLabel { font-family: \"Bitstream Vera Sans\"; font-size: 18px }"); + label_Pot->setStyleSheet("QLabel { "+ font2String +" font-size: 18px; font-weight: bold; }"); //Widgets Grafiken setzen @@ -493,6 +473,12 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent) //Widgets Grafiken per Stylesheets setzen this->setStyleSheet("QMainWindow { background-image: url(" + myQtHelper->getDataPath() +"gfx/gui/table/default/table.png); background-position: bottom center; background-origin: content;}"); + menubar->setStyleSheet("QMenuBar { background-color: #145300; } QMenuBar::item { color: #669800; }"); + + pushButton_break->setStyleSheet("QPushButton { background-color: #145300; color: white;}"); + + horizontalSlider_speed->setStyleSheet("QSlider::groove:horizontal { border: 1px solid #286400; height: 3px; background: #689700; } QSlider::handle:horizontal { background: #689700; border: 1px solid #286400; width: 10px; border-radius: 3px; }"); + //Groupbox Background for (i=1; ipalette(); + QString style = pushButton_break->styleSheet(); - if(tempPalette.color(QPalette::Button).red()==40) { - tempPalette.setColor(QPalette::Button, QColor(113,162,0)); - tempPalette.setColor(QPalette::ButtonText, QColor(0,0,0)); + if(style.contains("QPushButton { background-color: #145300;")) { + pushButton_break->setStyleSheet("QPushButton { background-color: #6E9E00; color: black;}"); } else { - tempPalette.setColor(QPalette::Button, QColor(40,82,0)); - tempPalette.setColor(QPalette::ButtonText, QColor(240,240,240)); + pushButton_break->setStyleSheet("QPushButton { background-color: #145300; color: white;}"); } - pushButton_break->setPalette(tempPalette); } void mainWindowImpl::sendChatMessage() { myChat->sendMessage(); } diff --git a/src/gui/qt/mainwindow/mylefttabwidget.cpp b/src/gui/qt/mainwindow/mylefttabwidget.cpp index 39d0e27e..1bc02fd0 100644 --- a/src/gui/qt/mainwindow/mylefttabwidget.cpp +++ b/src/gui/qt/mainwindow/mylefttabwidget.cpp @@ -22,6 +22,18 @@ MyLeftTabWidget::MyLeftTabWidget(QGroupBox *parent) chatBlinkTimer = new QTimer; connect(chatBlinkTimer, SIGNAL(timeout()), this, SLOT( blinkChatTab() )); + + this->setStyleSheet("QTabWidget::pane { border: 2px solid #286400; border-radius: 2px; background-color: #145300; } QTabWidget::tab-bar { left: 5px; } "); + +#ifdef _WIN32 + QString font1String("font-family: \"Arial\";"); +#else + QString font1String("font-family: \"Nimbus Sans L\";"); +#endif + + QTabBar *myTabBar = this->tabBar(); + myTabBar->setStyleSheet("QTabBar::tab{ "+ font1String +" font-size: 11px; color: white; background-color: #145300; border: 2px solid #286400; border-bottom-color: #145300; border-top-left-radius: 4px; border-top-right-radius: 4px; min-width: 8ex; padding: 0px;} QTabBar::tab:selected, QTabBar::tab:hover { background-color: #145300; } QTabBar::tab:selected { border-color: #286400; border-bottom-color: #145300; } QTabBar::tab:!selected { margin-top: 2px; } QTabBar::tab:selected { margin-left: -4px; margin-right: -4px; } QTabBar::tab:first:selected { margin-left: 0; } QTabBar::tab:last:selected { margin-right: 0; } QTabBar::tab:only-one { margin: 0; }"); + } diff --git a/src/gui/qt/mainwindow/myrighttabwidget.cpp b/src/gui/qt/mainwindow/myrighttabwidget.cpp index 6e1f2b1c..256a329e 100644 --- a/src/gui/qt/mainwindow/myrighttabwidget.cpp +++ b/src/gui/qt/mainwindow/myrighttabwidget.cpp @@ -22,6 +22,18 @@ MyRightTabWidget::MyRightTabWidget(QGroupBox *parent) // chatBlinkTimer = new QTimer; // connect(chatBlinkTimer, SIGNAL(timeout()), this, SLOT( blinkChatTab() )); + + this->setStyleSheet("QTabWidget::pane { border: 2px solid #286400; border-radius: 2px; background-color: #145300; } QTabWidget::tab-bar { left: 5px; } "); + +#ifdef _WIN32 + QString font1String("font-family: \"Arial\";"); +#else + QString font1String("font-family: \"Nimbus Sans L\";"); +#endif + + QTabBar *myTabBar = this->tabBar(); + myTabBar->setStyleSheet("QTabBar::tab{ "+ font1String +" font-size: 11px; color: white; background-color: #145300; border: 2px solid #286400; border-bottom-color: #145300; border-top-left-radius: 4px; border-top-right-radius: 4px; min-width: 8ex; padding: 0px;} QTabBar::tab:selected, QTabBar::tab:hover { background-color: #145300; } QTabBar::tab:selected { border-color: #286400; border-bottom-color: #145300; } QTabBar::tab:!selected { margin-top: 2px; } QTabBar::tab:selected { margin-left: -4px; margin-right: -4px; } QTabBar::tab:first:selected { margin-left: 0; } QTabBar::tab:last:selected { margin-right: 0; } QTabBar::tab:only-one { margin: 0; }"); + } diff --git a/src/pokerth.cpp b/src/pokerth.cpp index 183c8dd8..03bac386 100755 --- a/src/pokerth.cpp +++ b/src/pokerth.cpp @@ -80,6 +80,19 @@ int main( int argc, char **argv ) // set PlastiqueStyle even for mac-version to prevent artefacts on styled widgets a.setStyle(new QPlastiqueStyle); + + //set QApplication default font +#ifdef _WIN32 + QString font1String("font-family: \"Arial\";"); + +#else + QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/n019003l.pfb"); + QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/VeraBd.ttf"); + + QString font1String("font-family: \"Nimbus Sans L\";"); +#endif + a.setStyleSheet("QApplication { " + font1String + " font-size: 12px; }"); + QTranslator qtTranslator; qtTranslator.load(QString(myQtHelper->getDataPath() +"translations/qt_") + QString::fromStdString(myConfig->readConfigString("Language")));