[Scummvm-cvs-logs] SF.net SVN: scummvm: [23117] scummvm/branches/branch-0-9-0/gui

sev at users.sourceforge.net sev at users.sourceforge.net
Thu Jun 15 04:20:55 CEST 2006


Revision: 23117
Author:   sev
Date:     2006-06-14 19:20:26 -0700 (Wed, 14 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23117&view=rev

Log Message:
-----------
Sync tabs drawing changes.

Modified Paths:
--------------
    scummvm/branches/branch-0-9-0/gui/TabWidget.cpp
    scummvm/branches/branch-0-9-0/gui/TabWidget.h
    scummvm/branches/branch-0-9-0/gui/ThemeClassic.cpp
    scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp
    scummvm/branches/branch-0-9-0/gui/theme-config.cpp
    scummvm/branches/branch-0-9-0/gui/theme.h
    scummvm/branches/branch-0-9-0/gui/themes/modern.ini
    scummvm/branches/branch-0-9-0/gui/widget.cpp
Modified: scummvm/branches/branch-0-9-0/gui/TabWidget.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/gui/TabWidget.cpp	2006-06-15 02:14:40 UTC (rev 23116)
+++ scummvm/branches/branch-0-9-0/gui/TabWidget.cpp	2006-06-15 02:20:26 UTC (rev 23117)
@@ -24,8 +24,15 @@
 #include "gui/TabWidget.h"
 #include "gui/dialog.h"
 #include "gui/newgui.h"
+#include "gui/eval.h"
 
 namespace GUI {
+
+enum {
+	kCmdLeft  = 'LEFT',
+	kCmdRight = 'RGHT'
+};
+
 TabWidget::TabWidget(GuiObject *boss, int x, int y, int w, int h)
 	: Widget(boss, x, y, w, h) {
 	init();
@@ -44,9 +51,23 @@
 	_flags = WIDGET_ENABLED;
 	_type = kTabWidget;
 	_activeTab = -1;
+	_firstVisibleTab = 0;
 
-	_tabWidth = 40;
-	_tabHeight = g_gui.theme()->getTabHeight();
+	_tabWidth = g_gui.evaluator()->getVar("TabWidget.tabWidth");
+	_tabHeight = g_gui.evaluator()->getVar("TabWidget.tabHeight");
+	_titleVPad = g_gui.evaluator()->getVar("TabWidget.titleVPad");
+
+	_butRP = g_gui.evaluator()->getVar("TabWidget.navButtonRightPad", 0);
+	_butTP = g_gui.evaluator()->getVar("TabWidget.navButtonTopPad", 0);
+	_butW = g_gui.evaluator()->getVar("TabWidget.navButtonW", 10);
+	_butH = g_gui.evaluator()->getVar("TabWidget.navButtonH", 10);
+
+	int x = _w - _butRP - _butW * 2 - 2;
+	int y = _butTP - _tabHeight;
+	_navLeft = new ButtonWidget(this, x, y, _butW, _butH, "<", kCmdLeft, 0);
+	_navLeft->clearHints(THEME_HINT_SAVE_BACKGROUND);
+	_navRight = new ButtonWidget(this, x + _butW + 2, y, _butW, _butH, ">", kCmdRight, 0);
+	_navRight->clearHints(THEME_HINT_SAVE_BACKGROUND);
 }
 
 TabWidget::~TabWidget() {
@@ -70,8 +91,19 @@
 	_tabs.push_back(newTab);
 
 	int numTabs = _tabs.size();
-	_tabWidth = _w / numTabs;
 
+	if (g_gui.evaluator()->getVar("TabWidget.tabWidth") == 0) {
+		if (_tabWidth == 0)
+			_tabWidth = 40;
+		// Determine the new tab width
+		int newWidth = g_gui.getStringWidth(title) + 2 * 3;
+		if (_tabWidth < newWidth)
+			_tabWidth = newWidth;
+		int maxWidth = _w / numTabs;
+		if (_tabWidth > maxWidth)
+			_tabWidth = maxWidth;
+	}
+
 	// Activate the new tab
 	setActiveTab(numTabs - 1);
 
@@ -93,6 +125,24 @@
 }
 
 
+void TabWidget::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
+	switch (cmd) {
+	case kCmdLeft:
+		if (_firstVisibleTab) {
+			_firstVisibleTab--;
+			draw();
+		}
+		break;
+
+	case kCmdRight:
+		if (_firstVisibleTab + _w / _tabWidth < (int)_tabs.size()) {
+			_firstVisibleTab++;
+			draw();
+		}
+		break;
+	}
+}
+
 void TabWidget::handleMouseDown(int x, int y, int button, int clickCount) {
 	assert(y < _tabHeight);
 
@@ -105,8 +155,8 @@
 	}
 
 	// If a tab was clicked, switch to that pane
-	if (tabID >= 0) {
-		setActiveTab(tabID);
+	if (tabID >= 0 && tabID + _firstVisibleTab < (int)_tabs.size()) {
+		setActiveTab(tabID + _firstVisibleTab);
 	}
 }
 
@@ -128,27 +178,66 @@
 		}
 	}
 
