Diffstat (limited to 'noncore/games/minesweep/minesweep.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/minesweep/minesweep.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/noncore/games/minesweep/minesweep.cpp b/noncore/games/minesweep/minesweep.cpp index 7214a73..d707dab 100644 --- a/noncore/games/minesweep/minesweep.cpp +++ b/noncore/games/minesweep/minesweep.cpp @@ -1,5 +1,5 @@ /********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. ** -** This file is part of Qtopia Environment. +** This file is part of the Qtopia Environment. ** @@ -23,7 +23,7 @@ -#include <qpe/qpeapplication.h> -#include <qpe/resource.h> -#include <qpe/config.h> +#include <qtopia/qpeapplication.h> +#include <qtopia/resource.h> +#include <qtopia/config.h> -#include <qpe/qpetoolbar.h> +#include <qtoolbar.h> #include <qmenubar.h> @@ -200,2 +200,3 @@ void ResultIndicator::center() QSize s = sizeHint()*3; + s.setWidth( QMIN(s.width(), w->width()) ); pp = QPoint( pp.x() + w->width()/2 - s.width()/2, @@ -226,4 +227,7 @@ public: MineFrame( QWidget *parent, const char *name = 0 ) - :QFrame( parent, name ) {} - void setField( MineField *f ) { field = f; } + :QFrame( parent, name ), field(0) {} + void setField( MineField *f ) { + field = f; + setMinimumSize( field->sizeHint() ); + } protected: @@ -242,6 +246,6 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) { - QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff ); srand(::time(0)); setCaption( tr("Mine Hunt") ); - setIcon( Resource::loadPixmap( "minesweep_icon" ) ); + QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff ); + setIcon( Resource::loadPixmap( "minesweep/MineHunt" ) ); @@ -255,3 +259,6 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) gameMenu->insertItem( tr("Advanced"), this, SLOT( advanced() ) ); - gameMenu->insertItem( tr("Expert"), this, SLOT( expert() ) ); + + if (qApp->desktop()->width() >= 240) { + gameMenu->insertItem( tr("Expert"), this, SLOT( expert() ) ); + } @@ -301,4 +308,4 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) - connect( field, SIGNAL( gameOver( bool ) ), this, SLOT( gameOver( bool ) ) ); - connect( field, SIGNAL( mineCount( int ) ), this, SLOT( setCounter( int ) ) ); + connect( field, SIGNAL( gameOver(bool) ), this, SLOT( gameOver(bool) ) ); + connect( field, SIGNAL( mineCount(int) ), this, SLOT( setCounter(int) ) ); connect( field, SIGNAL( gameStarted()), this, SLOT( startPlaying() ) ); @@ -306,3 +313,2 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) timer = new QTimer( this ); - connect( timer, SIGNAL( timeout() ), this, SLOT( updateTime() ) ); |