author | kergoth <kergoth> | 2002-06-07 18:53:14 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-06-07 18:53:14 (UTC) |
commit | 640d964cfdc7467f6cacb513087cd3acda2c04f0 (patch) (unidiff) | |
tree | 9a784686c1795f8b1f81eb344598f3b549d43467 /noncore/games/solitaire/canvasshapes.cpp | |
parent | dfb9c76738bb68e235114c5ad43dbd26a59b98ab (diff) | |
download | opie-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) (show whitespace changes)
-rw-r--r-- | noncore/games/solitaire/canvasshapes.cpp | 24 |
1 files changed, 23 insertions, 1 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 | |||
@@ -10,44 +10,48 @@ | |||
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
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 | ||
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(); |
30 | } | 31 | } |
31 | 32 | ||
32 | 33 | ||
33 | void CanvasRoundRect::redraw() | 34 | void CanvasRoundRect::redraw() |
34 | { | 35 | { |
35 | hide(); | 36 | hide(); |
36 | show(); | 37 | show(); |
37 | } | 38 | } |
38 | 39 | ||
39 | 40 | ||
40 | void CanvasRoundRect::drawShape(QPainter &p) | 41 | void CanvasRoundRect::drawShape(QPainter &p) |
41 | { | 42 | { |
43 | if ( qt_screen->deviceWidth() < 200 ) | ||
44 | p.drawRoundRect( (int)x() + 1, (int)y() + 1, 18, 25); | ||
45 | else | ||
42 | p.drawRoundRect( (int)x(), (int)y(), 23, 36); | 46 | p.drawRoundRect( (int)x(), (int)y(), 23, 36); |
43 | } | 47 | } |
44 | 48 | ||
45 | 49 | ||
46 | CanvasCircleOrCross::CanvasCircleOrCross(int x, int y, QCanvas *canvas) : | 50 | CanvasCircleOrCross::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 | { |
49 | show(); | 53 | show(); |
50 | } | 54 | } |
51 | 55 | ||
52 | 56 | ||
53 | void CanvasCircleOrCross::redraw() | 57 | void CanvasCircleOrCross::redraw() |
@@ -64,29 +68,47 @@ void CanvasCircleOrCross::setCircle() | |||
64 | } | 68 | } |
65 | 69 | ||
66 | 70 | ||
67 | void CanvasCircleOrCross::setCross() | 71 | void CanvasCircleOrCross::setCross() |
68 | { | 72 | { |
69 | circleShape = FALSE; | 73 | circleShape = FALSE; |
70 | redraw(); | 74 | redraw(); |
71 | } | 75 | } |
72 | 76 | ||
73 | 77 | ||
74 | void CanvasCircleOrCross::drawShape(QPainter &p) | 78 | void CanvasCircleOrCross::drawShape(QPainter &p) |
75 | { | 79 | { |
80 | if ( qt_screen->deviceWidth() < 200 ) { | ||
81 | int x1 = (int)x(), y1 = (int)y(); | ||
82 | // Green circle | ||
83 | if (circleShape == TRUE) { | ||
84 | p.setPen( QPen( QColor(0x10, 0xE0, 0x10), 1 ) ); | ||
85 | p.drawEllipse( x1 - 1, y1 - 1, 17, 17); | ||
86 | p.drawEllipse( x1 - 1, y1 - 0, 17, 15); | ||
87 | p.drawEllipse( x1 + 0, y1 + 0, 15, 15); | ||
88 | p.drawEllipse( x1 + 1, y1 + 0, 13, 15); | ||
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 | } | ||
96 | } else { | ||
76 | int x1 = (int)x(), y1 = (int)y(); | 97 | int x1 = (int)x(), y1 = (int)y(); |
77 | // Green circle | 98 | // Green circle |
78 | if (circleShape == TRUE) { | 99 | if (circleShape == TRUE) { |
79 | p.setPen( QPen( QColor(0x10, 0xE0, 0x10), 1 ) ); | 100 | p.setPen( QPen( QColor(0x10, 0xE0, 0x10), 1 ) ); |
80 | p.drawEllipse( x1 - 1, y1 - 1, 21, 21); | 101 | p.drawEllipse( x1 - 1, y1 - 1, 21, 21); |
81 | p.drawEllipse( x1 - 1, y1 - 0, 21, 19); | 102 | p.drawEllipse( x1 - 1, y1 - 0, 21, 19); |
82 | p.drawEllipse( x1 + 0, y1 + 0, 19, 19); | 103 | p.drawEllipse( x1 + 0, y1 + 0, 19, 19); |
83 | p.drawEllipse( x1 + 1, y1 + 0, 17, 19); | 104 | p.drawEllipse( x1 + 1, y1 + 0, 17, 19); |
84 | p.drawEllipse( x1 + 1, y1 + 1, 17, 17); | 105 | p.drawEllipse( x1 + 1, y1 + 1, 17, 17); |
85 | // Red cross | 106 | // Red cross |
86 | } else { | 107 | } else { |
87 | p.setPen( QPen( QColor(0xE0, 0x10, 0x10), 5 ) ); | 108 | p.setPen( QPen( QColor(0xE0, 0x10, 0x10), 5 ) ); |
88 | p.drawLine( x1, y1, x1 + 20, y1 + 20); | 109 | p.drawLine( x1, y1, x1 + 20, y1 + 20); |
89 | p.drawLine( x1 + 20, y1, x1, y1 + 20); | 110 | p.drawLine( x1 + 20, y1, x1, y1 + 20); |
90 | } | 111 | } |
91 | } | 112 | } |
113 | } | ||
92 | 114 | ||