-	_tabHeight = g_gui.theme()->getTabHeight();
-	_tabWidth = 40;
+	_tabHeight = g_gui.evaluator()->getVar("TabWidget.tabHeight");
+	_tabWidth = g_gui.evaluator()->getVar("TabWidget.tabWidth");
+	_titleVPad = g_gui.evaluator()->getVar("TabWidget.titleVPad");
 
+	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;
+		}
+	}
+
+	_butRP = g_gui.evaluator()->getVar("TabWidget.navButtonRightPad", 0);
+	_butTP = g_gui.evaluator()->getVar("TabWidget.navButtonTopPad", 0);
+	_butW = g_gui.evaluator()->getVar("TabWidget.navButtonW", 10);
+	_butH = g_gui.evaluator()->getVar("TabWidget.navButtonH", 10);
+
+	int x = _w - _butRP - _butW * 2 - 2 - _boss->getChildX();
+	int y = _butTP - _boss->getChildY() - _tabHeight;
+	_navLeft->resize(x, y, _butW, _butH);
+	_navRight->resize(x + _butW + 2, y, _butW, _butH);
+
 	_tabOffset = 0;	// TODO
 	_tabSpacing = g_gui.theme()->getTabSpacing();
 	_tabPadding = g_gui.theme()->getTabPadding();
-
-	if (_tabs.size())
-		_tabWidth = _w / _tabs.size();
 }
 
 void TabWidget::drawWidget(bool hilite) {
 	Common::Array<Common::String> tabs;
-	for (int i = 0; i < (int)_tabs.size(); ++i) {
+	for (int i = _firstVisibleTab; i < (int)_tabs.size(); ++i) {
 		tabs.push_back(_tabs[i].title);
 	}
-	g_gui.theme()->drawTab(Common::Rect(_x, _y, _x+_w, _y+_h), _tabHeight, _tabWidth, tabs, _activeTab, _hints);
+	g_gui.theme()->drawTab(Common::Rect(_x, _y, _x+_w, _y+_h), _tabHeight, _tabWidth, tabs, _activeTab - _firstVisibleTab, _hints, _titleVPad);
 }
 
+void TabWidget::draw() {
+	Widget::draw();
+	if (_tabWidth * _tabs.size() > _w) {
+		_navLeft->draw();
+		_navRight->draw();
+	}
+}
+
 Widget *TabWidget::findWidget(int x, int y) {
 	if (y < _tabHeight) {
+		if (_tabWidth * _tabs.size() > _w) {
+			if (y >= _butTP && y < _butTP + _butH) {
+				if (x >= _w - _butRP - _butW * 2 - 2 && x < _w - _butRP - _butW - 2)
+					return _navLeft;
+				if (x >= _w - _butRP - _butW &&  x < _w - _butRP)
+					return _navRight;
+			}
+		}
+
 		// Click was in the tab area
 		return this;
 	} else {

Modified: scummvm/branches/branch-0-9-0/gui/TabWidget.h
===================================================================
--- scummvm/branches/branch-0-9-0/gui/TabWidget.h	2006-06-15 02:14:40 UTC (rev 23116)
+++ scummvm/branches/branch-0-9-0/gui/TabWidget.h	2006-06-15 02:20:26 UTC (rev 23117)
@@ -35,8 +35,10 @@
 		Widget *firstWidget;
 	};
 	typedef Common::Array<Tab> TabList;
+
 protected:
 	int _activeTab;
+	int _firstVisibleTab;
 	TabList _tabs;
 	int _tabWidth;
 	int _tabHeight;
@@ -44,7 +46,12 @@
 	int _tabOffset;
 	int _tabSpacing;
 	int _tabPadding;
+	int _titleVPad;
 
+	int _butRP, _butTP, _butW, _butH;
+
+	ButtonWidget *_navLeft, *_navRight;
+
 public:
 	TabWidget(GuiObject *boss, int x, int y, int w, int h);
 	TabWidget(GuiObject *boss, const String &name);
@@ -71,9 +78,12 @@
 
 	virtual void handleMouseDown(int x, int y, int button, int clickCount);
 	virtual bool handleKeyDown(uint16 ascii, int keycode, int modifiers);
+	virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
 
 	virtual void handleScreenChanged();
 
+	virtual void draw();
+
 protected:
 	virtual void drawWidget(bool hilite);
 

Modified: scummvm/branches/branch-0-9-0/gui/ThemeClassic.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/gui/ThemeClassic.cpp	2006-06-15 02:14:40 UTC (rev 23116)
+++ scummvm/branches/branch-0-9-0/gui/ThemeClassic.cpp	2006-06-15 02:20:26 UTC (rev 23117)
@@ -138,14 +138,6 @@
 	}
 }
 
-int ThemeClassic::getTabHeight() const {
-	if (_screen.w >= 400 && _screen.h >= 300) {
-		return 21;
-	} else {
-		return 16;
-	}
-}
-
 int ThemeClassic::getTabSpacing() const {
 	return 2;
 }
@@ -221,7 +213,7 @@
 	addDirtyRect(r, (hints & THEME_HINT_SAVE_BACKGROUND) != 0);
 }
 
-void ThemeClassic::drawButton(const Common::Rect &r, const Common::String &str, State state) {
+void ThemeClassic::drawButton(const Common::Rect &r, const Common::String &str, State state, uint16 hints) {
 	if (!_initOk)
 		return;
 	restoreBackground(r);
@@ -356,7 +348,7 @@
 	addDirtyRect(r);
 }
 
-void ThemeClassic::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<Common::String> &tabs, int active, uint16 hints, State state) {
+void ThemeClassic::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<Common::String> &tabs, int active, uint16 hints, int titleVPad, State state) {
 	if (!_initOk)
 		return;
 	restoreBackground(r);
@@ -368,14 +360,16 @@
 		_font->drawString(&_screen, tabs[i], r.left + i * tabWidth, r.top+4, tabWidth, getColor(state), Graphics::kTextAlignCenter, 0, true);
 	}
 	
-	box(r.left + active * tabWidth, r.top, tabWidth, tabHeight, _color, _shadowcolor, true);
-	_font->drawString(&_screen, tabs[active], r.left + active * tabWidth, r.top+2, tabWidth, getColor(kStateHighlight), Graphics::kTextAlignCenter, 0, true);
+	if (active >= 0) {
+		box(r.left + active * tabWidth, r.top, tabWidth, tabHeight, _color, _shadowcolor, true);
+		_font->drawString(&_screen, tabs[active], r.left + active * tabWidth, r.top+titleVPad, tabWidth, getColor(kStateHighlight), Graphics::kTextAlignCenter, 0, true);
 
-	_screen.hLine(r.left, r.top + tabHeight, r.left + active * tabWidth + 1, _color);
-	_screen.hLine(r.left + active * tabWidth + tabWidth - 2, r.top + tabHeight, r.right, _color);
-	_screen.hLine(r.left, r.bottom - 1, r.right - 1, _shadowcolor);
-	_screen.vLine(r.left, r.top + tabHeight, r.bottom - 1, _color);
-	_screen.vLine(r.right - 1, r.top + tabHeight, r.bottom - 1, _shadowcolor);
+		_screen.hLine(r.left, r.top + tabHeight, r.left + active * tabWidth + 1, _color);
+		_screen.hLine(r.left + active * tabWidth + tabWidth - 2, r.top + tabHeight, r.right, _color);
+		_screen.hLine(r.left, r.bottom - 1, r.right - 1, _shadowcolor);
+		_screen.vLine(r.left, r.top + tabHeight, r.bottom - 1, _color);
+		_screen.vLine(r.right - 1, r.top + tabHeight, r.bottom - 1, _shadowcolor);
+	}
 	
 	addDirtyRect(r);
 }

