summaryrefslogtreecommitdiff
authorwaspe <waspe>2003-06-05 06:48:39 (UTC)
committer waspe <waspe>2003-06-05 06:48:39 (UTC)
commit2f3202871135e2efc67c0cdef9b93d4c4953f372 (patch) (unidiff)
treea988198fdf08bd48d98a961a2194b59177af7013
parentb72cce3813dfb64fd6d1920961b236c8e27bd27b (diff)
downloadopie-2f3202871135e2efc67c0cdef9b93d4c4953f372.zip
opie-2f3202871135e2efc67c0cdef9b93d4c4953f372.tar.gz
opie-2f3202871135e2efc67c0cdef9b93d4c4953f372.tar.bz2
backround of canvas now in syscolor
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/backgammon/backgammon.cpp2
-rw-r--r--noncore/games/backgammon/backgammon.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/noncore/games/backgammon/backgammon.cpp b/noncore/games/backgammon/backgammon.cpp
index 06523f1..db1a058 100644
--- a/noncore/games/backgammon/backgammon.cpp
+++ b/noncore/games/backgammon/backgammon.cpp
@@ -122,32 +122,34 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl)
122 thememenu->insertItem(tr( "Default"),this,SLOT(themedefault())); 122 thememenu->insertItem(tr( "Default"),this,SLOT(themedefault()));
123 thememenu->insertItem(tr( "Delete" ),this,SLOT(deletetheme())); 123 thememenu->insertItem(tr( "Delete" ),this,SLOT(deletetheme()));
124 menuBar->insertItem(tr( "Theme" ),thememenu); 124 menuBar->insertItem(tr( "Theme" ),thememenu);
125 125
126 QPopupMenu* optionmenu=new QPopupMenu(this); 126 QPopupMenu* optionmenu=new QPopupMenu(this);
127 optionmenu->insertItem(tr( "Player" ),this,SLOT(playerselect())); 127 optionmenu->insertItem(tr( "Player" ),this,SLOT(playerselect()));
128 optionmenu->insertSeparator(); 128 optionmenu->insertSeparator();
129 optionmenu->insertItem(tr( "AI" ),this,SLOT(modify_AI())); 129 optionmenu->insertItem(tr( "AI" ),this,SLOT(modify_AI()));
130 optionmenu->insertItem(tr( "Rules" ),this,SLOT(setrules())); 130 optionmenu->insertItem(tr( "Rules" ),this,SLOT(setrules()));
131 menuBar->insertItem(tr( "Options"),optionmenu); 131 menuBar->insertItem(tr( "Options"),optionmenu);
132 132
133 QWidget* mainarea=new QWidget(this); 133 QWidget* mainarea=new QWidget(this);
134 setCentralWidget(mainarea); 134 setCentralWidget(mainarea);
135 //the main area 135 //the main area
136 QBoxLayout* layout=new QBoxLayout(mainarea,QBoxLayout::TopToBottom); 136 QBoxLayout* layout=new QBoxLayout(mainarea,QBoxLayout::TopToBottom);
137 area=new QCanvas(235,235); 137 area=new QCanvas(235,235);
138 QColor bgColor=palette().color(QPalette::Normal,QColorGroup::Background);
139 area->setBackgroundColor(bgColor);
138 boardview=new BackGammonView(area,mainarea); 140 boardview=new BackGammonView(area,mainarea);
139 boardview->setMaximumHeight(240); 141 boardview->setMaximumHeight(240);
140 layout->addWidget(boardview); 142 layout->addWidget(boardview);
141 connect(boardview,SIGNAL(mouse(int,int)),this,SLOT(mouse(int,int))); 143 connect(boardview,SIGNAL(mouse(int,int)),this,SLOT(mouse(int,int)));
142 //status bar 144 //status bar
143 message=new QLabel("<b>Backgammon</b>",mainarea); 145 message=new QLabel("<b>Backgammon</b>",mainarea);
144 message->setAlignment(AlignHCenter); 146 message->setAlignment(AlignHCenter);
145 layout->addWidget(message); 147 layout->addWidget(message);
146 148
147 //the marker 149 //the marker
148 marker_current=new QCanvasRectangle(area); 150 marker_current=new QCanvasRectangle(area);
149 marker_current->setBrush(QColor(0,0,255)); 151 marker_current->setBrush(QColor(0,0,255));
150 marker_current->setSize(15,5); 152 marker_current->setSize(15,5);
151 marker_current->setZ(1); 153 marker_current->setZ(1);
152 154
153 for(a=0;a<4;a++) 155 for(a=0;a<4;a++)
diff --git a/noncore/games/backgammon/backgammon.h b/noncore/games/backgammon/backgammon.h
index e3276f1..d803489 100644
--- a/noncore/games/backgammon/backgammon.h
+++ b/noncore/games/backgammon/backgammon.h
@@ -5,33 +5,32 @@
5#include "canvasimageitem.h" 5#include "canvasimageitem.h"
6//#include "rulesdialog.h" 6//#include "rulesdialog.h"
7#include "moveengine.h" 7#include "moveengine.h"
8 8
9 9
10#include <qlabel.h> 10#include <qlabel.h>
11#include <qmainwindow.h> 11#include <qmainwindow.h>
12//#include <qwidget.h> 12//#include <qwidget.h>
13 13
14 14
15 15
16 16
17class BackGammon : public QMainWindow 17class BackGammon : public QMainWindow
18{ 18{
19 Q_OBJECT 19 Q_OBJECT
20private: 20private:
21 //GUI
22 //the "status" bar 21 //the "status" bar
23 QLabel* message; 22 QLabel* message;
24 //the main drawing area 23 //the main drawing area
25 QCanvas* area; 24 QCanvas* area;
26 BackGammonView* boardview; 25 BackGammonView* boardview;
27 CanvasImageItem* board; 26 CanvasImageItem* board;
28 CanvasImageItem* table; 27 CanvasImageItem* table;
29 CanvasImageItem** p1; 28 CanvasImageItem** p1;
30 CanvasImageItem** p2; 29 CanvasImageItem** p2;
31 CanvasImageItem** p1_side; 30 CanvasImageItem** p1_side;
32 CanvasImageItem** p2_side; 31 CanvasImageItem** p2_side;
33 32
34 CanvasImageItem** diceA1; 33 CanvasImageItem** diceA1;
35 CanvasImageItem** diceA2; 34 CanvasImageItem** diceA2;
36 CanvasImageItem** diceB1; 35 CanvasImageItem** diceB1;
37 CanvasImageItem** diceB2; 36 CanvasImageItem** diceB2;