-rw-r--r-- | noncore/games/go/gowidget.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/noncore/games/go/gowidget.cpp b/noncore/games/go/gowidget.cpp index fca9797..8567b30 100644 --- a/noncore/games/go/gowidget.cpp +++ b/noncore/games/go/gowidget.cpp | |||
@@ -46,12 +46,14 @@ static QBrush *goBrush; | |||
46 | //static QImage *blackStone; | 46 | //static QImage *blackStone; |
47 | //static QImage *whiteStone; | 47 | //static QImage *whiteStone; |
48 | static QPixmap *newBlackStone; | 48 | static QPixmap *newBlackStone; |
49 | static QPixmap *blackStone; | 49 | static QPixmap *blackStone; |
50 | static QPixmap *whiteStone; | 50 | static QPixmap *whiteStone; |
51 | 51 | ||
52 | static bool smallStones = FALSE; | ||
53 | |||
52 | GoMainWidget::GoMainWidget( QWidget *parent, const char* name) : | 54 | GoMainWidget::GoMainWidget( QWidget *parent, const char* name) : |
53 | QMainWindow( parent, name ) | 55 | QMainWindow( parent, name ) |
54 | { | 56 | { |
55 | setToolBarsMovable( FALSE ); | 57 | setToolBarsMovable( FALSE ); |
56 | GoWidget *go = new GoWidget(this); | 58 | GoWidget *go = new GoWidget(this); |
57 | 59 | ||
@@ -194,12 +196,25 @@ void GoWidget::readConfig() | |||
194 | void GoWidget::resizeEvent( QResizeEvent * ) | 196 | void GoWidget::resizeEvent( QResizeEvent * ) |
195 | { | 197 | { |
196 | d = QMIN(width(),height())/19; | 198 | d = QMIN(width(),height())/19; |
197 | // int r = (d/2-1); | 199 | // int r = (d/2-1); |
198 | bx = (width() - 18*d)/2 ; | 200 | bx = (width() - 18*d)/2 ; |
199 | by = (height() - 18*d)/2 ; | 201 | by = (height() - 18*d)/2 ; |
202 | |||
203 | if ( d < 10 && !smallStones ) { | ||
204 | blackStone->convertFromImage( blackStone->convertToImage().smoothScale(8,8) ); | ||
205 | whiteStone->convertFromImage( whiteStone->convertToImage().smoothScale(8,8) ); | ||
206 | newBlackStone->convertFromImage( newBlackStone->convertToImage().smoothScale(8,8) ); | ||
207 | |||
208 | smallStones = TRUE; | ||
209 | } else if ( d >= 10 && smallStones ) { | ||
210 | blackStone = new QPixmap(Resource::loadPixmap( "Go-black" )); | ||
211 | whiteStone = new QPixmap(Resource::loadPixmap( "Go-white" )); | ||
212 | newBlackStone = new QPixmap(Resource::loadPixmap( "Go-black-highlight" )); | ||
213 | smallStones = FALSE; | ||
214 | } | ||
200 | } | 215 | } |
201 | 216 | ||
202 | void GoWidget::init() | 217 | void GoWidget::init() |
203 | { | 218 | { |
204 | lastX = lastY = newX = newY = -1; | 219 | lastX = lastY = newX = newY = -1; |
205 | nPassed = 0; | 220 | nPassed = 0; |