Modified: scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp	2006-06-15 02:14:40 UTC (rev 23116)
+++ scummvm/branches/branch-0-9-0/gui/ThemeNew.cpp	2006-06-15 02:20:26 UTC (rev 23117)
@@ -43,7 +43,7 @@
 #define kShadowTr4 128
 #define kShadowTr5 192
 
-#define THEME_VERSION 16
+#define THEME_VERSION 17
 
 using Graphics::Surface;
 
@@ -391,13 +391,15 @@
 	addDirtyRect((hints & THEME_HINT_USE_SHADOW) ? r2 : r, (hints & THEME_HINT_SAVE_BACKGROUND) != 0);
 }
 
-void ThemeNew::drawButton(const Common::Rect &r, const Common::String &str, State state) {
+void ThemeNew::drawButton(const Common::Rect &r, const Common::String &str, State state, uint16 hints) {
 	if (!_initOk)
 		return;
 	
 	Common::Rect r2 = shadowRect(r, kShadowButton);
-	restoreBackground(r2);
 
+	if (hints & THEME_HINT_SAVE_BACKGROUND)
+		restoreBackground(r2);
+
 	// shadow
 	drawShadow(r, surface(kButtonBkgdCorner), surface(kButtonBkgdTop), surface(kButtonBkgdLeft), surface(kButtonBkgd), kShadowButton);
 
@@ -568,7 +570,7 @@
 	addDirtyRect(r);
 }
 
-void ThemeNew::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<Common::String> &tabs, int active, uint16 hints, State state) {
+void ThemeNew::drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<Common::String> &tabs, int active, uint16 hints, int titleVPad, State state) {
 	if (!_initOk)
 		return;
 
@@ -595,32 +597,40 @@
 		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 + tabOffset), r.top, r.left + i * (tabWidth + tabOffset) + tabWidth, r.top + tabHeight + 5);
 		drawRectMasked(tabRect, surface(kTabBkgdCorner), surface(kTabBkgdTop), surface(kTabBkgdLeft), surface(kTabBkgd),
 					256, _colors[kTabInactiveStart], _colors[kTabInactiveEnd], _gradientFactors[kTabFactor], true);
 
-		getFont()->drawString(&_screen, tabs[i], tabRect.left, tabRect.top+2, tabRect.width(), getColor(kStateEnabled), Graphics::kTextAlignCenter, 0, true);
+		getFont()->drawString(&_screen, tabs[i], tabRect.left, tabRect.top+titleVPad, tabRect.width(), getColor(kStateEnabled), Graphics::kTextAlignCenter, 0, true);
 	}
 	
 	// area shadow
-	Common::Rect widgetBackground = Common::Rect(r.left, r.top + tabHeight, r.right, r.bottom - 2);
+	Common::Rect widgetBackground = Common::Rect(r.left, r.top + tabHeight - 1, r.right, r.top 
+                 + tabHeight + 20);
 	drawShadow(widgetBackground, surface(kTabBkgdCorner), surface(kTabBkgdTop), surface(kTabBkgdLeft), surface(kTabBkgd),
-					kShadowSmall, false, true);
+					kShadowSmall);
 
 	// area itself
 	widgetBackground = Common::Rect(r.left, r.top + tabHeight, r.right, r.bottom);
 	drawRectMasked(widgetBackground, surface(kTabBkgdCorner), surface(kTabBkgdTop), surface(kTabBkgdLeft), surface(kTabBkgd),
 						/*(state == kStateDisabled) ? -30 : */256, tabEnd, _colors[kTabActiveEnd],
-						_gradientFactors[kTabFactor], false, true);
+						_gradientFactors[kTabFactor]);
 	addDirtyRect(widgetBackground, true);
 	
 	// active tab
