[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeedu/khangman/khangman
From: Anne-Marie Mahfouf <annma () kde ! org>
Date: 2005-04-26 1:37:43
Message-ID: 20050426013743.631C43EF () office ! kde ! org
[Download RAW message or body]
CVS commit by annma:
fixes
M +21 -22 khangmanview.cpp 1.124
--- kdeedu/khangman/khangman/khangmanview.cpp #1.123:1.124
@@ -227,7 +227,11 @@ void KHangManView::paintWord()
void KHangManView::paintWordTwice()
{
- /*QPainter paint;
+ QPainter paint;
paint.begin(&bg);
- QRect myRect = QRect(0, height()-height()*126/535, width()*366/700, \
height()*126/535); + QRect myRect ;
+ if (Prefs::mode() ==0)
+ myRect = QRect(0, height()-height()*126/535, width()*417/700, \
height()*126/535); + else
+ myRect = QRect(0, height()-height()*126/535, width()*327/700, \
height()*126/535); QFont tFont;
if (Prefs::selectedLanguage() =="tg") {
@@ -241,10 +245,18 @@ void KHangManView::paintWordTwice()
QRect aux = paint.boundingRect(myRect, AlignCenter|AlignCenter, \
goodWord.left(redIndex)); kdDebug() << aux.width() << endl;
+ if (Prefs::mode() ==0) {
if (redIndex == 0)
- paint.drawText(aux.width()+2, height()-height()*126/535, width()*366/700, \
height()*126/535, AlignCenter|AlignCenter, QString(goodWord[redIndex])); + \
paint.drawText(aux.width()*width()/700, height()-height()*126/535, width()*417/700, \
height()*126/535, AlignCenter|AlignCenter, QString(goodWord[redIndex])); else \
//weird that it needs 2 pixels less after first
- paint.drawText(aux.width()+2, height()-height()*126/535, width()*366/700/2, \
height()*126/535, AlignCenter|AlignCenter, QString(goodWord[redIndex])); + \
paint.drawText(width()*aux.width()/700-2, height()-height()*126/535, \
width()*417/700/2, height()*126/535, AlignCenter|AlignCenter, \
QString(goodWord[redIndex])); + }
+ else {
+ if (redIndex == 0)
+ paint.drawText(aux.width()+2, height()-height()*126/535, \
width()*327/700, height()*126/535, AlignCenter|AlignCenter, \
QString(goodWord[redIndex])); + else //weird that it needs 2 pixels less after \
first + paint.drawText(aux.width()+2, height()-height()*126/535, \
width()*327/700/2, height()*126/535, AlignCenter|AlignCenter, \
QString(goodWord[redIndex])); + }
paint.end();
- bitBlt(this, 0, 0, &bg);*/
+ bitBlt(this, 0, 0, &bg);
}
@@ -426,17 +438,4 @@ void KHangManView::slotTry()
{
allWords << sChar;
- /* if (Prefs::mode() ==0) { //sea theme
- if (missedChar<5)
- missedL=missedL.replace(2*missedChar, 1, sChar);
- else if(missedChar>5)
- missedL=missedL.replace((2*missedChar)+2, 1, sChar);
-
- if (missedChar==5) //we actually need to replace one \
underscore too much..
- {
- missedL=missedL.replace((2*missedChar)+1,1, \
"\n"+sChar+" ");
- missedL=missedL.replace(22,2, "");
- }
- }
- else*/ //desert missed all in 1 line
missedL=missedL.replace((2*missedChar), 1, sChar);
@@ -577,5 +576,5 @@ void KHangManView::game()
kapp->quit();
}
- update();
+ //update();
//we open the file and store info into the stream...
QFile openFileStream(myFile.name());
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic