Diffstat (limited to 'noncore/games/solitaire/freecellcardgame.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/solitaire/freecellcardgame.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
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 @@ -16,8 +16,9 @@ ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ +#include <qgfx_qws.h> #include "freecellcardgame.h" extern int highestZ; @@ -28,18 +29,22 @@ FreecellCardGame::FreecellCardGame(QCanvas *c, bool snap, QWidget *parent) : Can { numberOfFreeCells = 4; highestZ = 0; + int spaceBetweenPiles = ( qt_screen->deviceWidth() < 200 ) ? 21 : 28; + int xOrigin = ( qt_screen->deviceWidth() < 200 ) ? 0 : 5; + int spacing = ( qt_screen->deviceWidth() < 200 ) ? 0 : 0; + for (int i = 0; i < 4; i++) { - freecellPiles[i] = new FreecellFreecellPile( 5 + i * 28, 10, canvas() ); + freecellPiles[i] = new FreecellFreecellPile( xOrigin + i * spaceBetweenPiles, 10, canvas() ); addCardPile(freecellPiles[i]); } for (int i = 0; i < 4; i++) { - discardPiles[i] = new FreecellDiscardPile( 125 + i * 28, 10, canvas() ); + discardPiles[i] = new FreecellDiscardPile( xOrigin + spacing + 6 + (i + 4) * spaceBetweenPiles, 10, canvas() ); addCardPile(discardPiles[i]); } for (int i = 0; i < 8; i++) { - workingPiles[i] = new FreecellWorkingPile( 10 + i * 28, 50, canvas() ); + workingPiles[i] = new FreecellWorkingPile( xOrigin + spacing + 2 + i * spaceBetweenPiles, 50, canvas() ); addCardPile(workingPiles[i]); } } |