-	Common::Rect tabRect(r.left + active * (tabWidth + tabOffset), r.top, r.left + active * (tabWidth + tabOffset) + tabWidth, r.top + tabHeight + 1);
-	drawRectMasked(tabRect, surface(kTabBkgdCorner), surface(kTabBkgdTop), surface(kTabBkgdLeft), surface(kTabBkgd),
+	if (active >= 0) {
+		Common::Rect tabRect(r.left + active * (tabWidth + tabOffset), r.top, r.left + active * (tabWidth + tabOffset) + tabWidth, r.top + tabHeight + 5);
+
+		Common::Rect shadowRect2(tabRect.left, r.top, tabRect.right, tabRect.bottom - 6);
+		drawShadow(shadowRect2, surface(kTabBkgdCorner), surface(kTabBkgdTop), surface(kTabBkgdLeft), surface(kTabBkgd), kShadowSmall, false, true);
+
+		drawRectMasked(tabRect, surface(kTabBkgdCorner), surface(kTabBkgdTop), surface(kTabBkgdLeft), surface(kTabBkgd),
 				256, _colors[kTabActiveStart], tabEnd, _gradientFactors[kTabFactor], true);
 
-	getFont()->drawString(&_screen, tabs[active], tabRect.left, tabRect.top+2, tabRect.width(), getColor(kStateHighlight), Graphics::kTextAlignCenter, 0, true);
 
+		getFont()->drawString(&_screen, tabs[active], tabRect.left, tabRect.top+titleVPad, tabRect.width(), getColor(kStateEnabled), Graphics::kTextAlignCenter, 0, true);
+	}
+
 	addDirtyRect(Common::Rect(r.left, r.top-2, r.right, r.bottom));
 }
 
@@ -748,15 +758,6 @@
 	addDirtyRect(r);
 }
 
-int ThemeNew::getTabHeight() const {
-	// TODO let the user specify those
-	if (_screen.w >= 400 && _screen.h >= 300) {
-		return 25;
-	} else {
-		return 16;
-	}
-}
-
 int ThemeNew::getTabSpacing() const {
 	return 0;
 }

Modified: scummvm/branches/branch-0-9-0/gui/theme-config.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/gui/theme-config.cpp	2006-06-15 02:14:40 UTC (rev 23116)
+++ scummvm/branches/branch-0-9-0/gui/theme-config.cpp	2006-06-15 02:20:26 UTC (rev 23117)
@@ -52,6 +52,10 @@
 "def_midiControlsSpacing=1\n"
 "def_vcAudioTabIndent=0\n"
 "use=XxY\n"
+"\n"
+"TabWidget.tabWidth=0\n"
+"TabWidget.tabHeight=16\n"
+"TabWidget.titleVPad=2\n"
 "# Scumm Saveload dialog\n"
 "scummsaveload=8 8 (w - 2 * 8) (h - 16)\n"
 "set_parent=scummsaveload\n"
@@ -100,6 +104,9 @@
 "ListWidget.hlRightPadding=1\n"
 "PopUpWidget.leftPadding=4\n"
 "PopUpWidget.rightPadding=0\n"
+"TabWidget.tabWidth=70\n"
+"TabWidget.tabHeight=21\n"
+"TabWidget.titleVPad=2\n"
 "\n"
 "###### chooser\n"
 "opHeight=(h * 7 / 10)\n"

Modified: scummvm/branches/branch-0-9-0/gui/theme.h
===================================================================
--- scummvm/branches/branch-0-9-0/gui/theme.h	2006-06-15 02:14:40 UTC (rev 23116)
+++ scummvm/branches/branch-0-9-0/gui/theme.h	2006-06-15 02:20:26 UTC (rev 23117)
@@ -147,11 +147,11 @@
 	virtual void drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, State state = kStateEnabled) = 0;
 
 	virtual void drawWidgetBackground(const Common::Rect &r, uint16 hints, WidgetBackground background = kWidgetBackgroundPlain, State state = kStateEnabled) = 0;
-	virtual void drawButton(const Common::Rect &r, const Common::String &str, State state = kStateEnabled) = 0;
+	virtual void drawButton(const Common::Rect &r, const Common::String &str, State state = kStateEnabled, uint16 hints = 0) = 0;
 	virtual void drawSurface(const Common::Rect &r, const Graphics::Surface &surface, State state = kStateEnabled, int alpha = 256, bool themeTrans = false) = 0;
 	virtual void drawSlider(const Common::Rect &r, int width, State state = kStateEnabled) = 0;
 	virtual void drawCheckbox(const Common::Rect &r, const Common::String &str, bool checked, State state = kStateEnabled) = 0;
