[Scummvm-cvs-logs] SF.net SVN: scummvm:[33771] scummvm/branches/gsoc2008-gui

Tanoku at users.sourceforge.net Tanoku at users.sourceforge.net
Mon Aug 11 00:03:03 CEST 2008


Revision: 33771
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33771&view=rev
Author:   Tanoku
Date:     2008-08-10 22:03:00 +0000 (Sun, 10 Aug 2008)

Log Message:
-----------
Bugfix: Selection background too short when scrollbar not present.
Bugfix: Vector renderer drawstep for bitmap blitting.
Added bitmap GFX for checkboxes.

Modified Paths:
--------------
    scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h
    scummvm/branches/gsoc2008-gui/gui/ListWidget.cpp
    scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp
    scummvm/branches/gsoc2008-gui/gui/ThemeParser.h
    scummvm/branches/gsoc2008-gui/gui/themes/scummodern.stx
    scummvm/branches/gsoc2008-gui/gui/themes/scummodern.zip

Modified: scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h
===================================================================
--- scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h	2008-08-10 22:02:37 UTC (rev 33770)
+++ scummvm/branches/gsoc2008-gui/graphics/VectorRenderer.h	2008-08-10 22:03:00 UTC (rev 33771)
@@ -417,7 +417,7 @@
 	void drawCallback_BITMAP(const Common::Rect &area, const DrawStep &step) {
 		uint16 x, y, w, h;
 		stepGetPositions(step, area, x, y, w, h);
-		blitAlphaBitmap(step.blitSrc, Common::Rect(x, y, w, h));
+		blitAlphaBitmap(step.blitSrc, Common::Rect(x, y, x + w, y + h));
 	}
 
 	void drawCallback_VOID(const Common::Rect &area, const DrawStep &step) {}
@@ -720,8 +720,6 @@
 	}
 	
 	virtual void blitAlphaBitmap(const Graphics::Surface *source, const Common::Rect &r) {
-		assert(r.width() >= source->w && r.height() >= source->h);
-		
 		int16 x = r.left;
 		int16 y = r.top;
 		

Modified: scummvm/branches/gsoc2008-gui/gui/ListWidget.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ListWidget.cpp	2008-08-10 22:02:37 UTC (rev 33770)
+++ scummvm/branches/gsoc2008-gui/gui/ListWidget.cpp	2008-08-10 22:03:00 UTC (rev 33771)
@@ -364,6 +364,7 @@
 
 	// Draw a thin frame around the list.
 	g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), _hints, Theme::kWidgetBackgroundBorder);
+	const int scrollbarW = (_scrollBar && _scrollBar->isVisible()) ? _scrollBarWidth : 0;
 
 	// Draw the list items
 	for (i = 0, pos = _currentPos; i < _entriesPerPage && pos < len; i++, pos++) {
@@ -398,7 +399,7 @@
 		if (_selectedItem == pos && _editMode) {
 			buffer = _editString;
 			adjustOffset();
-			width = _w - r.left - _hlRightPadding - _leftPadding - _scrollBarWidth;
+			width = _w - r.left - _hlRightPadding - _leftPadding - scrollbarW;
 			g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight-2), 
 									buffer, _state, Theme::kTextAlignLeft, inverted, pad);
 		} else {
@@ -407,9 +408,9 @@
 			if (_selectedItem != pos) {
 				width = g_gui.getStringWidth(buffer) + pad;
 				if (width > _w - r.left)
-					width = _w - r.left - _hlRightPadding - _scrollBarWidth;
+					width = _w - r.left - _hlRightPadding - scrollbarW;
 			} else
-				width = _w - r.left - _hlRightPadding - _scrollBarWidth;
+				width = _w - r.left - _hlRightPadding - scrollbarW;
 			if (width > maxWidth)
 				maxWidth = width;
 			g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + maxWidth, y + fontHeight-2), 

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp	2008-08-10 22:02:37 UTC (rev 33770)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeParser.cpp	2008-08-10 22:03:00 UTC (rev 33771)
@@ -354,10 +354,12 @@
 		Common::String functionName = stepNode->values["func"];
 		
 		if (functionName == "bitmap") {
-			if (!stepNode->values.contains("filename"))
+			if (!stepNode->values.contains("file"))
 				return parserError("Need to specify a filename for Bitmap blitting.");
 				
-			if (!_theme->getBitmap(stepNode->values["filename"]))
+			drawstep->blitSrc = _theme->getBitmap(stepNode->values["file"]);
+				
+			if (!drawstep->blitSrc)
 				return parserError("The given filename hasn't been loaded into the GUI.");
 		}
 

Modified: scummvm/branches/gsoc2008-gui/gui/ThemeParser.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeParser.h	2008-08-10 22:02:37 UTC (rev 33770)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeParser.h	2008-08-10 22:03:00 UTC (rev 33771)
@@ -422,7 +422,7 @@
 					XML_PROP(xpos, false)
 					XML_PROP(ypos, false)
 					XML_PROP(orientation, false)
-					XML_PROP(bitmap, false)
+					XML_PROP(file, false)
 				KEY_END()
 
 				XML_KEY(text)

Modified: scummvm/branches/gsoc2008-gui/gui/themes/scummodern.stx
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/themes/scummodern.stx	2008-08-10 22:02:37 UTC (rev 33770)
+++ scummvm/branches/gsoc2008-gui/gui/themes/scummodern.stx	2008-08-10 22:03:00 UTC (rev 33771)
@@ -60,6 +60,7 @@
 	<bitmaps>
 		<bitmap filename = 'logo.bmp'/>
 		<bitmap filename = 'cursor.bmp'/>
+		<bitmap filename = 'checkbox.bmp'/>
 	</bitmaps>
 
 	<fonts>
@@ -419,7 +420,7 @@
 				vertical_align = 'top'
 				horizontal_align = 'left'
 		/>
-		<drawstep	func = 'roundedsq'
+/*		<drawstep	func = 'roundedsq'
 					fill = 'gradient'
 					radius = 4
 					fg_color = 'white'
@@ -428,6 +429,9 @@
 					shadow = 0
 					bevel = 1
 					bevel_color = 'shadowcolor'
+		/> */
+		<drawstep	func = 'bitmap'
+					file = 'checkbox.bmp'
 		/>
 	</drawdata>
 
@@ -518,7 +522,7 @@
 				padding = '7, 5, 0, 0'
 		/>
 		<widget name = 'EditTextWidget'
-				padding = '7, 5, 0, 0'
+				padding = '5, 5, 0, 0'
 		/>
 		<widget name = 'Console'
 				padding = '7, 5, 5, 5'


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