[Scummvm-cvs-logs] CVS: scummvm/gui TabWidget.cpp,1.16,1.17 TabWidget.h,1.10,1.11

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Fri Jun 3 05:02:37 CEST 2005


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26167

Modified Files:
	TabWidget.cpp TabWidget.h 
Log Message:
Cleanup.


Index: TabWidget.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/TabWidget.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- TabWidget.cpp	17 May 2005 06:19:42 -0000	1.16
+++ TabWidget.cpp	3 Jun 2005 12:00:38 -0000	1.17
@@ -44,19 +44,10 @@
 
 	_tabWidth = 40;
 
-	switch (_ws) {
-	case kNormalWidgetSize:
-		_font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont);
-		_tabHeight = kTabHeight;
-		break;
-	case kBigWidgetSize:
-		_font = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
+	if (_ws == kBigWidgetSize) {
 		_tabHeight = kBigTabHeight;
-		break;
-	case kDefaultWidgetSize:
-		_font = &g_gui.getFont();
+	} else {
 		_tabHeight = kTabHeight;
-		break;
 	}
 }
 
@@ -83,7 +74,7 @@
 	int numTabs = _tabs.size();
 
 	// Determine the new tab width
-	int newWidth = _font->getStringWidth(title) + 2 * kTabPadding;
+	int newWidth = g_gui.getStringWidth(title) + 2 * kTabPadding;
 	if (_tabWidth < newWidth)
 		_tabWidth = newWidth;
 	int maxWidth = (_w - kTabLeftOffset) / numTabs - kTabLeftOffset;
@@ -171,7 +162,7 @@
 		OverlayColor color = (i == _activeTab) ? gui->_color : gui->_shadowcolor;
 		int yOffset = (i == _activeTab) ? 0 : 2; 
 		box(x, _y + yOffset, _tabWidth, _tabHeight - yOffset, color, color, (i == _activeTab));
-		gui->drawString(_font, _tabs[i].title, x + kTabPadding, _y + yOffset / 2 + (_tabHeight - _font->getFontHeight() - 3), _tabWidth - 2 * kTabPadding, gui->_textcolor, kTextAlignCenter);
+		gui->drawString(_tabs[i].title, x + kTabPadding, _y + yOffset / 2 + (_tabHeight - gui->getFontHeight() - 3), _tabWidth - 2 * kTabPadding, gui->_textcolor, kTextAlignCenter);
 		x += _tabWidth + kTabSpacing;
 	}
 

Index: TabWidget.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/TabWidget.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- TabWidget.h	17 May 2005 06:19:42 -0000	1.10
+++ TabWidget.h	3 Jun 2005 12:00:38 -0000	1.11
@@ -40,7 +40,6 @@
 	int _tabWidth;
 	int _tabHeight;
 	const WidgetSize _ws;
-	const Graphics::Font *_font;
 
 public:
 	TabWidget(GuiObject *boss, int x, int y, int w, int h, WidgetSize ws = kDefaultWidgetSize);





More information about the Scummvm-git-logs mailing list