-	virtual void drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<Common::String> &tabs, int active, uint16 hints, State state = kStateEnabled) = 0;
+	virtual void drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<Common::String> &tabs, int active, uint16 hints, int titleVPad, State state = kStateEnabled) = 0;
 	virtual void drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState, State state = kStateEnabled) = 0;
 	virtual void drawPopUpWidget(const Common::Rect &r, const Common::String &sel, int deltax, State state = kStateEnabled, TextAlign align = kTextAlignLeft) = 0;
 	virtual void drawCaret(const Common::Rect &r, bool erase, State state = kStateEnabled) = 0;
@@ -160,7 +160,6 @@
 	virtual void restoreBackground(Common::Rect r, bool special = false) = 0;
 	virtual bool addDirtyRect(Common::Rect r, bool save = false, bool special = false) = 0;
 
-	virtual int getTabHeight() const = 0;
 	virtual int getTabSpacing() const = 0;
 	virtual int getTabPadding() const = 0;
 
@@ -252,11 +251,11 @@
 	void drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, State state);
 
 	void drawWidgetBackground(const Common::Rect &r, uint16 hints, WidgetBackground background, State state);
-	void drawButton(const Common::Rect &r, const String &str, State state);
+	void drawButton(const Common::Rect &r, const String &str, State state, uint16 hints);
 	void drawSurface(const Common::Rect &r, const Graphics::Surface &surface, State state, int alpha, bool themeTrans);
 	void drawSlider(const Common::Rect &r, int width, State state);
 	void drawCheckbox(const Common::Rect &r, const String &str, bool checked, State state);
-	void drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<String> &tabs, int active, uint16 hints, State state);
+	void drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<String> &tabs, int active, uint16 hints, int titleVPad, State state);
 	void drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState, State state);
 	void drawPopUpWidget(const Common::Rect &r, const Common::String &sel, int deltax, State state, TextAlign align);
 	void drawCaret(const Common::Rect &r, bool erase, State state);
@@ -264,7 +263,6 @@
 	void restoreBackground(Common::Rect r, bool special = false);
 	bool addDirtyRect(Common::Rect r, bool save = false, bool special = false);
 
-	int getTabHeight() const;
 	int getTabSpacing() const;
 	int getTabPadding() const;
 
@@ -333,11 +331,11 @@
 	void drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, State state);
 
 	void drawWidgetBackground(const Common::Rect &r, uint16 hints, WidgetBackground background, State state);
-	void drawButton(const Common::Rect &r, const String &str, State state);
+	void drawButton(const Common::Rect &r, const String &str, State state, uint16 hints);
 	void drawSurface(const Common::Rect &r, const Graphics::Surface &surface, State state, int alpha, bool themeTrans);
 	void drawSlider(const Common::Rect &r, int width, State state);
 	void drawCheckbox(const Common::Rect &r, const String &str, bool checked, State state);
-	void drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<String> &tabs, int active, uint16 hints, State state);
+	void drawTab(const Common::Rect &r, int tabHeight, int tabWidth, const Common::Array<String> &tabs, int active, uint16 hints, int titleVPad, State state);
 	void drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState, State state);
 	void drawPopUpWidget(const Common::Rect &r, const Common::String &sel, int deltax, State state, TextAlign align);
 	void drawCaret(const Common::Rect &r, bool erase, State state);
@@ -347,7 +345,6 @@
 	void restoreBackground(Common::Rect r, bool special = false);
 	bool addDirtyRect(Common::Rect r, bool backup = false, bool special = false);
 
-	int getTabHeight() const;
 	int getTabSpacing() const;
 	int getTabPadding() const;
 

Modified: scummvm/branches/branch-0-9-0/gui/themes/modern.ini
===================================================================
--- scummvm/branches/branch-0-9-0/gui/themes/modern.ini	2006-06-15 02:14:40 UTC (rev 23116)
+++ scummvm/branches/branch-0-9-0/gui/themes/modern.ini	2006-06-15 02:20:26 UTC (rev 23117)
@@ -1,7 +1,7 @@
 # $URL$
 # $Id$
 [theme]
-version=16
+version=17
 
 [pixmaps]
 pix_dialog_corner="dialog_bkgd_corner.bmp"
@@ -24,10 +24,10 @@
 
 pix_widget_arrow="widget_arrow.bmp"
 
