[Scummvm-cvs-logs] SF.net SVN: scummvm:[39266] scummvm/branches/branch-0-13-0/gui/TabWidget. cpp

agent-q at users.sourceforge.net agent-q at users.sourceforge.net
Mon Mar 9 18:02:30 CET 2009


Revision: 39266
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39266&view=rev
Author:   agent-q
Date:     2009-03-09 17:02:30 +0000 (Mon, 09 Mar 2009)

Log Message:
-----------
Fixing TabWidget size when not part of theme.

Modified Paths:
--------------
    scummvm/branches/branch-0-13-0/gui/TabWidget.cpp

Modified: scummvm/branches/branch-0-13-0/gui/TabWidget.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/gui/TabWidget.cpp	2009-03-09 16:44:11 UTC (rev 39265)
+++ scummvm/branches/branch-0-13-0/gui/TabWidget.cpp	2009-03-09 17:02:30 UTC (rev 39266)
@@ -103,6 +103,7 @@
 			_tabWidth = maxWidth;
 	}
 
+
 	// Activate the new tab
 	setActiveTab(numTabs - 1);
 
@@ -217,18 +218,20 @@
 
 	if (_tabWidth == 0) {
 		_tabWidth = 40;
-		int maxWidth = _w / _tabs.size();
+	}
 
-		for (uint i = 0; i < _tabs.size(); ++i) {
-			// Determine the new tab width
-			int newWidth = g_gui.getStringWidth(_tabs[i].title) + 2 * 3;
-			if (_tabWidth < newWidth)
-				_tabWidth = newWidth;
-			if (_tabWidth > maxWidth)
-				_tabWidth = maxWidth;
-		}
+	int maxWidth = _w / _tabs.size();
+
+	for (uint i = 0; i < _tabs.size(); ++i) {
+		// Determine the new tab width
+		int newWidth = g_gui.getStringWidth(_tabs[i].title) + 2 * 3;
+		if (_tabWidth < newWidth)
+			_tabWidth = newWidth;
+		if (_tabWidth > maxWidth)
+			_tabWidth = maxWidth;
 	}
 
+
 	_butRP = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButton.PaddingRight", 0);
 	_butTP = g_gui.xmlEval()->getVar("Globals.TabWidget.NavButton.Padding.Top", 0);
 	_butW = g_gui.xmlEval()->getVar("GlobalsTabWidget.NavButton.Width", 10);


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