summaryrefslogtreecommitdiff
path: root/noncore/games/solitaire/patiencecardgame.h
Side-by-side diff
Diffstat (limited to 'noncore/games/solitaire/patiencecardgame.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/solitaire/patiencecardgame.h7
1 files changed, 5 insertions, 2 deletions
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
@@ -12,32 +12,33 @@
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef PATIENCE_CARD_GAME_H
#define PATIENCE_CARD_GAME_H
#include <qpopupmenu.h>
#include <qmainwindow.h>
#include <qintdict.h>
#include <qcanvas.h>
+#include <qgfx_qws.h>
// #include "canvascardshapes.h"
// #include "canvascard.h"
#include "canvascardgame.h"
class PatienceFaceDownDeck : public CardPile, public CanvasRoundRect
{
public:
PatienceFaceDownDeck(int x, int y, QCanvas *canvas)
: CardPile(x, y), CanvasRoundRect(x, y, canvas) { }
virtual bool isAllowedOnTop(Card *card) {
Q_UNUSED(card);
// Need to check it is from the faceUpDealingPile
return TRUE;
}
virtual bool isAllowedToBeMoved(Card *card) {
@@ -117,48 +118,50 @@ public:
setNextX( top.x() );
setNextY( top.y() );
}
virtual void cardRemoved(Card *card) {
Q_UNUSED(card);
Card *newTopCard = cardOnTop();
if ( !newTopCard ) {
top = QPoint( pileX, pileY );
setNextX( pileX );
setNextY( pileY );
return;
} else {
top = getCardPos(NULL);
if ( newTopCard->isFacing() == FALSE ) {
+ int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13;
// correct the position taking in to account the card is not
// yet flipped, but will become flipped
top = QPoint( top.x() - 1, top.y() - 3 );
newTopCard->flipTo( top.x(), top.y() );
- top = QPoint( top.x(), top.y() + 13 );
+ top = QPoint( top.x(), top.y() + offsetDown );
}
setNextX( top.x() );
setNextY( top.y() );
}
}
virtual QPoint getCardPos(Card *c) {
int x = pileX, y = pileY;
Card *card = cardOnBottom();
while ((card != c) && (card != NULL)) {
if (card->isFacing()) {
- y += 13;
+ int offsetDown = ( qt_screen->deviceWidth() < 200 ) ? 9 : 13;
+ y += offsetDown;
} else {
x += 1;
y += 3;
}
card = cardInfront(card);
}
return QPoint( x, y );
}
virtual QPoint getHypertheticalNextCardPos(void) {
return top;
// return QPoint( getNextX(), getNextY() );
}
private:
QPoint top;
};