-pix_tab_corner="tab_bkgd_corner.bmp"
-pix_tab_top="button_bkgd_top.bmp"
-pix_tab_left="button_bkgd_left.bmp"
-pix_tab_bkgd="button_bkgd.bmp"
+pix_tab_corner="button_bkgd_corner.bmp"
+pix_tab_top="widget_bkgd_top.bmp"
+pix_tab_left="widget_bkgd_left.bmp"
+pix_tab_bkgd="widget_bkgd.bmp"
 
 pix_slider_bkgd_corner="button_bkgd_corner.bmp"
 pix_slider_bkgd_top="button_bkgd_top.bmp"
@@ -104,13 +104,13 @@
 slider_highlight_start=255 210 200
 slider_highlight_end=200 70 50
 
-tab_background_start=246 224 139
-tab_background_end=249 238 190
+tab_background_start=232 180 80
+tab_background_end=232 180 80
 
 tab_active_start=246 224 139
-tab_active_end=249 238 190
-tab_inactive_start=246 224 139
-tab_inactive_end=246 224 139
+tab_active_end=251 241 206
+tab_inactive_start=239 202 109
+tab_inactive_end=239 202 109
 
 scrollbar_background_start=247 228 166
 scrollbar_background_end=247 228 166
@@ -135,7 +135,7 @@
 
 [gradients]
 gradient_dialog_main=1
-gradient_dialog=1
+gradient_dialog=2
 gradient_dialog_special=2
 
 gradient_widget_small=3
@@ -221,6 +221,13 @@
 Console.rightPadding=5
 Console.topPadding=5
 Console.bottomPadding=5
+TabWidget.tabWidth=100
+TabWidget.tabHeight=27
+TabWidget.titleVPad=8
+TabWidget.navButtonRightPad=3
+TabWidget.navButtonTopPad=4
+TabWidget.navButtonW=15
+TabWidget.navButtonH=18
 
 ###### chooser
 opHeight=insetH
@@ -259,7 +266,7 @@
 globaloptions=insetX insetY insetW insetH
 set_parent=globaloptions
 vBorder=optionsVPad
-globaloptions_tabwidget=0 vBorder parent.w (parent.h - buttonHeight - 8 - 2 * vBorder)
+globaloptions_tabwidget=0 0 parent.w (parent.h - buttonHeight - 8 - 2 * vBorder)
 
 # graphics tab
 opYoffset=vBorder
@@ -300,7 +307,7 @@
 gox=10
 gow=(parent.w - gox - 25)
 
-gameoptions_tabwidget=0 vBorder parent.w (parent.h - buttonHeight - 8 - 2 * vBorder)
+gameoptions_tabwidget=0 0 parent.w (parent.h - buttonHeight - 8 - 2 * vBorder)
 
 # game tab
 opYoffset=optionsVPad

Modified: scummvm/branches/branch-0-9-0/gui/widget.cpp
===================================================================
--- scummvm/branches/branch-0-9-0/gui/widget.cpp	2006-06-15 02:14:40 UTC (rev 23116)
+++ scummvm/branches/branch-0-9-0/gui/widget.cpp	2006-06-15 02:20:26 UTC (rev 23117)
@@ -201,6 +201,7 @@
 	: StaticTextWidget(boss, name, label), CommandSender(boss),
 	  _cmd(cmd), _hotkey(hotkey) {
 	_flags = WIDGET_ENABLED/* | WIDGET_BORDER*/ | WIDGET_CLEARBG;
+	_hints = THEME_HINT_USE_SHADOW;
 	_type = kButtonWidget;
 }
 
@@ -210,7 +211,7 @@
 }
 
 void ButtonWidget::drawWidget(bool hilite) {
-	g_gui.theme()->drawButton(Common::Rect(_x, _y, _x+_w, _y+_h), _label, isEnabled() ? (hilite ? Theme::kStateHighlight : Theme::kStateEnabled) : Theme::kStateDisabled);
+	g_gui.theme()->drawButton(Common::Rect(_x, _y, _x+_w, _y+_h), _label, isEnabled() ? (hilite ? Theme::kStateHighlight : Theme::kStateEnabled) : Theme::kStateDisabled, _hints);
 }
 
 #pragma mark -


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