[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/edu/kanagram/src
From:       Joshua Keel <joshuakeel () gmail ! com>
Date:       2005-08-02 15:40:01
Message-ID: 1122997201.193166.23226.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 442398 by jkeel:

Fix the hint text margins once more, hide the hint bubble on mouseclick, and disable \
the help rollovers when the hint is displayed


 M  +64 -41    kanagram.cpp  
 M  +2 -2      kanagram.h  


--- trunk/playground/edu/kanagram/src/kanagram.cpp #442397:442398
@@ -50,7 +50,7 @@
 #include "newstuff.h"
 
 
-Kanagram::Kanagram() : QWidget(0, 0, WStaticContents | WNoAutoErase), \
m_overNext(false), m_overConfig(false), m_overHelp(false), m_overQuit(false), \
m_overReveal(false), m_overHint(false), m_overTry(false), m_showHint(false) \
+Kanagram::Kanagram() : QWidget(0, 0, WStaticContents | WNoAutoErase), \
m_overNext(false), m_overConfig(false), m_overHelp(false), m_overQuit(false), \
m_overReveal(false), m_overHint(false), m_overTry(false), m_showHint(false), \
m_overHintBox(false)  {
 	m_back = new QPixmap(locate("appdata", "images/kanagram.png"));
 	m_aboutKDEOverlay = new QPixmap(locate("appdata", "images/kicon.png"));
@@ -83,6 +83,7 @@
 	m_quitRect = QRect(453, 352, 182, 104);
 	
 	m_hintRect = QRect(51, 337, 39, 28);
+	m_hintBoxRect = QRect(446, 207, 171, 85);
 	m_revealRect = QRect(279, 338, 119, 28);
 	m_tryRect = QRect(341, 426, 55, 33);
 	m_aboutKDERect = QRect(567, 213, 44, 44);
@@ -213,10 +214,10 @@
 		QFont f = QFont(m_font);
 		f.setPointSize(10);
 		p.setFont(f);
-		p.drawText(459, 216, 148, 67, WordBreak | AlignCenter, m_game.getHint());
+		p.drawText(459, 217, 148, 67, WordBreak | AlignCenter, m_game.getHint());
 	}
 
-	if(m_overHelp)
+	if(m_overHelp && !m_showHint)
 	{
 		p.drawPixmap(456, 275, *m_card);
 		if(m_overAboutApp)
@@ -307,6 +308,29 @@
 		m_helpMenu->aboutApplication();
 	}
 
+	if(!m_showHint && m_overHelp)
+	{
+		if(m_handbookRect.contains(e->pos()))
+		{
+			m_helpMenu->appHelpActivated();
+		}
+
+		if(m_aboutKDERect.contains(e->pos()))
+		{
+			m_helpMenu->aboutKDE();
+		}
+
+		if(m_aboutAppRect.contains(e->pos()))
+		{
+			m_helpMenu->aboutApplication();
+		}
+	}
+
+	if(m_hintBoxRect.contains(e->pos()))
+	{
+		hideHint();
+	}
+
 	if(m_switcherRect.contains(e->pos()) || m_arrowRect.contains(e->pos()))
 	{
 		if(!(e->button() == RightButton))
@@ -351,24 +375,6 @@
 			update();
 		}
 	}
-
-	if(m_overHelp)
-	{
-		if(m_handbookRect.contains(e->pos()))
-		{
-			m_helpMenu->appHelpActivated();
-		}
-
-		if(m_aboutKDERect.contains(e->pos()))
-		{
-			m_helpMenu->aboutKDE();
-		}
-
-		if(m_aboutAppRect.contains(e->pos()))
-		{
-			m_helpMenu->aboutApplication();
-		}
-	}
 }
 
 void Kanagram::mouseMoveEvent(QMouseEvent *e)
@@ -450,6 +456,20 @@
 		m_overHint = false;
 		haveToUpdate = true;
 	}
+
+	if(m_hintBoxRect.contains(p))
+	{
+		if(!m_overHintBox)
+		{
+			m_overHintBox = true;
+			haveToUpdate = true;
+		}
+	}
+	else if(m_overHintBox)
+	{
+		m_overHintBox = false;
+		haveToUpdate = true;
+	}
 	
 	if(m_revealRect.contains(p))
 	{
@@ -507,35 +527,38 @@
 		haveToUpdate = true;
 	}
 
-	if(m_handbookRect.contains(p))
+	if(!m_showHint)
 	{
-		if(!m_overHandbook)
+		if(m_handbookRect.contains(p))
 		{
-			m_overHandbook = true;
+			if(!m_overHandbook)
+			{
+				m_overHandbook = true;
+				haveToUpdate = true;
+			}
+		}
+		else if(m_overHandbook)
+		{
+			m_overHandbook = false;
 			haveToUpdate = true;
 		}
-	}
-	else if(m_overHandbook)
-	{
-		m_overHandbook = false;
-		haveToUpdate = true;
-	}
-
-	if(m_aboutKDERect.contains(p))
-	{
-		if(!m_overAboutKDE)
+	
+		if(m_aboutKDERect.contains(p))
 		{
-			m_overAboutKDE = true;
+			if(!m_overAboutKDE)
+			{
+				m_overAboutKDE = true;
+				haveToUpdate = true;
+			}
+		}
+		else if(m_overAboutKDE)
+		{
+			m_overAboutKDE = false;
 			haveToUpdate = true;
 		}
 	}
-	else if(m_overAboutKDE)
-	{
-		m_overAboutKDE = false;
-		haveToUpdate = true;
-	}
 
-	if(m_overAboutKDE || m_overHandbook || m_overSwitcher || m_overNext || m_overQuit \
|| m_overConfig || m_overReveal || m_overHint || m_overTry || m_overAboutApp) \
+	if(m_overAboutKDE || m_overHandbook || m_overSwitcher || m_overNext || m_overQuit \
|| m_overConfig || m_overReveal || m_overHint || m_overTry || m_overAboutApp || \
m_overHintBox)  this->setCursor(PointingHandCursor);
 	else
 		this->unsetCursor();
--- trunk/playground/edu/kanagram/src/kanagram.h #442397:442398
@@ -75,9 +75,9 @@
 		//Deprecated
 		//QRect m_newWordRect, m_settingsRect, m_helpRect, m_quitRect;
 		
-		QRect m_nextRect, m_configRect, m_helpRect, m_quitRect, m_revealRect, m_hintRect, \
m_tryRect, m_aboutKDERect, m_aboutAppRect, m_handbookRect, m_switcherRect, \
m_arrowRect, m_logoRect; +		QRect m_nextRect, m_configRect, m_helpRect, m_quitRect, \
m_revealRect, m_hintRect, m_tryRect, m_aboutKDERect, m_aboutAppRect, m_handbookRect, \
m_switcherRect, m_arrowRect, m_logoRect, m_hintBoxRect;  
-		bool m_overNext, m_overConfig, m_overHelp, m_overQuit, m_overReveal, m_overHint, \
m_overTry, m_overAboutKDE, m_overAboutApp, m_overHandbook, m_overSwitcher; +		bool \
m_overNext, m_overConfig, m_overHelp, m_overQuit, m_overReveal, m_overHint, \
m_overTry, m_overAboutKDE, m_overAboutApp, m_overHandbook, m_overSwitcher, \
m_overHintBox;  
 		bool m_showHint;
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic