-rw-r--r-- | noncore/games/go/gowidget.cpp | 15 | ||||
-rw-r--r-- | noncore/games/minesweep/minefield.h | 30 | ||||
-rw-r--r-- | noncore/games/minesweep/minesweep.cpp | 35 | ||||
-rw-r--r-- | noncore/games/snake/interface.h | 2 | ||||
-rw-r--r-- | noncore/games/snake/obstacle.cpp | 35 | ||||
-rw-r--r-- | noncore/games/snake/obstacle.h | 4 | ||||
-rw-r--r-- | noncore/games/solitaire/canvascard.cpp | 71 | ||||
-rw-r--r-- | noncore/games/solitaire/canvasshapes.cpp | 52 | ||||
-rw-r--r-- | noncore/games/solitaire/freecellcardgame.cpp | 11 | ||||
-rw-r--r-- | noncore/games/solitaire/patiencecardgame.cpp | 49 | ||||
-rw-r--r-- | noncore/games/solitaire/patiencecardgame.h | 7 | ||||
-rw-r--r-- | noncore/games/wordgame/wordgame.cpp | 71 | ||||
-rw-r--r-- | noncore/games/wordgame/wordgame.h | 6 | ||||
-rw-r--r-- | noncore/multimedia/showimg/settingsdialog.cpp | 57 | ||||
-rw-r--r-- | noncore/multimedia/showimg/settingsdialog.h | 42 | ||||
-rw-r--r-- | noncore/multimedia/showimg/settingsdialogbase.ui | 149 |
16 files changed, 291 insertions, 345 deletions
diff --git a/noncore/games/go/gowidget.cpp b/noncore/games/go/gowidget.cpp index fca9797..8567b30 100644 --- a/noncore/games/go/gowidget.cpp +++ b/noncore/games/go/gowidget.cpp | |||
@@ -49,6 +49,8 @@ static QPixmap *newBlackStone; | |||
49 | static QPixmap *blackStone; | 49 | static QPixmap *blackStone; |
50 | static QPixmap *whiteStone; | 50 | static QPixmap *whiteStone; |
51 | 51 | ||
52 | static bool smallStones = FALSE; | ||
53 | |||
52 | GoMainWidget::GoMainWidget( QWidget *parent, const char* name) : | 54 | GoMainWidget::GoMainWidget( QWidget *parent, const char* name) : |
53 | QMainWindow( parent, name ) | 55 | QMainWindow( parent, name ) |
54 | { | 56 | { |
@@ -197,6 +199,19 @@ void GoWidget::resizeEvent( QResizeEvent * ) | |||
197 | // int r = (d/2-1); | 199 | // int r = (d/2-1); |
198 | bx = (width() - 18*d)/2 ; | 200 | bx = (width() - 18*d)/2 ; |
199 | by = (height() - 18*d)/2 ; | 201 | by = (height() - 18*d)/2 ; |
202 | |||
203 | if ( d < 10 && !smallStones ) { | ||
204 | blackStone->convertFromImage( blackStone->convertToImage().smoothScale(8,8) ); | ||
205 | whiteStone->convertFromImage( whiteStone->convertToImage().smoothScale(8,8) ); | ||
206 | newBlackStone->convertFromImage( newBlackStone->convertToImage().smoothScale(8,8) ); | ||
207 | |||
208 | smallStones = TRUE; | ||
209 | } else if ( d >= 10 && smallStones ) { | ||
210 | blackStone = new QPixmap(Resource::loadPixmap( "Go-black" )); | ||
211 | whiteStone = new QPixmap(Resource::loadPixmap( "Go-white" )); | ||
212 | newBlackStone = new QPixmap(Resource::loadPixmap( "Go-black-highlight" )); | ||
213 | smallStones = FALSE; | ||
214 | } | ||
200 | } | 215 | } |
201 | 216 | ||
202 | void GoWidget::init() | 217 | void GoWidget::init() |
diff --git a/noncore/games/minesweep/minefield.h b/noncore/games/minesweep/minefield.h index 4ede435..1349c35 100644 --- a/noncore/games/minesweep/minefield.h +++ b/noncore/games/minesweep/minefield.h | |||
@@ -20,12 +20,12 @@ | |||
20 | #ifndef MINEFIELD_H | 20 | #ifndef MINEFIELD_H |
21 | #define MINEFIELD_H | 21 | #define MINEFIELD_H |
22 | 22 | ||
23 | #include <qtable.h> | 23 | #include <qscrollview.h> |
24 | 24 | ||
25 | class Mine; | 25 | class Mine; |
26 | class Config; | 26 | class Config; |
27 | 27 | ||
28 | class MineField : public QTable | 28 | class MineField : public QScrollView |
29 | { | 29 | { |
30 | Q_OBJECT | 30 | Q_OBJECT |
31 | public: | 31 | public: |
@@ -41,6 +41,7 @@ public: | |||
41 | 41 | ||
42 | int level() const { return lev; } | 42 | int level() const { return lev; } |
43 | 43 | ||
44 | void setAvailableRect( const QRect & ); | ||
44 | public slots: | 45 | public slots: |
45 | void setup( int level ); | 46 | void setup( int level ); |
46 | 47 | ||
@@ -52,23 +53,31 @@ signals: | |||
52 | void mineCount( int ); | 53 | void mineCount( int ); |
53 | 54 | ||
54 | protected: | 55 | protected: |
55 | void paintFocus( QPainter*, const QRect& ); | 56 | |
56 | void viewportMousePressEvent( QMouseEvent* ); | 57 | void contentsMousePressEvent( QMouseEvent* ); |
57 | void viewportMouseReleaseEvent( QMouseEvent* ); | 58 | void contentsMouseReleaseEvent( QMouseEvent* ); |
58 | void keyPressEvent( QKeyEvent* ); | 59 | void keyPressEvent( QKeyEvent* ); |
59 | void keyReleaseEvent( QKeyEvent* ); | 60 | void keyReleaseEvent( QKeyEvent* ); |
60 | 61 | void drawContents( QPainter * p, int clipx, int clipy, int clipw, int cliph ); | |
62 | |||
61 | int getHint( int row, int col ); | 63 | int getHint( int row, int col ); |
62 | void setHint( Mine* ); | 64 | void setHint( int r, int c ); |
63 | void updateMine( int row, int col ); | 65 | void updateMine( int row, int col ); |
64 | void paletteChange( const QPalette & ); | 66 | void paletteChange( const QPalette & ); |
65 | 67 | void updateCell( int r, int c ); | |
68 | bool onBoard( int r, int c ) const { return r >= 0 && r < numRows && c >= 0 && c < numCols; } | ||
69 | Mine *mine( int row, int col ) { return onBoard(row, col ) ? mines[row+numCols*col] : 0; } | ||
70 | const Mine *mine( int row, int col ) const { return onBoard(row, col ) ? mines[row+numCols*col] : 0; } | ||
71 | |||
66 | protected slots: | 72 | protected slots: |
67 | void cellPressed( int row, int col ); | 73 | void cellPressed( int row, int col ); |
68 | void cellClicked( int row, int col ); | 74 | void cellClicked( int row, int col ); |
69 | void held(); | 75 | void held(); |
70 | 76 | ||
71 | private: | 77 | private: |
78 | int findCellSize(); | ||
79 | void setCellSize( int ); | ||
80 | |||
72 | State stat; | 81 | State stat; |
73 | void MineField::setState( State st ); | 82 | void MineField::setState( State st ); |
74 | void MineField::placeMines(); | 83 | void MineField::placeMines(); |
@@ -77,11 +86,16 @@ private: | |||
77 | bool ignoreClick; | 86 | bool ignoreClick; |
78 | int currRow; | 87 | int currRow; |
79 | int currCol; | 88 | int currCol; |
89 | int numRows, numCols; | ||
90 | |||
80 | int minecount; | 91 | int minecount; |
81 | int mineguess; | 92 | int mineguess; |
82 | int nonminecount; | 93 | int nonminecount; |
83 | int lev; | 94 | int lev; |
95 | QRect availableRect; | ||
96 | int cellSize; | ||
84 | QTimer *holdTimer; | 97 | QTimer *holdTimer; |
98 | Mine **mines; | ||
85 | }; | 99 | }; |
86 | 100 | ||
87 | #endif // MINEFIELD_H | 101 | #endif // MINEFIELD_H |
diff --git a/noncore/games/minesweep/minesweep.cpp b/noncore/games/minesweep/minesweep.cpp index 6492462..c84fe53 100644 --- a/noncore/games/minesweep/minesweep.cpp +++ b/noncore/games/minesweep/minesweep.cpp | |||
@@ -219,6 +219,23 @@ void ResultIndicator::timerEvent( QTimerEvent *te ) | |||
219 | } | 219 | } |
220 | 220 | ||
221 | 221 | ||
222 | class MineFrame : public QFrame | ||
223 | { | ||
224 | public: | ||
225 | MineFrame( QWidget *parent, const char *name = 0 ) | ||
226 | :QFrame( parent, name ) {} | ||
227 | void setField( MineField *f ) { field = f; } | ||
228 | protected: | ||
229 | void resizeEvent( QResizeEvent *e ) { | ||
230 | field->setAvailableRect( contentsRect()); | ||
231 | QFrame::resizeEvent(e); | ||
232 | } | ||
233 | private: | ||
234 | MineField *field; | ||
235 | }; | ||
236 | |||
237 | |||
238 | |||
222 | MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) | 239 | MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) |
223 | : QMainWindow( parent, name, f ) | 240 | : QMainWindow( parent, name, f ) |
224 | { | 241 | { |
@@ -226,8 +243,10 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) | |||
226 | setCaption( tr("Mine Hunt") ); | 243 | setCaption( tr("Mine Hunt") ); |
227 | setIcon( Resource::loadPixmap( "minesweep_icon" ) ); | 244 | setIcon( Resource::loadPixmap( "minesweep_icon" ) ); |
228 | 245 | ||
229 | QPEToolBar *menuToolBar = new QPEToolBar( this ); | 246 | QPEToolBar *toolBar = new QPEToolBar( this ); |
230 | QPEMenuBar *menuBar = new QPEMenuBar( menuToolBar ); | 247 | toolBar->setHorizontalStretchable( TRUE ); |
248 | |||
249 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | ||
231 | 250 | ||
232 | QPopupMenu *gameMenu = new QPopupMenu( this ); | 251 | QPopupMenu *gameMenu = new QPopupMenu( this ); |
233 | gameMenu->insertItem( tr("Beginner"), this, SLOT( beginner() ) ); | 252 | gameMenu->insertItem( tr("Beginner"), this, SLOT( beginner() ) ); |
@@ -235,9 +254,6 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) | |||
235 | gameMenu->insertItem( tr("Expert"), this, SLOT( expert() ) ); | 254 | gameMenu->insertItem( tr("Expert"), this, SLOT( expert() ) ); |
236 | 255 | ||
237 | menuBar->insertItem( tr("Game"), gameMenu ); | 256 | menuBar->insertItem( tr("Game"), gameMenu ); |
238 | |||
239 | QPEToolBar *toolBar = new QPEToolBar( this ); | ||
240 | toolBar->setHorizontalStretchable( TRUE ); | ||
241 | 257 | ||
242 | guessLCD = new QLCDNumber( toolBar ); | 258 | guessLCD = new QLCDNumber( toolBar ); |
243 | toolBar->setStretchableWidget( guessLCD ); | 259 | toolBar->setStretchableWidget( guessLCD ); |
@@ -265,17 +281,16 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) | |||
265 | 281 | ||
266 | setToolBarsMovable ( FALSE ); | 282 | setToolBarsMovable ( FALSE ); |
267 | 283 | ||
268 | addToolBar( menuToolBar ); | ||
269 | addToolBar( toolBar ); | 284 | addToolBar( toolBar ); |
270 | 285 | ||
271 | QFrame *mainframe = new QFrame( this ); | 286 | MineFrame *mainframe = new MineFrame( this ); |
272 | mainframe->setFrameShape( QFrame::Box ); | 287 | mainframe->setFrameShape( QFrame::Box ); |
273 | mainframe->setFrameShadow( QFrame::Raised ); | 288 | mainframe->setFrameShadow( QFrame::Raised ); |
274 | mainframe->setMargin(5); | 289 | |
275 | mainframe->setLineWidth(2); | 290 | mainframe->setLineWidth(2); |
276 | QBoxLayout *box = new QVBoxLayout( mainframe ); | 291 | |
277 | field = new MineField( mainframe ); | 292 | field = new MineField( mainframe ); |
278 | box->addWidget( field, 0, AlignCenter ); | 293 | mainframe->setField( field ); |
279 | QFont fnt = field->font(); | 294 | QFont fnt = field->font(); |
280 | fnt.setBold( TRUE ); | 295 | fnt.setBold( TRUE ); |
281 | field->setFont( QFont( fnt ) ); | 296 | field->setFont( QFont( fnt ) ); |
diff --git a/noncore/games/snake/interface.h b/noncore/games/snake/interface.h index 30c7f84..454d4ee 100644 --- a/noncore/games/snake/interface.h +++ b/noncore/games/snake/interface.h | |||
@@ -36,7 +36,6 @@ public: | |||
36 | 36 | ||
37 | void clear(); | 37 | void clear(); |
38 | void createTargets(); | 38 | void createTargets(); |
39 | void welcomescreen(); | ||
40 | 39 | ||
41 | protected: | 40 | protected: |
42 | virtual void keyPressEvent(QKeyEvent*); | 41 | virtual void keyPressEvent(QKeyEvent*); |
@@ -51,6 +50,7 @@ private slots: | |||
51 | void wait(); | 50 | void wait(); |
52 | void levelUp(); | 51 | void levelUp(); |
53 | void scoreInc(); | 52 | void scoreInc(); |
53 | void welcomescreen(); | ||
54 | 54 | ||
55 | private: | 55 | private: |
56 | void showScore(int); | 56 | void showScore(int); |
diff --git a/noncore/games/snake/obstacle.cpp b/noncore/games/snake/obstacle.cpp index 2d07fe7..4bdefa5 100644 --- a/noncore/games/snake/obstacle.cpp +++ b/noncore/games/snake/obstacle.cpp | |||
@@ -23,20 +23,39 @@ | |||
23 | 23 | ||
24 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
25 | 25 | ||
26 | Obstacle::Obstacle(QCanvas* canvas, int x, int y) | 26 | |
27 | : QCanvasSprite(0, canvas) | 27 | |
28 | Obstacle::Obstacle(QCanvas* canvas, int y) | ||
29 | : QCanvasSprite(0,canvas) | ||
28 | { | 30 | { |
29 | newObstacle(x, y); | 31 | newObstacle(y); |
30 | } | 32 | } |
31 | 33 | ||
32 | void Obstacle::newObstacle(int x, int y) | 34 | void Obstacle::newObstacle(int y) |
33 | { | 35 | { |
34 | QCanvasPixmapArray* obstaclearray = new QCanvasPixmapArray(Resource::findPixmap("snake/wall.png")); | 36 | QPixmap obstaclePix( Resource::findPixmap("snake/wall.png") ); |
35 | 37 | ||
38 | if ( obstaclePix.width() > canvas()->width()*3/5 ) { | ||
39 | int w = canvas()->width()*3/5; | ||
40 | w = w - w % 16; | ||
41 | obstaclePix.resize( w, obstaclePix.height() ); | ||
42 | } | ||
43 | |||
44 | QList<QPixmap> pixl; | ||
45 | pixl.append( &obstaclePix ); | ||
46 | |||
47 | QPoint nullp; | ||
48 | QList<QPoint> pl; | ||
49 | pl.append( &nullp ); | ||
50 | |||
51 | QCanvasPixmapArray* obstaclearray = new QCanvasPixmapArray(pixl, pl); | ||
36 | setSequence(obstaclearray); | 52 | setSequence(obstaclearray); |
37 | 53 | ||
54 | int x = ( canvas()->width() - obstaclePix.width() )/2; | ||
55 | x = x - x % 16; | ||
56 | y = y - y % 16; | ||
38 | move(x, y); | 57 | move(x, y); |
39 | 58 | setZ( -100 ); | |
40 | show(); | 59 | show(); |
41 | canvas()->update(); | 60 | canvas()->update(); |
42 | } | 61 | } |
diff --git a/noncore/games/snake/obstacle.h b/noncore/games/snake/obstacle.h index 838917f..b3c7846 100644 --- a/noncore/games/snake/obstacle.h +++ b/noncore/games/snake/obstacle.h | |||
@@ -23,8 +23,8 @@ class Obstacle : public QCanvasSprite | |||
23 | { | 23 | { |
24 | 24 | ||
25 | public: | 25 | public: |
26 | Obstacle(QCanvas*, int x, int y); | 26 | Obstacle(QCanvas*, int y); |
27 | ~Obstacle(); | 27 | ~Obstacle(); |
28 | void newObstacle(int x, int y); | 28 | void newObstacle(int y); |
29 | int rtti() const; | 29 | int rtti() const; |
30 | }; | 30 | }; |
diff --git a/noncore/games/solitaire/canvascard.cpp b/noncore/games/solitaire/canvascard.cpp index ae3c859..7c4a5ba 100644 --- a/noncore/games/solitaire/canvascard.cpp +++ b/noncore/games/solitaire/canvascard.cpp | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <qimage.h> | 27 | #include <qimage.h> |
28 | #include <qpaintdevice.h> | 28 | #include <qpaintdevice.h> |
29 | #include <qbitmap.h> | 29 | #include <qbitmap.h> |
30 | #include <qgfx_qws.h> // Needed to get the device's width | ||
30 | 31 | ||
31 | #include <math.h> | 32 | #include <math.h> |
32 | 33 | ||
@@ -102,10 +103,17 @@ CanvasCard::CanvasCard( eValue v, eSuit s, bool f, QCanvas *canvas ) : | |||
102 | Card(v, s, f), QCanvasRectangle( 0, 0, 1, 1, canvas ), cardBack(1), scaleX(1.0), scaleY(1.0) | 103 | Card(v, s, f), QCanvasRectangle( 0, 0, 1, 1, canvas ), cardBack(1), scaleX(1.0), scaleY(1.0) |
103 | { | 104 | { |
104 | if ( !cardsFaces ) { | 105 | if ( !cardsFaces ) { |
105 | cardsFaces = new QPixmap( Resource::loadPixmap( "cards/card_face" ) ); | 106 | if ( qt_screen->deviceWidth() < 200 ) { |
106 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0001" ) ); | 107 | cardsFaces = new QPixmap( Resource::loadPixmap( "cards/card_face_small" ) ); |
107 | cardsChars = new QBitmap( Resource::loadBitmap( "cards/card_chars" ) ); | 108 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0001_small" ) ); |
108 | cardsSuits = new QBitmap( Resource::loadBitmap( "cards/card_suits" ) ); | 109 | cardsChars = new QBitmap( Resource::loadBitmap( "cards/card_chars_small" ) ); |
110 | cardsSuits = new QBitmap( Resource::loadBitmap( "cards/card_suits_small" ) ); | ||
111 | } else { | ||
112 | cardsFaces = new QPixmap( Resource::loadPixmap( "cards/card_face" ) ); | ||
113 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0001" ) ); | ||
114 | cardsChars = new QBitmap( Resource::loadBitmap( "cards/card_chars" ) ); | ||
115 | cardsSuits = new QBitmap( Resource::loadBitmap( "cards/card_suits" ) ); | ||
116 | } | ||
109 | cardsCharsUpsideDown = Create180RotatedBitmap( cardsChars ); | 117 | cardsCharsUpsideDown = Create180RotatedBitmap( cardsChars ); |
110 | cardsSuitsUpsideDown = Create180RotatedBitmap( cardsSuits ); | 118 | cardsSuitsUpsideDown = Create180RotatedBitmap( cardsSuits ); |
111 | } | 119 | } |
@@ -126,17 +134,32 @@ void CanvasCard::setCardBack(int b) | |||
126 | if ( cardsBacks ) | 134 | if ( cardsBacks ) |
127 | delete cardsBacks; | 135 | delete cardsBacks; |
128 | 136 | ||
129 | switch (cardBack) { | 137 | if ( qt_screen->deviceWidth() < 200 ) { |
130 | case 0: | 138 | switch (cardBack) { |
131 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0001" ) ); break; | 139 | case 0: |
132 | case 1: | 140 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0001_small" ) ); break; |
133 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0002" ) ); break; | 141 | case 1: |
134 | case 2: | 142 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0002_small" ) ); break; |
135 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0003" ) ); break; | 143 | case 2: |
136 | case 3: | 144 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0003_small" ) ); break; |
137 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0004" ) ); break; | 145 | case 3: |
138 | case 4: | 146 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0004_small" ) ); break; |
139 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0005" ) ); break; | 147 | case 4: |
148 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0005_small" ) ); break; | ||
149 | } | ||
150 | } else { | ||
151 | switch (cardBack) { | ||
152 | case 0: | ||
153 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0001" ) ); break; | ||
154 | case 1: | ||
155 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0002" ) ); break; | ||
156 | case 2: | ||
157 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0003" ) ); break; | ||
158 | case 3: | ||
159 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0004" ) ); break; | ||
160 | case 4: | ||
161 | cardsBacks = new QPixmap( Resource::loadPixmap( "cards/card_back0005" ) ); break; | ||
162 | } | ||
140 | } | 163 | } |
141 | 164 | ||
142 | if ( !isFacing() ) | 165 | if ( !isFacing() ) |
@@ -181,11 +204,19 @@ void CanvasCard::draw(QPainter &painter) | |||
181 | else | 204 | else |
182 | p->setPen( QColor( 0, 0, 0 ) ); | 205 | p->setPen( QColor( 0, 0, 0 ) ); |
183 | 206 | ||
184 | p->drawPixmap( ix + 0, iy + 0, *cardsFaces ); | 207 | if ( qt_screen->deviceWidth() < 200 ) { |
185 | p->drawPixmap( ix + 4, iy + 4, *cardsChars, 7*(getValue()-1), 0, 7, 7 ); | 208 | p->drawPixmap( ix + 0, iy + 0, *cardsFaces ); |
186 | p->drawPixmap( ix + 12, iy + 4, *cardsSuits, 7*(getSuit()-1), 0, 7, 8 ); | 209 | p->drawPixmap( ix + 3, iy + 3, *cardsChars, 5*(getValue()-1), 0, 5, 6 ); |
187 | p->drawPixmap( ix + w-4-7, iy + h-4-7, *cardsCharsUpsideDown, 7*(12-getValue()+1), 0, 7, 7 ); | 210 | p->drawPixmap( ix + 11, iy + 3, *cardsSuits, 5*(getSuit()-1), 0, 5, 6 ); |
188 | p->drawPixmap( ix + w-12-7, iy + h-5-7, *cardsSuitsUpsideDown, 7*(3-getSuit()+1), 0, 7, 8 ); | 211 | p->drawPixmap( ix + w-3-5, iy + h-3-6, *cardsCharsUpsideDown, 5*(12-getValue()+1), 0, 5, 6 ); |
212 | p->drawPixmap( ix + w-11-5, iy + h-3-6, *cardsSuitsUpsideDown, 5*(3-getSuit()+1), 0, 5, 6 ); | ||
213 | } else { | ||
214 | p->drawPixmap( ix + 0, iy + 0, *cardsFaces ); | ||
215 | p->drawPixmap( ix + 4, iy + 4, *cardsChars, 7*(getValue()-1), 0, 7, 7 ); | ||
216 | p->drawPixmap( ix + 12, iy + 4, *cardsSuits, 7*(getSuit()-1), 0, 7, 8 ); | ||
217 | p->drawPixmap( ix + w-4-7, iy + h-4-7, *cardsCharsUpsideDown, 7*(12-getValue()+1), 0, 7, 7 ); | ||
218 | p->drawPixmap( ix + w-12-7, iy + h-5-7, *cardsSuitsUpsideDown, 7*(3-getSuit()+1), 0, 7, 8 ); | ||
219 | } | ||
189 | 220 | ||
190 | } else { | 221 | } else { |
191 | 222 | ||
diff --git a/noncore/games/solitaire/canvasshapes.cpp b/noncore/games/solitaire/canvasshapes.cpp index 28d0b4e..6ccd4a4 100644 --- a/noncore/games/solitaire/canvasshapes.cpp +++ b/noncore/games/solitaire/canvasshapes.cpp | |||
@@ -19,11 +19,12 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qpainter.h> | 20 | #include <qpainter.h> |
21 | #include <qcanvas.h> | 21 | #include <qcanvas.h> |
22 | #include <qgfx_qws.h> | ||
22 | #include "canvasshapes.h" | 23 | #include "canvasshapes.h" |
23 | 24 | ||
24 | 25 | ||
25 | CanvasRoundRect::CanvasRoundRect(int x, int y, QCanvas *canvas) : | 26 | CanvasRoundRect::CanvasRoundRect(int x, int y, QCanvas *canvas) : |
26 | QCanvasRectangle( x, y, 23, 36, canvas) | 27 | QCanvasRectangle( x, y, ( qt_screen->deviceWidth() < 200 ) ? 20 : 23, ( qt_screen->deviceWidth() < 200 ) ? 27 : 36, canvas) |
27 | { | 28 | { |
28 | setZ(0); | 29 | setZ(0); |
29 | show(); | 30 | show(); |
@@ -39,7 +40,10 @@ void CanvasRoundRect::redraw() | |||
39 | 40 | ||
40 | void CanvasRoundRect::drawShape(QPainter &p) | 41 | void CanvasRoundRect::drawShape(QPainter &p) |
41 | { | 42 | { |
42 | p.drawRoundRect( (int)x(), (int)y(), 23, 36); | 43 | if ( qt_screen->deviceWidth() < 200 ) |
44 | p.drawRoundRect( (int)x() + 1, (int)y() + 1, 18, 25); | ||
45 | else | ||
46 | p.drawRoundRect( (int)x(), (int)y(), 23, 36); | ||
43 | } | 47 | } |
44 | 48 | ||
45 | 49 | ||
@@ -73,20 +77,38 @@ void CanvasCircleOrCross::setCross() | |||
73 | 77 | ||
74 | void CanvasCircleOrCross::drawShape(QPainter &p) | 78 | void CanvasCircleOrCross::drawShape(QPainter &p) |
75 | { | 79 | { |
76 | int x1 = (int)x(), y1 = (int)y(); | 80 | if ( qt_screen->deviceWidth() < 200 ) { |
77 | // Green circle | 81 | int x1 = (int)x(), y1 = (int)y(); |
78 | if (circleShape == TRUE) { | 82 | // Green circle |
79 | p.setPen( QPen( QColor(0x10, 0xE0, 0x10), 1 ) ); | 83 | if (circleShape == TRUE) { |
80 | p.drawEllipse( x1 - 1, y1 - 1, 21, 21); | 84 | p.setPen( QPen( QColor(0x10, 0xE0, 0x10), 1 ) ); |
81 | p.drawEllipse( x1 - 1, y1 - 0, 21, 19); | 85 | p.drawEllipse( x1 - 1, y1 - 1, 17, 17); |
82 | p.drawEllipse( x1 + 0, y1 + 0, 19, 19); | 86 | p.drawEllipse( x1 - 1, y1 - 0, 17, 15); |
83 | p.drawEllipse( x1 + 1, y1 + 0, 17, 19); | 87 | p.drawEllipse( x1 + 0, y1 + 0, 15, 15); |
84 | p.drawEllipse( x1 + 1, y1 + 1, 17, 17); | 88 | p.drawEllipse( x1 + 1, y1 + 0, 13, 15); |
85 | // Red cross | 89 | p.drawEllipse( x1 + 1, y1 + 1, 13, 13); |
90 | // Red cross | ||
91 | } else { | ||
92 | p.setPen( QPen( QColor(0xE0, 0x10, 0x10), 4 ) ); | ||
93 | p.drawLine( x1, y1, x1 + 14, y1 + 14); | ||
94 | p.drawLine( x1 + 14, y1, x1, y1 + 14); | ||
95 | } | ||
86 | } else { | 96 | } else { |
87 | p.setPen( QPen( QColor(0xE0, 0x10, 0x10), 5 ) ); | 97 | int x1 = (int)x(), y1 = (int)y(); |
88 | p.drawLine( x1, y1, x1 + 20, y1 + 20); | 98 | // Green circle |
89 | p.drawLine( x1 + 20, y1, x1, y1 + 20); | 99 | if (circleShape == TRUE) { |
100 | p.setPen( QPen( QColor(0x10, 0xE0, 0x10), 1 ) ); | ||
101 | p.drawEllipse( x1 - 1, y1 - 1, 21, 21); | ||
102 | p.drawEllipse( x1 - 1, y1 - 0, 21, 19); | ||
103 | p.drawEllipse( x1 + 0, y1 + 0, 19, 19); | ||
104 | p.drawEllipse( x1 + 1, y1 + 0, 17, 19); | ||
105 | p.drawEllipse( x1 + 1, y1 + 1, 17, 17); | ||
106 | // Red cross | ||
107 | } else { | ||
108 | p.setPen( QPen( QColor(0xE0, 0x10, 0x10), 5 ) ); | ||
109 | p.drawLine( x1, y1, x1 + 20, y1 + 20); | ||
110 | p.drawLine( x1 + 20, y1, x1, y1 + 20); | ||
111 | } | ||
90 | } | 112 | } |
91 | } | 113 | } |
92 | 114 | ||
diff --git a/noncore/games/solitaire/freecellcardgame.cpp b/noncore/games/solitaire/freecellcardgame.cpp index e82afd4..98415aa 100644 --- a/noncore/games/solitaire/freecellcardgame.cpp +++ b/noncore/games/solitaire/freecellcardgame.cpp | |||
@@ -17,6 +17,7 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qgfx_qws.h> | ||
20 | #include "freecellcardgame.h" | 21 | #include "freecellcardgame.h" |
21 | 22 | ||
22 | 23 | ||
@@ -29,16 +30,20 @@ FreecellCardGame::FreecellCardGame(QCanvas *c, bool snap, QWidget *parent) : Can | |||
29 | numberOfFreeCells = 4; | 30 | numberOfFreeCells = 4; |
30 | highestZ = 0; | 31 | highestZ = 0; |
31 | 32 | ||
33 | int spaceBetweenPiles = ( qt_screen->deviceWidth() < 200 ) ? 21 : 28; | ||
34 | int xOrigin = ( qt_screen->deviceWidth() < 200 ) ? 0 : 5; | ||
35 | int spacing = ( qt_screen->deviceWidth() < 200 ) ? 0 : 0; | ||
36 | |||
32 | for (int i = 0; i < 4; i++) { | 37 | for (int i = 0; i < 4; i++) { |
33 | freecellPiles[i] = new FreecellFreecellPile( 5 + i * 28, 10, canvas() ); | 38 | freecellPiles[i] = new FreecellFreecellPile( xOrigin + i * spaceBetweenPiles, 10, canvas() ); |
34 | addCardPile(freecellPiles[i]); | 39 | addCardPile(freecellPiles[i]); |
35 | } | 40 | } |
36 | for (int i = 0; i < 4; i++) { | 41 | for (int i = 0; i < 4; i++) { |
37 | discardPiles[i] = new FreecellDiscardPile( 125 + i * 28, 10, canvas() ); | 42 | discardPiles[i] = new FreecellDiscardPile( xOrigin + spacing + 6 + (i + 4) * spaceBetweenPiles, 10, canvas() ); |
38 | addCardPile(discardPiles[i]); | 43 | addCardPile(discardPiles[i]); |
39 | } | 44 | } |
40 | for (int i = 0; i < 8; i++) { | 45 | for (int i = 0; i < 8; i++) { |
41 | workingPiles[i] = new FreecellWorkingPile( 10 + i * 28, 50, canvas() ); | 46 | workingPiles[i] = new FreecellWorkingPile( xOrigin + spacing + 2 + i * spaceBetweenPiles, 50, canvas() ); |
42 | addCardPile(workingPiles[i]); | 47 | addCardPile(workingPiles[i]); |
43 | } | 48 | } |
44 | } | 49 | } |
diff --git a/noncore/games/solitaire/patiencecardgame.cpp b/noncore/games/solitaire/patiencecardgame.cpp index 5a9326a..1501d2f 100644 --- a/noncore/games/solitaire/patiencecardgame.cpp +++ b/noncore/games/solitaire/patiencecardgame.cpp | |||
@@ -17,6 +17,7 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <qgfx_qws.h> | ||
20 | #include "patiencecardgame.h" | 21 | #include "patiencecardgame.h" |
21 | 22 | ||
22 | 23 | ||
@@ -28,19 +29,35 @@ PatienceCardGame::PatienceCardGame(QCanvas *c, bool snap, QWidget *parent) : Can | |||
28 | numberOfTimesThroughDeck = 0; | 29 | numberOfTimesThroughDeck = 0; |
29 | highestZ = 0; | 30 | highestZ = 0; |
30 | 31 | ||
31 | circleCross = new CanvasCircleOrCross( 7, 18, canvas() ); | 32 | if ( qt_screen->deviceWidth() < 200 ) { |
32 | rectangle = new CanvasRoundRect( 35, 10, canvas() ); | 33 | circleCross = new CanvasCircleOrCross( 7, 16, canvas() ); |
34 | rectangle = new CanvasRoundRect( 30, 10, canvas() ); | ||
33 | 35 | ||
34 | for (int i = 0; i < 4; i++) { | 36 | for (int i = 0; i < 4; i++) { |
35 | discardPiles[i] = new PatienceDiscardPile( 110 + i * 30, 10, canvas() ); | 37 | discardPiles[i] = new PatienceDiscardPile( 78 + i * 23, 10, canvas() ); |
36 | addCardPile(discardPiles[i]); | 38 | addCardPile(discardPiles[i]); |
37 | } | 39 | } |
38 | for (int i = 0; i < 7; i++) { | 40 | for (int i = 0; i < 7; i++) { |
39 | workingPiles[i] = new PatienceWorkingPile( 10 + i * 30, 50, canvas() ); | 41 | workingPiles[i] = new PatienceWorkingPile( 5 + i * 23, 50, canvas() ); |
40 | addCardPile(workingPiles[i]); | 42 | addCardPile(workingPiles[i]); |
43 | } | ||
44 | faceDownDealingPile = new PatienceFaceDownDeck( 5, 10, canvas() ); | ||
45 | faceUpDealingPile = new PatienceFaceUpDeck( 30, 10, canvas() ); | ||
46 | } else { | ||
47 | circleCross = new CanvasCircleOrCross( 7, 18, canvas() ); | ||
48 | rectangle = new CanvasRoundRect( 35, 10, canvas() ); | ||
49 | |||
50 | for (int i = 0; i < 4; i++) { | ||
51 | discardPiles[i] = new PatienceDiscardPile( 110 + i * 30, 10, canvas() ); | ||
52 | addCardPile(discardPiles[i]); | ||
53 | } | ||
54 | for (int i = 0; i < 7; i++) { | ||
55 | workingPiles[i] = new PatienceWorkingPile( 10 + i * 30, 50, canvas() ); | ||
56 | addCardPile(workingPiles[i]); | ||
57 | } | ||
58 | faceDownDealingPile = new PatienceFaceDownDeck( 5, 10, canvas() ); | ||
59 | faceUpDealingPile = new PatienceFaceUpDeck( 35, 10, canvas() ); | ||
41 | } | 60 | } |
42 | faceDownDealingPile = new PatienceFaceDownDeck( 5, 10, canvas() ); | ||
43 | faceUpDealingPile = new PatienceFaceUpDeck( 35, 10, canvas() ); | ||
44 | } | 61 | } |
45 | 62 | ||
46 | 63 | ||
@@ -173,7 +190,10 @@ bool PatienceCardGame::mousePressCard( Card *card, QPoint p ) | |||
173 | faceUpDealingPile->addCardToTop(item); | 190 | faceUpDealingPile->addCardToTop(item); |
174 | item->setCardPile( faceUpDealingPile ); | 191 | item->setCardPile( faceUpDealingPile ); |
175 | 192 | ||
176 | item->flipTo( 35, (int)item->y() ); | 193 | if ( qt_screen->deviceWidth() < 200 ) |
194 | item->flipTo( 30, (int)item->y() ); | ||
195 | else | ||
196 | item->flipTo( 35, (int)item->y() ); | ||
177 | } | 197 | } |
178 | moving = NULL; | 198 | moving = NULL; |
179 | moved = FALSE; | 199 | moved = FALSE; |
@@ -195,7 +215,10 @@ bool PatienceCardGame::mousePressCard( Card *card, QPoint p ) | |||
195 | faceUpDealingPile->addCardToTop(item); | 215 | faceUpDealingPile->addCardToTop(item); |
196 | item->setCardPile( faceUpDealingPile ); | 216 | item->setCardPile( faceUpDealingPile ); |
197 | 217 | ||
198 | item->flipTo( 35, (int)item->y(), 8 * flipped ); | 218 | if ( qt_screen->deviceWidth() < 200 ) |
219 | item->flipTo( 30, (int)item->y(), 8 * flipped ); | ||
220 | else | ||
221 | item->flipTo( 35, (int)item->y(), 8 * flipped ); | ||
199 | } | 222 | } |
200 | } | 223 | } |
201 | 224 | ||
diff --git a/noncore/games/solitaire/patiencecardgame.h b/noncore/games/solitaire/patiencecardgame.h index c4f6c48..0d0e3d5 100644 --- a/noncore/games/solitaire/patiencecardgame.h +++ b/noncore/games/solitaire/patiencecardgame.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <qmainwindow.h> | 25 | #include <qmainwindow.h> |
26 | #include <qintdict.h> | 26 | #include <qintdict.h> |
27 | #include <qcanvas.h> | 27 | #include <qcanvas.h> |
28 | #include <qgfx_qws.h> | ||
28 | // #include "canvascardshapes.h" | 29 | // #include "canvascardshapes.h" |
29 | // #include "canvascard.h" | 30 | // #include "canvascard.h" |
30 | #include "canvascardgame.h" | 31 | #include "canvascardgame.h" |
@@ -130,11 +131,12 @@ public: | |||
130 | } else { | 131 | } else { |
131 | top = getCardPos(NULL); | 132 | top = getCardPos(NULL); |
132 | if ( newTopCard->isFacing() == FALSE ) { | 133 | if ( newTopCard->isFacing() == FALSE ) { |
134 | int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13; | ||
133 | // correct the position taking in to account the card is not | 135 | // correct the position taking in to account the card is not |
134 | // yet flipped, but will become flipped | 136 | // yet flipped, but will become flipped |
135 | top = QPoint( top.x() - 1, top.y() - 3 ); | 137 | top = QPoint( top.x() - 1, top.y() - 3 ); |
136 | newTopCard->flipTo( top.x(), top.y() ); | 138 | newTopCard->flipTo( top.x(), top.y() ); |
137 | top = QPoint( top.x(), top.y() + 13 ); | 139 | top = QPoint( top.x(), top.y() + offsetDown ); |
138 | } | 140 | } |
139 | setNextX( top.x() ); | 141 | setNextX( top.x() ); |
140 | setNextY( top.y() ); | 142 | setNextY( top.y() ); |
@@ -145,7 +147,8 @@ public: | |||
145 | Card *card = cardOnBottom(); | 147 | Card *card = cardOnBottom(); |
146 | while ((card != c) && (card != NULL)) { | 148 | while ((card != c) && (card != NULL)) { |
147 | if (card->isFacing()) { | 149 | if (card->isFacing()) { |
148 | y += 13; | 150 | int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13; |
151 | y += offsetDown; | ||
149 | } else { | 152 | } else { |
150 | x += 1; | 153 | x += 1; |
151 | y += 3; | 154 | y += 3; |
diff --git a/noncore/games/wordgame/wordgame.cpp b/noncore/games/wordgame/wordgame.cpp index ca4352d..16d37b3 100644 --- a/noncore/games/wordgame/wordgame.cpp +++ b/noncore/games/wordgame/wordgame.cpp | |||
@@ -59,6 +59,13 @@ enum RuleEffects { | |||
59 | Start=128 | 59 | Start=128 |
60 | }; | 60 | }; |
61 | 61 | ||
62 | static int tile_smallw = 16; | ||
63 | static int tile_smallh = 16; | ||
64 | static int tile_bigw = 22; | ||
65 | static int tile_bigh = 22; | ||
66 | static int tile_stweak = -2; | ||
67 | static int tile_btweak = -1; | ||
68 | |||
62 | static const int rack_tiles=7; | 69 | static const int rack_tiles=7; |
63 | 70 | ||
64 | const char* sampleWGR= | 71 | const char* sampleWGR= |
@@ -111,6 +118,15 @@ const char* sampleWGR= | |||
111 | WordGame::WordGame( QWidget* parent, const char* name, WFlags fl ) : | 118 | WordGame::WordGame( QWidget* parent, const char* name, WFlags fl ) : |
112 | QMainWindow(parent, name, fl) | 119 | QMainWindow(parent, name, fl) |
113 | { | 120 | { |
121 | if ( qApp->desktop()->width() < 240 ) { | ||
122 | tile_smallw = 10; | ||
123 | tile_smallh = 10; | ||
124 | tile_bigw = 16; | ||
125 | tile_bigh = 16; | ||
126 | tile_stweak = 0; | ||
127 | tile_btweak = 0; | ||
128 | } | ||
129 | |||
114 | setIcon( Resource::loadPixmap( "wordgame" ) ); | 130 | setIcon( Resource::loadPixmap( "wordgame" ) ); |
115 | setCaption( tr("Word Game") ); | 131 | setCaption( tr("Word Game") ); |
116 | 132 | ||
@@ -247,6 +263,7 @@ void WordGame::startGame(const QStringList& playerlist) | |||
247 | { | 263 | { |
248 | toolbar->show(); | 264 | toolbar->show(); |
249 | racks = new QWidgetStack(vbox); | 265 | racks = new QWidgetStack(vbox); |
266 | racks->setFixedHeight(TileItem::bigHeight()+2); | ||
250 | namelist.clear(); | 267 | namelist.clear(); |
251 | nplayers=0; | 268 | nplayers=0; |
252 | for (QStringList::ConstIterator it=playerlist.begin(); it!=playerlist.end(); ++it) | 269 | for (QStringList::ConstIterator it=playerlist.begin(); it!=playerlist.end(); ++it) |
@@ -283,7 +300,6 @@ bool WordGame::loadRules(const QString &name) | |||
283 | if ( htiles < 3 || vtiles < 3 ) | 300 | if ( htiles < 3 || vtiles < 3 ) |
284 | return FALSE; | 301 | return FALSE; |
285 | 302 | ||
286 | QPixmap bgshapes = Resource::loadPixmap(shapepixmap); | ||
287 | QString rule_shapes; | 303 | QString rule_shapes; |
288 | for (int i=0; i<vtiles; i++) { | 304 | for (int i=0; i<vtiles; i++) { |
289 | QString line; | 305 | QString line; |
@@ -297,6 +313,12 @@ bool WordGame::loadRules(const QString &name) | |||
297 | rule_effects[re] = e; | 313 | rule_effects[re] = e; |
298 | if ( re++ < 10 ) ts >> e; | 314 | if ( re++ < 10 ) ts >> e; |
299 | } | 315 | } |
316 | |||
317 | QImage shim = Resource::loadImage(shapepixmap); | ||
318 | shim = shim.smoothScale((re-1)*TileItem::smallWidth(),TileItem::smallHeight()); | ||
319 | QPixmap bgshapes; | ||
320 | bgshapes.convertFromImage(shim); | ||
321 | |||
300 | rule_effects[re++] = 100; // default bonus | 322 | rule_effects[re++] = 100; // default bonus |
301 | board = new Board(bgshapes, htiles, vtiles, vbox); | 323 | board = new Board(bgshapes, htiles, vtiles, vbox); |
302 | board->setRules(rule_shapes, rule_effects); | 324 | board->setRules(rule_shapes, rule_effects); |
@@ -681,22 +703,22 @@ qDebug("%d,%d: %s (%d) for %d",current.x(),current.y(),st.latin1(),n,s); | |||
681 | 703 | ||
682 | int TileItem::smallWidth() | 704 | int TileItem::smallWidth() |
683 | { | 705 | { |
684 | return 16; | 706 | return tile_smallw; |
685 | } | 707 | } |
686 | 708 | ||
687 | int TileItem::smallHeight() | 709 | int TileItem::smallHeight() |
688 | { | 710 | { |
689 | return 16; | 711 | return tile_smallh; |
690 | } | 712 | } |
691 | 713 | ||
692 | int TileItem::bigWidth() | 714 | int TileItem::bigWidth() |
693 | { | 715 | { |
694 | return 22; | 716 | return tile_bigw; |
695 | } | 717 | } |
696 | 718 | ||
697 | int TileItem::bigHeight() | 719 | int TileItem::bigHeight() |
698 | { | 720 | { |
699 | return 22; | 721 | return tile_bigh; |
700 | } | 722 | } |
701 | 723 | ||
702 | void TileItem::setState( State state ) | 724 | void TileItem::setState( State state ) |
@@ -720,26 +742,36 @@ void TileItem::setBig(bool b) | |||
720 | 742 | ||
721 | void TileItem::drawShape(QPainter& p) | 743 | void TileItem::drawShape(QPainter& p) |
722 | { | 744 | { |
723 | static QFont value_font("heletica",8); | 745 | static QFont *value_font=0; |
724 | static QFont big_font("smoothtimes",17); | 746 | static QFont *big_font=0; |
725 | static QFont small_font("smoothtimes",10); | 747 | static QFont *small_font=0; |
748 | if ( !value_font ) { | ||
749 | value_font = new QFont("helvetica",8); | ||
750 | if ( TileItem::bigWidth() < 20 ) { | ||
751 | big_font = new QFont("helvetica",12); | ||
752 | small_font = new QFont("helvetica",8); | ||
753 | } else { | ||
754 | big_font = new QFont("smoothtimes",17); | ||
755 | small_font = new QFont("smoothtimes",10); | ||
756 | } | ||
757 | } | ||
726 | 758 | ||
727 | QRect area(x(),y(),width(),height()); | 759 | QRect area(x(),y(),width(),height()); |
728 | p.setBrush(s == Floating ? yellow/*lightGray*/ : white); | 760 | p.setBrush(s == Floating ? yellow/*lightGray*/ : white); |
729 | p.drawRect(area); | 761 | p.drawRect(area); |
730 | if ( big ) { | 762 | if ( big ) { |
731 | p.setFont(value_font); | 763 | p.setFont(*value_font); |
732 | QString n = QString::number(t.value()); | 764 | QString n = QString::number(t.value()); |
733 | int w = p.fontMetrics().width('1'); | 765 | int w = p.fontMetrics().width('1'); |
734 | int h = p.fontMetrics().height(); | 766 | int h = p.fontMetrics().height(); |
735 | w *= n.length(); | 767 | w *= n.length(); |
736 | QRect valuearea(x()+width()-w-2,y()+height()-h+1,w,h); | 768 | QRect valuearea(x()+width()-w-1,y()+height()-h,w,h); |
737 | p.drawText(valuearea,AlignCenter,n); | 769 | p.drawText(valuearea,AlignCenter,n); |
738 | p.setFont(big_font); | 770 | p.setFont(*big_font); |
739 | area = QRect(x(),y(),width()-2,height()-1); | 771 | area = QRect(x(),y()+tile_btweak,width()-4,height()-1); |
740 | } else { | 772 | } else { |
741 | p.setFont(small_font); | 773 | p.setFont(*small_font); |
742 | area = QRect(x(),y()+2,width(),height()-2); | 774 | area = QRect(x()+1+tile_stweak,y()+1,width(),height()-3); |
743 | } | 775 | } |
744 | if ( t.value() == 0 ) | 776 | if ( t.value() == 0 ) |
745 | p.setPen(darkGray); | 777 | p.setPen(darkGray); |
@@ -750,6 +782,7 @@ Board::Board(QPixmap bgshapes, int w, int h, QWidget* parent) : | |||
750 | QCanvasView(new QCanvas(bgshapes,w,h, TileItem::smallWidth(), TileItem::smallHeight()), | 782 | QCanvasView(new QCanvas(bgshapes,w,h, TileItem::smallWidth(), TileItem::smallHeight()), |
751 | parent) | 783 | parent) |
752 | { | 784 | { |
785 | setFixedSize(w*TileItem::smallWidth(),h*TileItem::smallHeight()); | ||
753 | grid = new TileItem*[w*h]; | 786 | grid = new TileItem*[w*h]; |
754 | memset(grid,0,w*h*sizeof(TileItem*)); | 787 | memset(grid,0,w*h*sizeof(TileItem*)); |
755 | setFrameStyle(0); | 788 | setFrameStyle(0); |
@@ -764,6 +797,11 @@ Board::~Board() | |||
764 | delete canvas(); | 797 | delete canvas(); |
765 | } | 798 | } |
766 | 799 | ||
800 | QSize Board::sizeHint() const | ||
801 | { | ||
802 | return QSize(canvas()->width(),canvas()->height()); | ||
803 | } | ||
804 | |||
767 | void Board::writeConfig(Config& cfg) | 805 | void Board::writeConfig(Config& cfg) |
768 | { | 806 | { |
769 | QStringList t; | 807 | QStringList t; |
@@ -1181,6 +1219,11 @@ Rack::~Rack() | |||
1181 | delete canvas(); | 1219 | delete canvas(); |
1182 | } | 1220 | } |
1183 | 1221 | ||
1222 | QSize Rack::sizeHint() const | ||
1223 | { | ||
1224 | return QSize(-1,TileItem::bigHeight()+2); | ||
1225 | } | ||
1226 | |||
1184 | void Rack::clear() | 1227 | void Rack::clear() |
1185 | { | 1228 | { |
1186 | for (int i=0; i<n; i++) | 1229 | for (int i=0; i<n; i++) |
diff --git a/noncore/games/wordgame/wordgame.h b/noncore/games/wordgame/wordgame.h index 0ffa56a..f73c85a 100644 --- a/noncore/games/wordgame/wordgame.h +++ b/noncore/games/wordgame/wordgame.h | |||
@@ -148,6 +148,8 @@ public: | |||
148 | void setComputerization(int level) { cpu=level; } | 148 | void setComputerization(int level) { cpu=level; } |
149 | bool computerized() const { return cpu>0; } | 149 | bool computerized() const { return cpu>0; } |
150 | 150 | ||
151 | QSize sizeHint() const; | ||
152 | |||
151 | protected: | 153 | protected: |
152 | void resizeEvent(QResizeEvent*e); | 154 | void resizeEvent(QResizeEvent*e); |
153 | void contentsMousePressEvent(QMouseEvent*); | 155 | void contentsMousePressEvent(QMouseEvent*); |
@@ -211,6 +213,8 @@ public: | |||
211 | 213 | ||
212 | int turnScore() const { return turn_score; } | 214 | int turnScore() const { return turn_score; } |
213 | 215 | ||
216 | QSize sizeHint() const; | ||
217 | |||
214 | signals: | 218 | signals: |
215 | void temporaryScore(int); | 219 | void temporaryScore(int); |
216 | 220 | ||
@@ -331,7 +335,7 @@ private: | |||
331 | 335 | ||
332 | QWidgetStack *racks; | 336 | QWidgetStack *racks; |
333 | QToolBar* toolbar; | 337 | QToolBar* toolbar; |
334 | QVBox *vbox; | 338 | QWidget *vbox; |
335 | Board *board; | 339 | Board *board; |
336 | Bag *bag; | 340 | Bag *bag; |
337 | ScoreInfo *scoreinfo; | 341 | ScoreInfo *scoreinfo; |
diff --git a/noncore/multimedia/showimg/settingsdialog.cpp b/noncore/multimedia/showimg/settingsdialog.cpp deleted file mode 100644 index d21f4cb..0000000 --- a/noncore/multimedia/showimg/settingsdialog.cpp +++ b/dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of the Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #include "settingsdialog.h" | ||
22 | #include <qslider.h> | ||
23 | #include <qlabel.h> | ||
24 | #include <qcheckbox.h> | ||
25 | |||
26 | SettingsDialog::SettingsDialog( QWidget *parent, const char *name, bool modal, WFlags f ) | ||
27 | : SettingsDialogBase( parent, name, modal, f ) | ||
28 | { | ||
29 | connect( delaySlider, SIGNAL(valueChanged(int)), this, SLOT(delayChanged(int)) ); | ||
30 | } | ||
31 | |||
32 | void SettingsDialog::setDelay( int d ) | ||
33 | { | ||
34 | delaySlider->setValue( d ); | ||
35 | delayChanged( d ); | ||
36 | } | ||
37 | |||
38 | int SettingsDialog::delay() const | ||
39 | { | ||
40 | return delaySlider->value(); | ||
41 | } | ||
42 | |||
43 | void SettingsDialog::setRepeat( bool r ) | ||
44 | { | ||
45 | repeatCheck->setChecked( r ); | ||
46 | } | ||
47 | |||
48 | bool SettingsDialog::repeat() const | ||
49 | { | ||
50 | return repeatCheck->isChecked(); | ||
51 | } | ||
52 | |||
53 | void SettingsDialog::delayChanged( int d ) | ||
54 | { | ||
55 | delayText->setText( QString::number( d ) + " s" ); | ||
56 | } | ||
57 | |||
diff --git a/noncore/multimedia/showimg/settingsdialog.h b/noncore/multimedia/showimg/settingsdialog.h deleted file mode 100644 index 6dfd2c4..0000000 --- a/noncore/multimedia/showimg/settingsdialog.h +++ b/dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of the Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #ifndef SETTINGSDIALOG_H | ||
22 | #define SETTINGSDIALOG_H | ||
23 | |||
24 | #include "settingsdialogbase.h" | ||
25 | |||
26 | class SettingsDialog : public SettingsDialogBase | ||
27 | { | ||
28 | Q_OBJECT | ||
29 | public: | ||
30 | SettingsDialog( QWidget * parent=0, const char * name=0, bool modal=FALSE, WFlags f=0 ); | ||
31 | |||
32 | void setDelay( int d ); | ||
33 | int delay() const; | ||
34 | void setRepeat( bool r ); | ||
35 | bool repeat() const; | ||
36 | |||
37 | private slots: | ||
38 | void delayChanged( int ); | ||
39 | }; | ||
40 | |||
41 | |||
42 | #endif | ||
diff --git a/noncore/multimedia/showimg/settingsdialogbase.ui b/noncore/multimedia/showimg/settingsdialogbase.ui deleted file mode 100644 index ed404d8..0000000 --- a/noncore/multimedia/showimg/settingsdialogbase.ui +++ b/dev/null | |||
@@ -1,149 +0,0 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>SettingsDialogBase</class> | ||
3 | <widget> | ||
4 | <class>QDialog</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>SettingsDialogBase</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>227</width> | ||
15 | <height>258</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>Preferences</string> | ||
21 | </property> | ||
22 | <vbox> | ||
23 | <property stdset="1"> | ||
24 | <name>margin</name> | ||
25 | <number>11</number> | ||
26 | </property> | ||
27 | <property stdset="1"> | ||
28 | <name>spacing</name> | ||
29 | <number>6</number> | ||
30 | </property> | ||
31 | <widget> | ||
32 | <class>QGroupBox</class> | ||
33 | <property stdset="1"> | ||
34 | <name>name</name> | ||
35 | <cstring>GroupBox1</cstring> | ||
36 | </property> | ||
37 | <property stdset="1"> | ||
38 | <name>title</name> | ||
39 | <string>Slide Show</string> | ||
40 | </property> | ||
41 | <vbox> | ||
42 | <property stdset="1"> | ||
43 | <name>margin</name> | ||
44 | <number>11</number> | ||
45 | </property> | ||
46 | <property stdset="1"> | ||
47 | <name>spacing</name> | ||
48 | <number>6</number> | ||
49 | </property> | ||
50 | <widget> | ||
51 | <class>QCheckBox</class> | ||
52 | <property stdset="1"> | ||
53 | <name>name</name> | ||
54 | <cstring>repeatCheck</cstring> | ||
55 | </property> | ||
56 | <property stdset="1"> | ||
57 | <name>text</name> | ||
58 | <string>Repeat</string> | ||
59 | </property> | ||
60 | </widget> | ||
61 | <widget> | ||
62 | <class>QLayoutWidget</class> | ||
63 | <property stdset="1"> | ||
64 | <name>name</name> | ||
65 | <cstring>Layout1</cstring> | ||
66 | </property> | ||
67 | <hbox> | ||
68 | <property stdset="1"> | ||
69 | <name>margin</name> | ||
70 | <number>0</number> | ||
71 | </property> | ||
72 | <property stdset="1"> | ||
73 | <name>spacing</name> | ||
74 | <number>6</number> | ||
75 | </property> | ||
76 | <widget> | ||
77 | <class>QLabel</class> | ||
78 | <property stdset="1"> | ||
79 | <name>name</name> | ||
80 | <cstring>TextLabel1</cstring> | ||
81 | </property> | ||
82 | <property stdset="1"> | ||
83 | <name>text</name> | ||
84 | <string>Delay</string> | ||
85 | </property> | ||
86 | </widget> | ||
87 | <widget> | ||
88 | <class>QSlider</class> | ||
89 | <property stdset="1"> | ||
90 | <name>name</name> | ||
91 | <cstring>delaySlider</cstring> | ||
92 | </property> | ||
93 | <property stdset="1"> | ||
94 | <name>minValue</name> | ||
95 | <number>5</number> | ||
96 | </property> | ||
97 | <property stdset="1"> | ||
98 | <name>maxValue</name> | ||
99 | <number>60</number> | ||
100 | </property> | ||
101 | <property stdset="1"> | ||
102 | <name>lineStep</name> | ||
103 | <number>5</number> | ||
104 | </property> | ||
105 | <property stdset="1"> | ||
106 | <name>orientation</name> | ||
107 | <enum>Horizontal</enum> | ||
108 | </property> | ||
109 | <property stdset="1"> | ||
110 | <name>tickmarks</name> | ||
111 | <enum>Right</enum> | ||
112 | </property> | ||
113 | <property stdset="1"> | ||
114 | <name>tickInterval</name> | ||
115 | <number>10</number> | ||
116 | </property> | ||
117 | </widget> | ||
118 | <widget> | ||
119 | <class>QLabel</class> | ||
120 | <property stdset="1"> | ||
121 | <name>name</name> | ||
122 | <cstring>delayText</cstring> | ||
123 | </property> | ||
124 | <property stdset="1"> | ||
125 | <name>minimumSize</name> | ||
126 | <size> | ||
127 | <width>25</width> | ||
128 | <height>0</height> | ||
129 | </size> | ||
130 | </property> | ||
131 | <property stdset="1"> | ||
132 | <name>text</name> | ||
133 | <string>s</string> | ||
134 | </property> | ||
135 | <property stdset="1"> | ||
136 | <name>alignment</name> | ||
137 | <set>AlignVCenter|AlignRight</set> | ||
138 | </property> | ||
139 | <property> | ||
140 | <name>hAlign</name> | ||
141 | </property> | ||
142 | </widget> | ||
143 | </hbox> | ||
144 | </widget> | ||
145 | </vbox> | ||
146 | </widget> | ||
147 | </vbox> | ||
148 | </widget> | ||
149 | </UI> | ||