summaryrefslogtreecommitdiff
path: root/noncore/games/solitaire/canvasshapes.cpp
Unidiff
Diffstat (limited to 'noncore/games/solitaire/canvasshapes.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/solitaire/canvasshapes.cpp24
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
@@ -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,12 +37,15 @@ 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{
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
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)
@@ -70,12 +74,29 @@ 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{
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);
@@ -86,7 +107,8 @@ void CanvasCircleOrCross::drawShape(QPainter &p)
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