[Scummvm-cvs-logs] SF.net SVN: scummvm:[42517] scummvm/trunk/gui/ThemeEngine.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Jul 16 00:19:17 CEST 2009


Revision: 42517
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42517&view=rev
Author:   lordhoto
Date:     2009-07-15 22:19:16 +0000 (Wed, 15 Jul 2009)

Log Message:
-----------
Fix ugly spacing between tabs in classic theme (as reported by sunmax on -devel).

Modified Paths:
--------------
    scummvm/trunk/gui/ThemeEngine.cpp

Modified: scummvm/trunk/gui/ThemeEngine.cpp
===================================================================
--- scummvm/trunk/gui/ThemeEngine.cpp	2009-07-15 20:51:31 UTC (rev 42516)
+++ scummvm/trunk/gui/ThemeEngine.cpp	2009-07-15 22:19:16 UTC (rev 42517)
@@ -996,23 +996,20 @@
 	if (!ready())
 		return;
 
-	const int tabOffset = 2;
-	tabWidth -= tabOffset;
-
 	queueDD(kDDTabBackground, Common::Rect(r.left, r.top, r.right, r.top + tabHeight));
 
 	for (int i = 0; i < (int)tabs.size(); ++i) {
 		if (i == active)
 			continue;
 
-		Common::Rect tabRect(r.left + i * (tabWidth + tabOffset), r.top, r.left + i * (tabWidth + tabOffset) + tabWidth, r.top + tabHeight);
+		Common::Rect tabRect(r.left + i * tabWidth, r.top, r.left + (i + 1) * tabWidth, r.top + tabHeight);
 		queueDD(kDDTabInactive, tabRect);
 		queueDDText(getTextData(kDDTabInactive), tabRect, tabs[i], false, false, _widgets[kDDTabInactive]->_textAlignH, _widgets[kDDTabInactive]->_textAlignV);
 	}
 
 	if (active >= 0) {
-		Common::Rect tabRect(r.left + active * (tabWidth + tabOffset), r.top, r.left + active * (tabWidth + tabOffset) + tabWidth, r.top + tabHeight);
-		const uint16 tabLeft = active * (tabWidth + tabOffset);
+		Common::Rect tabRect(r.left + active * tabWidth, r.top, r.left + (active + 1) * tabWidth, r.top + tabHeight);
+		const uint16 tabLeft = active * tabWidth;
 		const uint16 tabRight =  MAX(r.right - tabRect.right, 0);
 		queueDD(kDDTabActive, tabRect, (tabLeft << 16) | (tabRight & 0xFFFF));
 		queueDDText(getTextData(kDDTabActive), tabRect, tabs[active], false, false, _widgets[kDDTabActive]->_textAlignH, _widgets[kDDTabActive]->_textAlignV);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list