summaryrefslogtreecommitdiff
path: root/noncore/games/solitaire/canvasshapes.cpp
authorkergoth <kergoth>2002-06-07 18:53:14 (UTC)
committer kergoth <kergoth>2002-06-07 18:53:14 (UTC)
commit640d964cfdc7467f6cacb513087cd3acda2c04f0 (patch) (unidiff)
tree9a784686c1795f8b1f81eb344598f3b549d43467 /noncore/games/solitaire/canvasshapes.cpp
parentdfb9c76738bb68e235114c5ad43dbd26a59b98ab (diff)
downloadopie-640d964cfdc7467f6cacb513087cd3acda2c04f0.zip
opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.tar.gz
opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.tar.bz2
Backing out unintentional merge from TT branch.
Diffstat (limited to 'noncore/games/solitaire/canvasshapes.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/solitaire/canvasshapes.cpp52
1 files changed, 37 insertions, 15 deletions
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
@@ -16,17 +16,18 @@
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
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
25CanvasRoundRect::CanvasRoundRect(int x, int y, QCanvas *canvas) : 26CanvasRoundRect::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();
30} 31}
31 32
32 33
@@ -36,13 +37,16 @@ void CanvasRoundRect::redraw()
36 show(); 37 show();
37} 38}
38 39
39 40
40void CanvasRoundRect::drawShape(QPainter &p) 41void 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
46CanvasCircleOrCross::CanvasCircleOrCross(int x, int y, QCanvas *canvas) : 50CanvasCircleOrCross::CanvasCircleOrCross(int x, int y, QCanvas *canvas) :
47 QCanvasRectangle( x, y, 21, 21, canvas), circleShape(TRUE) 51 QCanvasRectangle( x, y, 21, 21, canvas), circleShape(TRUE)
48{ 52{
@@ -70,23 +74,41 @@ void CanvasCircleOrCross::setCross()
70 redraw(); 74 redraw();
71} 75}
72 76
73 77
74void CanvasCircleOrCross::drawShape(QPainter &p) 78void 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